作者 刘锟

update

... ... @@ -81,6 +81,7 @@ class InquiryForwardLogic extends BaseLogic
if (!$project_version) {
continue;
}
$is_v6 = $project_version->version == 6 ? 1 : 0;
//计算发送时间
if ($this->param['inquiry_diff'] > 0) {
... ... @@ -94,20 +95,7 @@ class InquiryForwardLogic extends BaseLogic
$start_at = $now;
}
InquiryRelayDetail::insert([
'form_id' => $info['id'],
'website' => $website,
'country' => $info['country'],
'ip' => $this->param['ip'],
'name' => $this->param['name'],
'email' => $this->param['email'],
'phone' => $this->param['phone'],
'message' => $this->param['message'],
'is_v6' => $project_version->version == 6 ? 1 : 0,
'start_at' => $start_at,
'created_at' => $now,
'updated_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, $start_at);
$num += 1;
}
... ...
... ... @@ -5,6 +5,7 @@
* Date: 2024/9/30
* Time: 14:56
*/
namespace App\Models\Inquiry;
use Illuminate\Database\Eloquent\Model;
... ... @@ -22,7 +23,7 @@ class InquiryRelayDetail extends Model
protected $table = 'gl_inquiry_relay_detail';
/**
* 任务状态, 0:初始化,1:待处理,2:处理成功,3:抛弃数据,9:处理失败
* 任务状态, 0:待处理,1:处理中,2:处理成功,3:抛弃数据,9:处理失败
*/
const STATUS_INIT = 0;
const STATUS_PEND = 1;
... ... @@ -37,8 +38,8 @@ class InquiryRelayDetail extends Model
public static function statusMap()
{
return [
self::STATUS_INIT => '初始化',
self::STATUS_PEND => '待处理',
self::STATUS_INIT => '待处理',
self::STATUS_PEND => '处理中',
self::STATUS_SUCCESS => '处理成功',
self::STATUS_FORGO => '抛弃数据',
self::STATUS_FAIL => '处理失败',
... ... @@ -47,50 +48,33 @@ class InquiryRelayDetail extends Model
/**
* 创建询盘转发详情待处理任务
* @param $task_id
* @param $form_id
* @param $re_website
* @param $website
* @param $country
* @param $ip
* @param $name
* @param $email
* @param $phone
* @param $message
* @param $text_id
* @param $device_port
* @param $user_agent
* @param $referrer
* @param $urls
* @param $is_v6
* @param $start_at
* @param int $status
* @return ReInquiryDetail
*/
public static function createInquiry($task_id, $form_id, $re_website, $country, $ip, $name, $email, $phone, $message, $text_id, $device_port,
$user_agent, $referrer, $urls, $is_v6, $start_at, $status = self::STATUS_INIT, $type = 1)
public static function createInquiry($form_id, $website, $country, $ip, $name, $email, $phone, $message, $is_v6, $start_at, $status = self::STATUS_INIT)
{
$self = new self();
$self->task_id = $task_id;
$self->form_id = $form_id;
$self->re_website = $re_website;
$self->website = $website;
$self->country = $country;
$self->ip = $ip;
$self->name = $name;
$self->email = $email;
$self->phone = $phone;
$self->message = $message;
$self->text_id = $text_id;
$self->device_port = $device_port;
$self->user_agent = $user_agent;
$self->referrer = $referrer;
$self->urls = json_encode($urls);
$self->is_v6 = $is_v6;
$self->num = count($urls) + 1;
$self->start_at = $start_at;
$self->status = $status;
$self->type = $type;
$self->save();
return $self;
}
/**
... ...