作者 刘锟

update

@@ -61,6 +61,9 @@ class SyncInquiryProject extends Command @@ -61,6 +61,9 @@ class SyncInquiryProject extends Command
61 */ 61 */
62 public function handle() 62 public function handle()
63 { 63 {
  64 + //截断路由表
  65 + InquiryProjectRoute::truncate();
  66 +
64 $this->output('开始同步v5'); 67 $this->output('开始同步v5');
65 $this->syncGloV5(); 68 $this->syncGloV5();
66 $this->output('开始同步v6'); 69 $this->output('开始同步v6');
@@ -202,8 +205,9 @@ class SyncInquiryProject extends Command @@ -202,8 +205,9 @@ class SyncInquiryProject extends Command
202 if (empty($ids)) 205 if (empty($ids))
203 return true; 206 return true;
204 $project_num = InquiryProject::whereIn('id', $ids)->delete(); 207 $project_num = InquiryProject::whereIn('id', $ids)->delete();
205 - $project_route_num = InquiryProjectRoute::whereIn('project_id', $ids)->delete();  
206 - $this->log('删除过期项目数量:' . $project_num . ', 删除过期项目路由数量:' . $project_route_num); 208 +// $project_route_num = InquiryProjectRoute::whereIn('project_id', $ids)->delete();
  209 +// $this->log('删除过期项目数量:' . $project_num . ', 删除过期项目路由数量:' . $project_route_num);
  210 + $this->log('删除过期项目数量:' . $project_num);
207 return true; 211 return true;
208 } 212 }
209 213
@@ -95,7 +95,7 @@ class SyncInquiryProjectRoute extends Command @@ -95,7 +95,7 @@ class SyncInquiryProjectRoute extends Command
95 $result = json_decode($result, true); 95 $result = json_decode($result, true);
96 if (empty($result)) { 96 if (empty($result)) {
97 // 未获取到数据 删除当前项目过期路由 97 // 未获取到数据 删除当前项目过期路由
98 - $this->deleteExpire($task->id, $date); 98 +// $this->deleteExpire($task->id, $date);
99 $this->log('syncGloV5Route 未获取到路由信息:' . $task->id . ', 路由获取地址:' . ($task->is_split && $task->test_url ? $task->test_url : $task->main_url) . 'k_u_api.php'); 99 $this->log('syncGloV5Route 未获取到路由信息:' . $task->id . ', 路由获取地址:' . ($task->is_split && $task->test_url ? $task->test_url : $task->main_url) . 'k_u_api.php');
100 return false; 100 return false;
101 } 101 }
@@ -118,7 +118,7 @@ class SyncInquiryProjectRoute extends Command @@ -118,7 +118,7 @@ class SyncInquiryProjectRoute extends Command
118 } 118 }
119 119
120 // 删除当前项目过期路由 120 // 删除当前项目过期路由
121 - $this->deleteExpire($task->id, $date); 121 +// $this->deleteExpire($task->id, $date);
122 return true; 122 return true;
123 } 123 }
124 124
@@ -153,7 +153,7 @@ class SyncInquiryProjectRoute extends Command @@ -153,7 +153,7 @@ class SyncInquiryProjectRoute extends Command
153 DB::disconnect('custom_mysql'); 153 DB::disconnect('custom_mysql');
154 154
155 // 删除当前项目过期路由 155 // 删除当前项目过期路由
156 - $this->deleteExpire($task->id, $date); 156 +// $this->deleteExpire($task->id, $date);
157 157
158 return true; 158 return true;
159 } 159 }
@@ -54,6 +54,12 @@ class SyncInquiryRelay extends Command @@ -54,6 +54,12 @@ class SyncInquiryRelay extends Command
54 54
55 public function handle() 55 public function handle()
56 { 56 {
  57 + $hour = date('H');
  58 + if ($hour >= 2 && $hour <= 7) {
  59 + //凌晨2点~7点是同步项目及路由时间,该时间段不同步询盘
  60 + return;
  61 + }
  62 +
57 $this->output('开始同步表单系统询盘'); 63 $this->output('开始同步表单系统询盘');
58 $this->getInquiryForm(); 64 $this->getInquiryForm();
59 65