cqp преди 2 месеца
родител
ревизия
5ccf82e875
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      app/Console/Commands/ToDoReminder.php

+ 3 - 2
app/Console/Commands/ToDoReminder.php

@@ -50,16 +50,17 @@ class ToDoReminder extends Command
         $now = time();
 
         $wxService = new WxTemplateMessageService();
+        $appid = config("wx_msg.f_appid");
         TodoList::where('status', '<', TodoList::status_two)
             ->where('del_time', 0)
             ->where('remind_start', '<=', $now)
             ->select(TodoList::$field)
             ->orderBy('id')
-            ->chunkById(10, function ($data) use ($now, $wxService) {
+            ->chunkById(10, function ($data) use ($now, $wxService, $appid) {
                 // 查找关联员工 openid
                 $wxInfo = WxEmployeeOfficial::where('employee_id', array_column($data,'crt_id'))
                     ->where('type', WxEmployeeOfficial::login_type_two)
-                    ->where('del_time', 0)
+                    ->where('appid', $appid)
                     ->pluck('open_id','id')
                     ->toArray();