作者 刘锟

update

... ... @@ -147,6 +147,11 @@ class InquiryForwardLogic extends BaseLogic
}
$is_v6 = $project_version->version == 6 ? 1 : 0;
//获取国家
$country = $this->param['country'] ?? '';
if(!$country){
$country = file_get_contents("http://ip.globalso.com?ip=" . $this->param['ip']);
}
//获取发送时间
if (isset($this->param['inquiry_date']) && $this->param['inquiry_date']) {
... ... @@ -156,7 +161,7 @@ class InquiryForwardLogic extends BaseLogic
//未填写时间
//1.根据时差获取当地随机10-18点时间
$timezoneModel = new AreaTimezone();
$country_area = $timezoneModel->read(['name' => $info['country']], ['diff']);
$country_area = $timezoneModel->read(['name' => $country], ['diff']);
$diff = $country_area ? $country_area['diff'] : 0;
if ($diff > 0) {
$area_time = date('Y-m-d H:i:s', strtotime($now . ' +' . $diff . ' hours'));
... ... @@ -196,7 +201,7 @@ class InquiryForwardLogic extends BaseLogic
$start_at = $now;
}
InquiryRelayDetail::createInquiry($info['id'], $website, $info['country'], $this->param['ip'], $this->param['name'], $this->param['email'], $this->param['phone'] ?? '', $this->param['message'], $is_v6, json_encode([$url]), $start_at);
InquiryRelayDetail::createInquiry($info['id'], $website, $country, $this->param['ip'], $this->param['name'], $this->param['email'], $this->param['phone'] ?? '', $this->param['message'], $is_v6, json_encode([$url]), $start_at);
$num += 1;
}
... ...