代码提交
This commit is contained in:
@@ -51,9 +51,9 @@ export function ScenarioAcquisitionCard({
|
|||||||
? task.reqConf.selectedDevices.length
|
? task.reqConf.selectedDevices.length
|
||||||
: 0
|
: 0
|
||||||
// 获客数和已添加数可根据 msgConf 或其它字段自定义
|
// 获客数和已添加数可根据 msgConf 或其它字段自定义
|
||||||
const acquiredCount = task.stats?.acquired ?? 0
|
const acquiredCount = task.acquiredCount ?? 0
|
||||||
const addedCount = task.stats?.added ?? 0
|
const addedCount = task.addedCount ?? 0
|
||||||
const passRate = calculatePassRate(acquiredCount, addedCount)
|
const passRate = task.passRate ?? 0
|
||||||
const [menuOpen, setMenuOpen] = useState(false)
|
const [menuOpen, setMenuOpen] = useState(false)
|
||||||
const menuRef = useRef<HTMLDivElement>(null)
|
const menuRef = useRef<HTMLDivElement>(null)
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ export function ScenarioAcquisitionCard({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-4 gap-2 mb-4">
|
<div className="grid grid-cols-2 gap-2 mb-4">
|
||||||
<a href={`/scenarios/${channel}/devices`} className="block">
|
<a href={`/scenarios/${channel}/devices`} className="block">
|
||||||
<Card className="p-2 hover:bg-gray-50 transition-colors cursor-pointer">
|
<Card className="p-2 hover:bg-gray-50 transition-colors cursor-pointer">
|
||||||
<div className="text-sm text-gray-500 mb-1">设备数</div>
|
<div className="text-sm text-gray-500 mb-1">设备数</div>
|
||||||
@@ -199,10 +199,6 @@ export function ScenarioAcquisitionCard({
|
|||||||
<Clock className="w-4 h-4" />
|
<Clock className="w-4 h-4" />
|
||||||
<span>上次执行:{task.lastUpdated}</span>
|
<span>上次执行:{task.lastUpdated}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center space-x-2">
|
|
||||||
<Clock className="w-4 h-4" />
|
|
||||||
<span>下次执行:{task.nextExecutionTime}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -117,7 +117,8 @@ class GetPlanSceneListV1Controller extends BaseController
|
|||||||
{
|
{
|
||||||
return Db::name('customer_acquisition_task')
|
return Db::name('customer_acquisition_task')
|
||||||
->where('sceneId', $sceneId)
|
->where('sceneId', $sceneId)
|
||||||
->where('status', 1)
|
->where('companyId',$this->getUserInfo('companyId'))
|
||||||
|
->where('deleteTime', 0)
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,17 @@ class PlanSceneV1Controller extends BaseController
|
|||||||
$val['reqConf'] = json_decode($val['reqConf'],true);
|
$val['reqConf'] = json_decode($val['reqConf'],true);
|
||||||
$val['msgConf'] = json_decode($val['msgConf'],true);
|
$val['msgConf'] = json_decode($val['msgConf'],true);
|
||||||
$val['tagConf'] = json_decode($val['tagConf'],true);
|
$val['tagConf'] = json_decode($val['tagConf'],true);
|
||||||
|
|
||||||
|
$val['acquiredCount'] = Db::name('task_customer')->where('task_id',$val['id'])->count();
|
||||||
|
$val['addedCount'] = Db::name('task_customer')->where('task_id',$val['id'])->whereIn('status',[1,2,3,4])->count();
|
||||||
|
$val['passCount'] = Db::name('task_customer')->where('task_id',$val['id'])->where('status',4)->count();
|
||||||
|
|
||||||
|
$val['passRate'] = 0;
|
||||||
|
if(!empty($val['passCount']) && !empty($val['addedCount'])){
|
||||||
|
$passRate = ($val['addedCount'] / $val['passCount']) * 100;
|
||||||
|
$val['passRate'] = number_format($passRate,2);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
unset($val);
|
unset($val);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user