bug修复

This commit is contained in:
wong
2025-09-19 17:50:53 +08:00
parent 24bb2adc70
commit 2bd82fc6ef
2 changed files with 12 additions and 14 deletions

View File

@@ -120,7 +120,7 @@ class GetAddFriendPlanDetailV1Controller extends Controller
// 解析JSON字段
$sceneConf = json_decode($plan['sceneConf'], true) ?: [];
$reqConf = json_decode($plan['reqConf'], true) ?: [];
$reqConf['deveiceGroups'] = $reqConf['device'];
$reqConf['deviceGroups'] = $reqConf['device'];
$msgConf = json_decode($plan['msgConf'], true) ?: [];
$tagConf = json_decode($plan['tagConf'], true) ?: [];
@@ -139,8 +139,8 @@ class GetAddFriendPlanDetailV1Controller extends Controller
}
if (!empty($reqConf['deveiceGroups'])){
$deveiceGroupsOptions = DeviceModel::alias('d')
if (!empty($reqConf['deviceGroups'])){
$deviceGroupsOptions = DeviceModel::alias('d')
->field([
'd.id', 'd.imei', 'd.memo', 'd.alive',
'l.wechatId',
@@ -149,16 +149,16 @@ class GetAddFriendPlanDetailV1Controller extends Controller
->leftJoin('device_wechat_login l', 'd.id = l.deviceId and l.alive =' . DeviceWechatLoginModel::ALIVE_WECHAT_ACTIVE . ' and l.companyId = d.companyId')
->leftJoin('wechat_account a', 'l.wechatId = a.wechatId')
->order('d.id desc')
->whereIn('d.id',$reqConf['deveiceGroups'])
->whereIn('d.id',$reqConf['deviceGroups'])
->select();
foreach ($deveiceGroupsOptions as &$device) {
foreach ($deviceGroupsOptions as &$device) {
$curstomer = WechatCustomerModel::field('friendShip')->where(['wechatId' => $device['wechatId']])->find();
$device['totalFriend'] = $curstomer->friendShip->totalFriend ?? 0;
}
unset($device);
$reqConf['deveiceGroupsOptions'] = $deveiceGroupsOptions;
$reqConf['deviceGroupsOptions'] = $deviceGroupsOptions;
}else{
$reqConf['deveiceGroupsOptions'] = [];
$reqConf['deviceGroupsOptions'] = [];
}