作者 Your Name
... ... @@ -53,6 +53,7 @@ class SyncInquiry extends Command
{
while (true) {
$result = $this->getInquiry();
$this->output('新的询盘:' . count($result));
if (!$result){
//5分钟同步一次
sleep(300);
... ...
... ... @@ -49,6 +49,7 @@ class postInquiry extends Command
}
// 询盘数据入库
foreach ($list as $key => $val) {
$this->output('开始执行' . $val->id);
try {
$detail = ReInquiryDetail::find($val['detail_id']);
if($val['type'] == 1){
... ... @@ -68,7 +69,11 @@ class postInquiry extends Command
}
}
}catch (\Exception $e){
Log::channel('inquiry_relay')->error('inquiry_relay handle error', [$e->getMessage(), $e->getFile(), $e->getLine()]);
$val->status = ReInquiryDetailLog::STATUS_FAIL;
$val->remark = mb_substr($e->getMessage(), 0, 200);
$val->save();
}
}
}
... ... @@ -90,6 +95,7 @@ class postInquiry extends Command
$log->save();
Log::channel('inquiry_relay')->error('inquiry_relay visit error', [$res, $detail['re_website'] . 'api/traffic_visit/',$data]);
return false;
}
}else{
//v4 v5分离项目 往测试链接推
... ... @@ -118,8 +124,12 @@ class postInquiry extends Command
$log->save();
Log::channel('inquiry_relay')->error('inquiry_relay v4|v5 visit error', [$res, $website . 'wp-admin/admin-ajax.php', $data]);
return false;
}
}
$log->status = ReInquiryDetailLog::STATUS_SUCCESS;
$log->save();
return true;
}
public function inquiry(ReInquiryDetail $detail, ReInquiryDetailLog $log){
... ... @@ -170,6 +180,8 @@ class postInquiry extends Command
return false;
}
}
$log->status = ReInquiryDetailLog::STATUS_SUCCESS;
$log->save();
return true;
}
... ...
... ... @@ -141,7 +141,8 @@ class AdsController extends BaseController
}
$data = [
'is_v6' => 0,
'agent' => $res['data']
'agent' => $res['data'],
'domain' => $domain,
];
return $this->response('success', Code::SUCCESS, $data);
}
... ...