代码优化
This commit is contained in:
@@ -88,16 +88,25 @@ class PostCreateAddFriendPlanV1Controller extends Controller
|
||||
// 其余参数归为sceneConf
|
||||
$sceneConf = $params;
|
||||
unset(
|
||||
$sceneConf['id'],
|
||||
$sceneConf['apiKey'],
|
||||
$sceneConf['userId'],
|
||||
$sceneConf['status'],
|
||||
$sceneConf['planId'],
|
||||
$sceneConf['name'],
|
||||
$sceneConf['sceneId'],
|
||||
$sceneConf['messagePlans'],
|
||||
$sceneConf['scenarioTags'],
|
||||
$sceneConf['customTags'],
|
||||
$sceneConf['device'],
|
||||
$sceneConf['orderTableFileName'],
|
||||
$sceneConf['userInfo'],
|
||||
$sceneConf['textUrl'],
|
||||
$sceneConf['remarkType'],
|
||||
$sceneConf['greeting'],
|
||||
$sceneConf['addFriendInterval'],
|
||||
$sceneConf['startTime'],
|
||||
$sceneConf['orderTableFile'],
|
||||
$sceneConf['endTime']
|
||||
);
|
||||
|
||||
|
||||
@@ -65,6 +65,10 @@ class PostUpdateAddFriendPlanV1Controller extends Controller
|
||||
// 其余参数归为sceneConf
|
||||
$sceneConf = $params;
|
||||
unset(
|
||||
$sceneConf['id'],
|
||||
$sceneConf['apiKey'],
|
||||
$sceneConf['userId'],
|
||||
$sceneConf['status'],
|
||||
$sceneConf['planId'],
|
||||
$sceneConf['name'],
|
||||
$sceneConf['sceneId'],
|
||||
@@ -72,10 +76,14 @@ class PostUpdateAddFriendPlanV1Controller extends Controller
|
||||
$sceneConf['scenarioTags'],
|
||||
$sceneConf['customTags'],
|
||||
$sceneConf['device'],
|
||||
$sceneConf['orderTableFileName'],
|
||||
$sceneConf['userInfo'],
|
||||
$sceneConf['textUrl'],
|
||||
$sceneConf['remarkType'],
|
||||
$sceneConf['greeting'],
|
||||
$sceneConf['addFriendInterval'],
|
||||
$sceneConf['startTime'],
|
||||
$sceneConf['orderTableFile'],
|
||||
$sceneConf['endTime']
|
||||
);
|
||||
|
||||
@@ -90,6 +98,7 @@ class PostUpdateAddFriendPlanV1Controller extends Controller
|
||||
'updateTime'=> time(),
|
||||
];
|
||||
|
||||
|
||||
|
||||
try {
|
||||
// 更新数据
|
||||
|
||||
@@ -177,14 +177,13 @@ class Adapter implements WeChatServiceInterface
|
||||
if ($taskData) {
|
||||
|
||||
foreach ($taskData as $task) {
|
||||
|
||||
$task_id = $task['task_id'];
|
||||
|
||||
$task_info = $this->getCustomerAcquisitionTask($task_id);
|
||||
|
||||
if (empty($task_info['status']) || empty($task_info['reqConf']) || empty($task_info['reqConf']['device'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//筛选出设备在线微信在线
|
||||
$wechatIdAccountIdMap = $this->getWeChatIdsAccountIdsMapByDeviceIds($task_info['reqConf']['device']);
|
||||
|
||||
if (empty($wechatIdAccountIdMap)) {
|
||||
@@ -690,6 +689,7 @@ class Adapter implements WeChatServiceInterface
|
||||
}
|
||||
$records = Db::table('s2_wechat_account')
|
||||
->where('deviceAlive', 1)
|
||||
->where('wechatAlive', 1)
|
||||
->where('currentDeviceId', 'in', $deviceIds)
|
||||
->field('id,wechatId')
|
||||
->column('id,wechatId');
|
||||
|
||||
Reference in New Issue
Block a user