作者 ZhengBing He

log

@@ -43,14 +43,17 @@ class PushNotify extends Command @@ -43,14 +43,17 @@ class PushNotify extends Command
43 while (true) { 43 while (true) {
44 try { 44 try {
45 $tick = Tickets::where('ding', 0) 45 $tick = Tickets::where('ding', 0)
  46 + ->where('submit_side', 2)
46 // ->where('project_id', 1) 47 // ->where('project_id', 1)
47 ->first(); 48 ->first();
48 if (!$tick) { 49 if (!$tick) {
  50 + echo now() . " WARNING | 没有待推送的工单\n";
49 sleep(3); 51 sleep(3);
50 continue; 52 continue;
51 } 53 }
52 $project = $tick->project; 54 $project = $tick->project;
53 if ($project->version != 6 || $project->is_del == 1) { 55 if ($project->version != 6 || $project->is_del == 1) {
  56 + echo now() . " WARNING | 项目版本或状态异常 \n";
54 $tick->ding = 1; 57 $tick->ding = 1;
55 $tick->save(); 58 $tick->save();
56 continue; 59 continue;
@@ -63,7 +66,7 @@ class PushNotify extends Command @@ -63,7 +66,7 @@ class PushNotify extends Command
63 ->value('friend_id'); 66 ->value('friend_id');
64 if (empty($message_push->friend_id)) 67 if (empty($message_push->friend_id))
65 { 68 {
66 - echo now() . " 项目ID:{$project->table_id} 没有绑定企微群\n"; 69 + echo now() . " WARNING | 项目ID:{$project->table_id} 没有绑定企微群\n";
67 $tick->ding = 1; 70 $tick->ding = 1;
68 $tick->save(); 71 $tick->save();
69 continue; 72 continue;
@@ -82,9 +85,9 @@ class PushNotify extends Command @@ -82,9 +85,9 @@ class PushNotify extends Command
82 $message_push->save(); 85 $message_push->save();
83 $tick->ding = 1; 86 $tick->ding = 1;
84 $tick->save(); 87 $tick->save();
85 - echo now() . " 项目ID:{$project->table_id} 工单ID:{$tick->id} 推送成功\n"; 88 + echo now() . " INFO | 项目ID:{$project->table_id} 工单ID:{$tick->id} 推送成功\n";
86 }catch (\Exception $exception){ 89 }catch (\Exception $exception){
87 - echo date('Y-m-d H:i:s')." ".$exception->getMessage()."\n"; 90 + echo date('Y-m-d H:i:s')." ERROR | ".$exception->getMessage()."\n";
88 break; 91 break;
89 } 92 }
90 } 93 }