作者 Your Name
@@ -53,6 +53,7 @@ class SyncInquiry extends Command @@ -53,6 +53,7 @@ class SyncInquiry extends Command
53 { 53 {
54 while (true) { 54 while (true) {
55 $result = $this->getInquiry(); 55 $result = $this->getInquiry();
  56 + $this->output('新的询盘:' . count($result));
56 if (!$result){ 57 if (!$result){
57 //5分钟同步一次 58 //5分钟同步一次
58 sleep(300); 59 sleep(300);
@@ -49,6 +49,7 @@ class postInquiry extends Command @@ -49,6 +49,7 @@ class postInquiry extends Command
49 } 49 }
50 // 询盘数据入库 50 // 询盘数据入库
51 foreach ($list as $key => $val) { 51 foreach ($list as $key => $val) {
  52 + $this->output('开始执行' . $val->id);
52 try { 53 try {
53 $detail = ReInquiryDetail::find($val['detail_id']); 54 $detail = ReInquiryDetail::find($val['detail_id']);
54 if($val['type'] == 1){ 55 if($val['type'] == 1){
@@ -68,7 +69,11 @@ class postInquiry extends Command @@ -68,7 +69,11 @@ class postInquiry extends Command
68 } 69 }
69 } 70 }
70 }catch (\Exception $e){ 71 }catch (\Exception $e){
  72 + Log::channel('inquiry_relay')->error('inquiry_relay handle error', [$e->getMessage(), $e->getFile(), $e->getLine()]);
71 73
  74 + $val->status = ReInquiryDetailLog::STATUS_FAIL;
  75 + $val->remark = mb_substr($e->getMessage(), 0, 200);
  76 + $val->save();
72 } 77 }
73 } 78 }
74 } 79 }
@@ -90,6 +95,7 @@ class postInquiry extends Command @@ -90,6 +95,7 @@ class postInquiry extends Command
90 $log->save(); 95 $log->save();
91 96
92 Log::channel('inquiry_relay')->error('inquiry_relay visit error', [$res, $detail['re_website'] . 'api/traffic_visit/',$data]); 97 Log::channel('inquiry_relay')->error('inquiry_relay visit error', [$res, $detail['re_website'] . 'api/traffic_visit/',$data]);
  98 + return false;
93 } 99 }
94 }else{ 100 }else{
95 //v4 v5分离项目 往测试链接推 101 //v4 v5分离项目 往测试链接推
@@ -118,8 +124,12 @@ class postInquiry extends Command @@ -118,8 +124,12 @@ class postInquiry extends Command
118 $log->save(); 124 $log->save();
119 125
120 Log::channel('inquiry_relay')->error('inquiry_relay v4|v5 visit error', [$res, $website . 'wp-admin/admin-ajax.php', $data]); 126 Log::channel('inquiry_relay')->error('inquiry_relay v4|v5 visit error', [$res, $website . 'wp-admin/admin-ajax.php', $data]);
  127 + return false;
121 } 128 }
122 } 129 }
  130 + $log->status = ReInquiryDetailLog::STATUS_SUCCESS;
  131 + $log->save();
  132 + return true;
123 } 133 }
124 134
125 public function inquiry(ReInquiryDetail $detail, ReInquiryDetailLog $log){ 135 public function inquiry(ReInquiryDetail $detail, ReInquiryDetailLog $log){
@@ -170,6 +180,8 @@ class postInquiry extends Command @@ -170,6 +180,8 @@ class postInquiry extends Command
170 return false; 180 return false;
171 } 181 }
172 } 182 }
  183 + $log->status = ReInquiryDetailLog::STATUS_SUCCESS;
  184 + $log->save();
173 return true; 185 return true;
174 } 186 }
175 187
@@ -141,7 +141,8 @@ class AdsController extends BaseController @@ -141,7 +141,8 @@ class AdsController extends BaseController
141 } 141 }
142 $data = [ 142 $data = [
143 'is_v6' => 0, 143 'is_v6' => 0,
144 - 'agent' => $res['data'] 144 + 'agent' => $res['data'],
  145 + 'domain' => $domain,
145 ]; 146 ];
146 return $this->response('success', Code::SUCCESS, $data); 147 return $this->response('success', Code::SUCCESS, $data);
147 } 148 }