作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -87,9 +87,6 @@ class postInquiry extends Command @@ -87,9 +87,6 @@ class postInquiry extends Command
87 87
88 if($val['type'] == 1){ 88 if($val['type'] == 1){
89 $this->visit($detail, $val); 89 $this->visit($detail, $val);
90 - }else{  
91 - $this->inquiry($detail, $val);  
92 - }  
93 90
94 $init_num = ReInquiryDetailLog::where('detail_id', $val['detail_id'])->where('status', ReInquiryDetailLog::STATUS_INIT)->count(); 91 $init_num = ReInquiryDetailLog::where('detail_id', $val['detail_id'])->where('status', ReInquiryDetailLog::STATUS_INIT)->count();
95 if(!$init_num){ 92 if(!$init_num){
@@ -97,12 +94,22 @@ class postInquiry extends Command @@ -97,12 +94,22 @@ class postInquiry extends Command
97 $detail->status = ReInquiryDetail::STATUS_SUCCESS; 94 $detail->status = ReInquiryDetail::STATUS_SUCCESS;
98 $detail->result = $val['url']; 95 $detail->result = $val['url'];
99 $detail->save(); 96 $detail->save();
  97 + }
  98 + }else{
  99 + $res = $this->inquiry($detail, $val);
  100 +
  101 + //转发详情
  102 + $detail->status = $res ? ReInquiryDetail::STATUS_SUCCESS : ReInquiryDetail::STATUS_FAIL;
  103 + $detail->result = $val['url'];
  104 + $detail->save();
100 //转发表单 105 //转发表单
  106 + if($res){
101 $form = ReInquiryForm::find($detail['form_id']); 107 $form = ReInquiryForm::find($detail['form_id']);
102 $form->success_num = $form->success_num + 1; 108 $form->success_num = $form->success_num + 1;
103 $form->save(); 109 $form->save();
104 Log::channel('inquiry_relay')->info('询盘成功:',[$detail['form_id'], $val->id, getmypid()]); 110 Log::channel('inquiry_relay')->info('询盘成功:',[$detail['form_id'], $val->id, getmypid()]);
105 } 111 }
  112 + }
106 }catch (\Exception $e){ 113 }catch (\Exception $e){
107 Log::channel('inquiry_relay')->error('inquiry_relay handle error', [$e->getMessage(), $e->getFile(), $e->getLine()]); 114 Log::channel('inquiry_relay')->error('inquiry_relay handle error', [$e->getMessage(), $e->getFile(), $e->getLine()]);
108 115