作者 zhl

修改转发询盘文案

@@ -14,11 +14,8 @@ use Illuminate\Support\Facades\Config; @@ -14,11 +14,8 @@ use Illuminate\Support\Facades\Config;
14 use Illuminate\Support\Facades\Mail; 14 use Illuminate\Support\Facades\Mail;
15 15
16 /** 16 /**
17 - *  
18 * Class WorkchatMessageSend 17 * Class WorkchatMessageSend
19 - * @package App\Console\Commands  
20 - * @author zbj  
21 - * @date 2023/11/28 18 + * @package App\Console\Commands\Task
22 */ 19 */
23 class WorkchatMessageSend extends Command 20 class WorkchatMessageSend extends Command
24 { 21 {
@@ -33,7 +33,15 @@ class MessagePush extends Base @@ -33,7 +33,15 @@ class MessagePush extends Base
33 protected $table = 'gl_workchat_message_push'; 33 protected $table = 'gl_workchat_message_push';
34 34
35 35
36 - public static function addInquiryMessage($id, $project_id, $country, $submit_at){ 36 + /**
  37 + * @param $id
  38 + * @param $project_id
  39 + * @param $country
  40 + * @param $name
  41 + * @param $submit_at
  42 + * @return bool
  43 + */
  44 + public static function addInquiryMessage($id, $project_id, $country, $name, $submit_at){
37 if(!ProjectServer::useProject($project_id)){ 45 if(!ProjectServer::useProject($project_id)){
38 return false; 46 return false;
39 } 47 }
@@ -56,7 +64,7 @@ class MessagePush extends Base @@ -56,7 +64,7 @@ class MessagePush extends Base
56 $model->friend_id = $friend_id; 64 $model->friend_id = $friend_id;
57 $model->type = self::TYPE_INQUIRY; 65 $model->type = self::TYPE_INQUIRY;
58 $model->ref_ids = $id; 66 $model->ref_ids = $id;
59 - $model->content = '[' . date('H:i', strtotime($submit_at)) . '] 您的全球搜网站收到来自【' . $country . '】的询盘信息,请登录后台或APP进行查看!'; 67 + $model->content = '[' . date('H:i', strtotime($submit_at)) . '] 您的全球搜网站收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
60 }else{ 68 }else{
61 //定时发送时间 69 //定时发送时间
62 $send_time = $hour >= 9 ? date('Y-m-d 09:00:00', strtotime('+1 day')) : date('Y-m-d 09:00:00'); 70 $send_time = $hour >= 9 ? date('Y-m-d 09:00:00', strtotime('+1 day')) : date('Y-m-d 09:00:00');
@@ -69,7 +77,7 @@ class MessagePush extends Base @@ -69,7 +77,7 @@ class MessagePush extends Base
69 $model->type = self::TYPE_INQUIRY; 77 $model->type = self::TYPE_INQUIRY;
70 $model->ref_ids = $id; 78 $model->ref_ids = $id;
71 $model->send_time = $send_time; 79 $model->send_time = $send_time;
72 - $model->content = '[09:00] 您的全球搜网站收到来自【' . $country . '】的询盘信息,请登录后台或APP进行查看!'; 80 + $model->content = '[09:00] 您的全球搜网站收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
73 }else{ 81 }else{
74 $ref_ids = explode(',', $model->ref_ids); 82 $ref_ids = explode(',', $model->ref_ids);
75 $ref_ids[] = $id; 83 $ref_ids[] = $id;
@@ -160,7 +160,8 @@ class SyncSubmitTaskService @@ -160,7 +160,8 @@ class SyncSubmitTaskService
160 160
161 //推送企微消息 161 //推送企微消息
162 try { 162 try {
163 - MessagePush::addInquiryMessage($id, $data['project_id'], $data['country'], $data['submit_at']); 163 + $name = empty($data['data']['name']) ? '' : ' ' . $data['data']['name'];
  164 + MessagePush::addInquiryMessage($id, $data['project_id'], $data['country'], $name, $data['submit_at']);
164 }catch (\Exception $e){ 165 }catch (\Exception $e){
165 LogUtils::error('询盘消息'.$id.'写入企微消息队列失败' . $e->getMessage()); 166 LogUtils::error('询盘消息'.$id.'写入企微消息队列失败' . $e->getMessage());
166 } 167 }