更新商机分析

This commit is contained in:
yaooo 2023-11-07 14:10:50 +08:00
parent 98bf3edbab
commit a754b76549

View File

@ -17,6 +17,7 @@ namespace app\adminapi\lists\informationg;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\informationg\UserInformationg;
use app\common\model\informationg\UserInformationgDemand;
use app\common\lists\ListsSearchInterface;
@ -61,6 +62,23 @@ class UserInformationgLists extends BaseAdminDataLists implements ListsSearchInt
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
$informationIdArray = [];
foreach($lists as $k=>$v) {
$informationIdArray[] = $v['id'];
}
$data = UserInformationgDemand::whereIn('information_id', $informationIdArray)->order('id', 'desc')->select();
$aianalyseArray = [];
foreach($data as $kk=>$vv) {
if (!empty($vv['ai_aianalyse'])) {
$aianalyseArray[$vv['information_id']][] = $vv['id'];
}
}
foreach($lists as $k=>$v) {
$lists[$k]['aianalyse_status'] = 0;
if (!empty($aianalyseArray[$v['id']])) {
$lists[$k]['aianalyse_status'] = 1;
}
}
return $lists;
}