|
...
|
...
|
@@ -14,6 +14,7 @@ use App\Models\Visit\Visit; |
|
|
|
use App\Models\Workchat\MessagePush;
|
|
|
|
use App\Utils\LogUtils;
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
use Illuminate\Support\Facades\URL;
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
use function Symfony\Component\String\s;
|
|
...
|
...
|
@@ -79,7 +80,7 @@ class SyncSubmitTaskService |
|
|
|
}
|
|
|
|
|
|
|
|
$handler = new self();
|
|
|
|
return $handler->$action($data, $date);
|
|
|
|
return $handler->$action($data, $date, $task['id']);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
...
|
...
|
@@ -110,7 +111,7 @@ class SyncSubmitTaskService |
|
|
|
* @author zbj
|
|
|
|
* @date 2024/8/27
|
|
|
|
*/
|
|
|
|
public function subscribe($data, $date){
|
|
|
|
public function subscribe($data, $date, $task_id){
|
|
|
|
$email = $data['data']['email'];
|
|
|
|
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
|
|
|
$model = new Email();
|
|
...
|
...
|
@@ -129,7 +130,7 @@ class SyncSubmitTaskService |
|
|
|
* @author zbj
|
|
|
|
* @date 2023/12/4
|
|
|
|
*/
|
|
|
|
public function inquiry($data, $date)
|
|
|
|
public function inquiry($data, $date, $task_id)
|
|
|
|
{
|
|
|
|
//数组key转为小写
|
|
|
|
$data['data'] = array_change_key_case($data['data'], CASE_LOWER);
|
|
...
|
...
|
@@ -160,14 +161,17 @@ class SyncSubmitTaskService |
|
|
|
Visit::isInquiry($data['ip']);
|
|
|
|
|
|
|
|
//推送企微消息
|
|
|
|
Log::channel('inquiry')->info($task_id . '询盘结果', [$id]);
|
|
|
|
if($id){
|
|
|
|
try {
|
|
|
|
$name = empty($data['data']['name']) ? '' : ' ' . $data['data']['name'];
|
|
|
|
MessagePush::addInquiryMessage($id, $data['project_id'], $data['country'], $name, $data['submit_at']);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
Log::channel('inquiry')->info($task_id . '询盘失败', [$e->getMessage(), $e->getFile(), $e->getLine()]);
|
|
|
|
LogUtils::error('询盘消息'.$id.'写入企微消息队列失败' . $e->getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Log::channel('inquiry')->info($task_id . '询盘完成');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
...
|
...
|
@@ -180,7 +184,7 @@ class SyncSubmitTaskService |
|
|
|
* @author zbj
|
|
|
|
* @date 2023/12/4
|
|
|
|
*/
|
|
|
|
public function visit($data, $date)
|
|
|
|
public function visit($data, $date, $task_id)
|
|
|
|
{
|
|
|
|
|
|
|
|
$visit_data = $data['data'];
|
...
|
...
|
|