作者 赵彬吉

update

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