|
...
|
...
|
@@ -139,16 +139,28 @@ class InquiryForwardLogic extends BaseLogic |
|
|
|
$this->fail('当前询盘状态无法转发');
|
|
|
|
}
|
|
|
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
$num = 0;
|
|
|
|
$now = date('Y-m-d H:i:s');
|
|
|
|
if (is_array($this->param['message'])) {
|
|
|
|
$message_list = $this->param['message'];
|
|
|
|
} else {
|
|
|
|
$message_list = [$this->param['message']];
|
|
|
|
}
|
|
|
|
$message_count = count($message_list);
|
|
|
|
if ($message_count == 0) {
|
|
|
|
$this->fail('内容不能为空');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_array($this->param['forward_url'])) {
|
|
|
|
$forward_url = $this->param['forward_url'];
|
|
|
|
} else {
|
|
|
|
$forward_url = explode(',', $this->param['forward_url']);
|
|
|
|
}
|
|
|
|
foreach ($forward_url as $url) {
|
|
|
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
$num = 0;
|
|
|
|
$now = date('Y-m-d H:i:s');
|
|
|
|
|
|
|
|
foreach ($forward_url as $key=>$url) {
|
|
|
|
$url = trim($url);
|
|
|
|
$domain_array = parse_url($url);
|
|
|
|
$website = $domain_array['host'] ?? '';
|
|
...
|
...
|
@@ -217,7 +229,10 @@ class InquiryForwardLogic extends BaseLogic |
|
|
|
$start_at = $now;
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
//获取询盘内容
|
|
|
|
$message = $message_list[$key % $message_count] ?? $message_list[0];
|
|
|
|
|
|
|
|
InquiryRelayDetail::createInquiry($info['id'], $website, $country, $this->param['ip'], $this->param['name'], $this->param['email'], $this->param['phone'] ?? '', $message, $is_v6, json_encode([$url]), $start_at);
|
|
|
|
|
|
|
|
$num += 1;
|
|
|
|
}
|
...
|
...
|
|