|
|
@@ -42,7 +42,11 @@ class ToDoReminder extends Command
|
|
|
*/
|
|
|
public function handle()
|
|
|
{
|
|
|
- $this->handleReminders();
|
|
|
+ try {
|
|
|
+ $this->handleReminders();
|
|
|
+ }catch (\Exception $exception){
|
|
|
+ Log::error("发送待办提醒异常", ['msg' => $exception->getMessage()]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function handleReminders()
|
|
|
@@ -57,8 +61,11 @@ class ToDoReminder extends Command
|
|
|
->select(TodoList::$field)
|
|
|
->orderBy('id')
|
|
|
->chunkById(10, function ($data) use ($now, $wxService, $appid) {
|
|
|
+
|
|
|
+ $crtIds = $data->pluck('crt_id')->toArray();
|
|
|
+
|
|
|
// 查找关联员工 openid
|
|
|
- $wxInfo = WxEmployeeOfficial::where('employee_id', array_column($data,'crt_id'))
|
|
|
+ $wxInfo = WxEmployeeOfficial::where('employee_id', $crtIds)
|
|
|
->where('type', WxEmployeeOfficial::login_type_two)
|
|
|
->where('appid', $appid)
|
|
|
->pluck('open_id','id')
|