This commit is contained in:
2025-09-22 10:24:24 +08:00
3 changed files with 13 additions and 14 deletions

1
Cunkebao/.env.local Normal file
View File

@@ -0,0 +1 @@
NEXT_PUBLIC_API_BASE_URL= http://yishi.com

View File

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

View File

@@ -55,11 +55,9 @@ class Workbench extends Validate
'distributeType' => 'requireIf:type,5|in:1,2', 'distributeType' => 'requireIf:type,5|in:1,2',
'maxPerDay' => 'requireIf:type,5|number|min:1', 'maxPerDay' => 'requireIf:type,5|number|min:1',
'timeType' => 'requireIf:type,5|in:1,2', 'timeType' => 'requireIf:type,5|in:1,2',
'startTime' => 'requireIf:type,5|dateFormat:H:i',
'endTime' => 'requireIf:type,5|dateFormat:H:i',
'accountGroups' => 'requireIf:type,5|array|min:1', 'accountGroups' => 'requireIf:type,5|array|min:1',
// 通用参数 // 通用参数
'deveiceGroups' => 'requireIf:type,1,2,5|array', 'deviceGroups' => 'requireIf:type,1,2,5|array',
]; ];
/** /**
@@ -142,8 +140,8 @@ class Workbench extends Validate
'timeType.requireIf' => '请选择时间类型', 'timeType.requireIf' => '请选择时间类型',
// 通用提示 // 通用提示
'deveiceGroups.require' => '请选择设备', 'deviceGroups.require' => '请选择设备',
'deveiceGroups.array' => '设备格式错误', 'deviceGroups.array' => '设备格式错误',
'targetGroups.require' => '请选择目标用户组', 'targetGroups.require' => '请选择目标用户组',
'targetGroups.array' => '目标用户组格式错误', 'targetGroups.array' => '目标用户组格式错误',
'accountGroups.requireIf' => '流量分发时必须选择分发账号', 'accountGroups.requireIf' => '流量分发时必须选择分发账号',
@@ -155,7 +153,7 @@ class Workbench extends Validate
* 验证场景 * 验证场景
*/ */
protected $scene = [ protected $scene = [
'create' => ['name', 'type', 'autoStart', 'deveiceGroups', 'targetGroups', 'create' => ['name', 'type', 'autoStart', 'deviceGroups', 'targetGroups',
'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes', 'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes',
'syncInterval', 'syncCount', 'syncType', 'syncInterval', 'syncCount', 'syncType',
'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups', 'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups',
@@ -163,7 +161,7 @@ class Workbench extends Validate
'groupNameTemplate', 'maxGroupsPerDay', 'groupSizeMin', 'groupSizeMax', 'groupNameTemplate', 'maxGroupsPerDay', 'groupSizeMin', 'groupSizeMax',
], ],
'update_status' => ['id', 'status'], 'update_status' => ['id', 'status'],
'edit' => ['name', 'type', 'autoStart', 'deveiceGroups', 'targetGroups', 'edit' => ['name', 'type', 'autoStart', 'deviceGroups', 'targetGroups',
'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes', 'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes',
'syncInterval', 'syncCount', 'syncType', 'syncInterval', 'syncCount', 'syncType',
'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups', 'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups',