作者 zhl

修改转发询盘文案

... ... @@ -14,11 +14,8 @@ use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Mail;
/**
*
* Class WorkchatMessageSend
* @package App\Console\Commands
* @author zbj
* @date 2023/11/28
* @package App\Console\Commands\Task
*/
class WorkchatMessageSend extends Command
{
... ...
... ... @@ -33,7 +33,15 @@ class MessagePush extends Base
protected $table = 'gl_workchat_message_push';
public static function addInquiryMessage($id, $project_id, $country, $submit_at){
/**
* @param $id
* @param $project_id
* @param $country
* @param $name
* @param $submit_at
* @return bool
*/
public static function addInquiryMessage($id, $project_id, $country, $name, $submit_at){
if(!ProjectServer::useProject($project_id)){
return false;
}
... ... @@ -56,7 +64,7 @@ class MessagePush extends Base
$model->friend_id = $friend_id;
$model->type = self::TYPE_INQUIRY;
$model->ref_ids = $id;
$model->content = '[' . date('H:i', strtotime($submit_at)) . '] 您的全球搜网站收到来自【' . $country . '】的询盘信息,请登录后台或APP进行查看!';
$model->content = '[' . date('H:i', strtotime($submit_at)) . '] 您的全球搜网站收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
}else{
//定时发送时间
$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
$model->type = self::TYPE_INQUIRY;
$model->ref_ids = $id;
$model->send_time = $send_time;
$model->content = '[09:00] 您的全球搜网站收到来自【' . $country . '】的询盘信息,请登录后台或APP进行查看!';
$model->content = '[09:00] 您的全球搜网站收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
}else{
$ref_ids = explode(',', $model->ref_ids);
$ref_ids[] = $id;
... ...
... ... @@ -160,7 +160,8 @@ class SyncSubmitTaskService
//推送企微消息
try {
MessagePush::addInquiryMessage($id, $data['project_id'], $data['country'], $data['submit_at']);
$name = empty($data['data']['name']) ? '' : ' ' . $data['data']['name'];
MessagePush::addInquiryMessage($id, $data['project_id'], $data['country'], $name, $data['submit_at']);
}catch (\Exception $e){
LogUtils::error('询盘消息'.$id.'写入企微消息队列失败' . $e->getMessage());
}
... ...