作者 ZhengBing He

合并分支 'workorder' 到 'master'

Workorder



查看合并请求 !2164
@@ -102,14 +102,13 @@ class FetchTicketProjects extends Command @@ -102,14 +102,13 @@ class FetchTicketProjects extends Command
102 $project->save(); 102 $project->save();
103 } 103 }
104 } 104 }
105 - echo "V5: {$item['postid']} - {$item['title']} - {$item['company']} - {$item['main_url']}\n";  
106 } 105 }
107 $postids = collect($items)->pluck('postid')->toArray(); 106 $postids = collect($items)->pluck('postid')->toArray();
108 // 软删除 gl_ticket_projects 中不存在的项目 107 // 软删除 gl_ticket_projects 中不存在的项目
109 TicketProject::where('version', 5) 108 TicketProject::where('version', 5)
110 ->whereNotIn('post_id', $postids) 109 ->whereNotIn('post_id', $postids)
111 ->update(['is_del' => 1]); 110 ->update(['is_del' => 1]);
112 - echo "V5: fetch completed, total " . count($items) . " items\n"; 111 + echo date("Y-m-d H:i:s") . " V5: fetch completed, total " . count($items) . " items\n";
113 } 112 }
114 } 113 }
115 114
1 <?php 1 <?php
2 2
3 -namespace App\Console\Commands; 3 +namespace App\Console\Commands\WorkOrder;
4 4
  5 +use App\Models\WorkOrder\TicketLog;
5 use App\Models\WorkOrder\WorkOrderLog; 6 use App\Models\WorkOrder\WorkOrderLog;
6 use App\Services\DingTalkService; 7 use App\Services\DingTalkService;
7 use Illuminate\Console\Command; 8 use Illuminate\Console\Command;
@@ -42,12 +43,12 @@ class WorkOrderDing extends Command @@ -42,12 +43,12 @@ class WorkOrderDing extends Command
42 { 43 {
43 while (true) { 44 while (true) {
44 try { 45 try {
45 - $log = WorkOrderLog::where('ding', 0)->first(); 46 + $log = TicketLog::where('ding', 0)->first();
46 if (!$log) { 47 if (!$log) {
47 sleep(3); 48 sleep(3);
48 continue; 49 continue;
49 } 50 }
50 - $mobile = $log->manager->mobile; 51 + $mobile = $log->engineer->mobile;
51 $response = Http::withBasicAuth( 52 $response = Http::withBasicAuth(
52 env('DINGDING_BASIC_USER'), 53 env('DINGDING_BASIC_USER'),
53 env('DINGDING_BASIC_PASS') 54 env('DINGDING_BASIC_PASS')