作者 lyh
@@ -169,7 +169,6 @@ class RelayInquiry extends Command @@ -169,7 +169,6 @@ class RelayInquiry extends Command
169 while (true) { 169 while (true) {
170 $inquiry = $this->getInquiry(); 170 $inquiry = $this->getInquiry();
171 if ($inquiry->isEmpty()){ 171 if ($inquiry->isEmpty()){
172 - $this->logChannel()->info('未发现待处理询盘!');  
173 $this->output('未发现待处理询盘!'); 172 $this->output('未发现待处理询盘!');
174 sleep(60); 173 sleep(60);
175 continue; 174 continue;
@@ -67,6 +67,7 @@ class postInquiry extends Command @@ -67,6 +67,7 @@ class postInquiry extends Command
67 $form = ReInquiryForm::find($detail['form_id']); 67 $form = ReInquiryForm::find($detail['form_id']);
68 $form->success_num = $form->success_num + 1; 68 $form->success_num = $form->success_num + 1;
69 $form->save(); 69 $form->save();
  70 + Log::channel('inquiry_relay')->info($detail['form_id'] . '询盘成功' . $val->id);
70 } 71 }
71 } 72 }
72 }catch (\Exception $e){ 73 }catch (\Exception $e){
@@ -176,6 +177,10 @@ class postInquiry extends Command @@ -176,6 +177,10 @@ class postInquiry extends Command
176 ]; 177 ];
177 178
178 $res = Http::withoutVerifying()->post('https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data)->json(); 179 $res = Http::withoutVerifying()->post('https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data)->json();
  180 + //兼容接口返回格式
  181 + if(!empty($res['data'][0]['status'])){
  182 + $res['data'][0]['code'] = $res['data'][0]['status'] == 'success' ? 200 : 400;
  183 + }
179 if(empty($res['data'][0]['code']) || !in_array($res['data'][0]['code'], [200,300])){ 184 if(empty($res['data'][0]['code']) || !in_array($res['data'][0]['code'], [200,300])){
180 $log->status = ReInquiryDetailLog::STATUS_FAIL; 185 $log->status = ReInquiryDetailLog::STATUS_FAIL;
181 $log->remark = $res['message'] ?? ''; 186 $log->remark = $res['message'] ?? '';
@@ -59,8 +59,9 @@ class AdsController extends BaseController @@ -59,8 +59,9 @@ class AdsController extends BaseController
59 ->paginate($page_size); 59 ->paginate($page_size);
60 60
61 $relay_site_total = 0; 61 $relay_site_total = 0;
62 - foreach ($result as $item){ 62 + foreach ($result as &$item){
63 $relay_site_total += count($item->target); 63 $relay_site_total += count($item->target);
  64 + $item->requiry_num = ReInquiryDetail::where('task_id', $item->id)->where('status', ReInquiryDetail::STATUS_SUCCESS)->count();
64 } 65 }
65 $result = $result->toArray(); 66 $result = $result->toArray();
66 $result['relay_site_total'] = $relay_site_total; 67 $result['relay_site_total'] = $relay_site_total;