作者 ZhengBing He

ticketsDing

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')