作者 刘锟

update

@@ -350,16 +350,28 @@ class GeoQuestionRes extends Command @@ -350,16 +350,28 @@ class GeoQuestionRes extends Command
350 $lock_key = 'geo_task_generation_lock'; 350 $lock_key = 'geo_task_generation_lock';
351 $lock_ttl = 60; // 锁时间大于当前 锁功能执行时间 351 $lock_ttl = 60; // 锁时间大于当前 锁功能执行时间
352 // 尝试获取锁,非阻塞方式 352 // 尝试获取锁,非阻塞方式
353 - $lock = Redis::set($lock_key, 1, 'EX', $lock_ttl, 'NX');  
354 - if (empty($lock)){ 353 +// $lock = Redis::set($lock_key, 1, 'EX', $lock_ttl, 'NX');
  354 + $lock = Redis::get($lock_key);
  355 + if ($lock)
355 return $task_id; 356 return $task_id;
356 - }  
357 - $project_ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))->pluck('project_id')->unique()->values()->toArray(); 357 + Redis::setex($lock_key, $lock_ttl, 1);
  358 +
  359 + $project_ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)
  360 + ->where(function ($query){
  361 + $query->where('next_time', '<=', date('Y-m-d'))
  362 + ->orWhereNull('current_time')
  363 + ->orWhereNull('next_time');
  364 + })
  365 + ->pluck('project_id')
  366 + ->unique()
  367 + ->values()
  368 + ->toArray();
358 if(FALSE == empty($project_ids)){ 369 if(FALSE == empty($project_ids)){
359 $ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN) 370 $ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)
360 ->whereIn('project_id', $project_ids) 371 ->whereIn('project_id', $project_ids)
361 ->where(function ($query){ 372 ->where(function ($query){
362 - $query->where('next_time', '<=', date('Y-m-d')) 373 + $query->where('current_time', '<>', date('Y-m-d'))
  374 + ->orWhereNull('current_time')
363 ->orWhereNull('next_time'); 375 ->orWhereNull('next_time');
364 }) 376 })
365 ->orderBy('next_time', 'asc') 377 ->orderBy('next_time', 'asc')
@@ -107,7 +107,7 @@ class GeoController extends BaseController @@ -107,7 +107,7 @@ class GeoController extends BaseController
107 'keyword' => '项目数据确认', 107 'keyword' => '项目数据确认',
108 'msg' => 108 'msg' =>
109 'cm:文章确认完成' . PHP_EOL . 109 'cm:文章确认完成' . PHP_EOL .
110 - '项目名称:'.$confInfo['company'] ?? '' . PHP_EOL . 110 + '项目名称:'.($confInfo['company'] ?? '') . PHP_EOL .
111 '负责人:'.$manage_name . PHP_EOL, 111 '负责人:'.$manage_name . PHP_EOL,
112 'isAtAll' => false, // 是否@所有人 112 'isAtAll' => false, // 是否@所有人
113 ], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9'); 113 ], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9');
@@ -176,7 +176,7 @@ class GeoController extends BaseController @@ -176,7 +176,7 @@ class GeoController extends BaseController
176 'keyword' => '项目数据确认', 176 'keyword' => '项目数据确认',
177 'msg' => 177 'msg' =>
178 'cm:'.(($info['type'] == 1) ? '标题确认' : '关键词确认'). PHP_EOL . 178 'cm:'.(($info['type'] == 1) ? '标题确认' : '关键词确认'). PHP_EOL .
179 - '项目名称:'.$confInfo['company'] ?? '' . PHP_EOL . 179 + '项目名称:'.($confInfo['company'] ?? '') . PHP_EOL .
180 '负责人:'.$manage_name . PHP_EOL, 180 '负责人:'.$manage_name . PHP_EOL,
181 'isAtAll' => false, // 是否@所有人 181 'isAtAll' => false, // 是否@所有人
182 ], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9'); 182 ], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9');
@@ -152,7 +152,11 @@ class ProjectController extends BaseController @@ -152,7 +152,11 @@ class ProjectController extends BaseController
152 if (isset($this->map['seo_plan']) && $this->map['seo_plan'] == 1) { 152 if (isset($this->map['seo_plan']) && $this->map['seo_plan'] == 1) {
153 $query = $query->orderBy('gl_project.cooperate_date', 'desc')->orderBy('gl_project.id', 'desc'); 153 $query = $query->orderBy('gl_project.cooperate_date', 'desc')->orderBy('gl_project.id', 'desc');
154 } else { 154 } else {
155 - $query = $query->orderBy('gl_project.uptime', 'desc')->orderBy('gl_project.id', 'desc'); 155 + if(isset($this->map['type']) && ($this->map['type'] == 1)){
  156 + $query = $query->orderBy('gl_project.id', 'desc');
  157 + }else{
  158 + $query = $query->orderBy('gl_project.uptime', 'desc')->orderBy('gl_project.id', 'desc');
  159 + }
156 } 160 }
157 return $query; 161 return $query;
158 } 162 }
@@ -285,6 +285,7 @@ class AsideTicketController extends BaseController @@ -285,6 +285,7 @@ class AsideTicketController extends BaseController
285 $ticket->plan_end_at = $request->input('plan_end_at', null); 285 $ticket->plan_end_at = $request->input('plan_end_at', null);
286 $ticket->close_wechat = $request->input('close_wechat', false); 286 $ticket->close_wechat = $request->input('close_wechat', false);
287 $ticket->num = $request->input('num', 0); 287 $ticket->num = $request->input('num', 0);
  288 + $ticket->is_user_look = $request->input('is_user_look',1);
288 $ticket->save(); 289 $ticket->save();
289 // 分配工单参与人 290 // 分配工单参与人
290 $ticket->saveEngineers($request->input('engineer_ids', [])); 291 $ticket->saveEngineers($request->input('engineer_ids', []));
@@ -398,4 +399,23 @@ class AsideTicketController extends BaseController @@ -398,4 +399,23 @@ class AsideTicketController extends BaseController
398 $this->response('请先点击开关,打开微信推送', Code::USER_MODEL_NOTFOUND_ERROE); 399 $this->response('请先点击开关,打开微信推送', Code::USER_MODEL_NOTFOUND_ERROE);
399 $this->response('success', Code::SUCCESS); 400 $this->response('success', Code::SUCCESS);
400 } 401 }
  402 +
  403 + /**
  404 + * @remark :获取工单类型
  405 + * @name :getorderTypeOptions
  406 + * @author :lyh
  407 + * @method :post
  408 + * @time :2025/11/24 15:38
  409 + */
  410 + public function getorderTypeOptions()
  411 + {
  412 + $this->request->validate([
  413 + 'project_cate'=>'required'
  414 + ],[
  415 + 'project_cate.required' => 'project_cate不能为空'
  416 + ]);
  417 + $ticket = new Tickets();
  418 + $data = $ticket->getOrderTypeOptions($this->param['project_cate']);
  419 + $this->response('success', Code::SUCCESS, $data);
  420 + }
401 } 421 }
@@ -104,34 +104,43 @@ class Extension3915ModuleController extends BaseController @@ -104,34 +104,43 @@ class Extension3915ModuleController extends BaseController
104 ],[ 104 ],[
105 'module_id.required' => '模块id不能为空', 105 'module_id.required' => '模块id不能为空',
106 ]); 106 ]);
  107 + if($this->user['project_id'] != 3915){
  108 + $this->fail('当前项目不能调用当前方法');
  109 + }
107 $moduleFieldModel = new ExtensionModuleField(); 110 $moduleFieldModel = new ExtensionModuleField();
108 - $filedList = $moduleFieldModel->where(['module_id' => $this->param['module_id']])->pluck('field_name', 'id')->toArray(); 111 + $filedList = $moduleFieldModel->where(['module_id' => $this->param['module_id']])->pluck( 'id','field_name')->toArray();
109 if(empty($filedList)){ 112 if(empty($filedList)){
110 - $this->response('请先设置字段,再添加数据',Code::SUCCESS); 113 + $this->fail('请先设置字段,再添加数据');
111 } 114 }
112 - $data = $this->param; 115 + $data = $this->param['data'];
113 $moduleValueModel = new ExtensionModuleValue(); 116 $moduleValueModel = new ExtensionModuleValue();
114 - //todo::优先截断表  
115 - $moduleValueModel->truncate();  
116 $key_filedId = []; 117 $key_filedId = [];
117 $resultData = []; 118 $resultData = [];
118 - foreach ($data as $k => $v){  
119 - foreach ($v as $k1 => $v1){  
120 - if($k == 0){  
121 - if(isset($filedList[$v1])){  
122 - $key_filedId[$k1] = $filedList[$v1]; 119 + try {
  120 + foreach ($data as $k => $v){
  121 + foreach ($v as $k1 => $v1){
  122 + if($k == 0){
  123 + if(isset($filedList[$v1])){
  124 + $key_filedId[$k1] = $filedList[$v1];
  125 + }
  126 + continue;
123 } 127 }
124 - continue; 128 + $resultData[] = [
  129 + 'uuid'=>$k + 1,
  130 + 'module_id'=>$this->param['module_id'],
  131 + 'field_id'=>$key_filedId[$k1],
  132 + 'value'=>$v1 ?? '',
  133 + ];
125 } 134 }
126 - $resultData[] = [  
127 - 'uuid'=>$k + 1,  
128 - 'modile_id'=>$this->param['module_id'],  
129 - 'field_id'=>$key_filedId[$k1],  
130 - 'value'=>$v1 ?? '',  
131 - ];  
132 } 135 }
  136 + if(!empty($resultData)){
  137 + //todo::优先截断表
  138 + $moduleValueModel->truncate();
  139 + $moduleValueModel->insertAll($resultData);
  140 + }
  141 + }catch (\Exception $e){
  142 + $this->fail('当前文件不能导入,请修改后再导入');
133 } 143 }
134 - $moduleValueModel->insertAll($resultData);  
135 $this->response('success',Code::SUCCESS,$resultData); 144 $this->response('success',Code::SUCCESS,$resultData);
136 } 145 }
137 } 146 }
@@ -765,10 +765,10 @@ class ImageController extends Controller @@ -765,10 +765,10 @@ class ImageController extends Controller
765 if($info === false){ 765 if($info === false){
766 $this->response('请先设置水印',Code::SYSTEM_ERROR); 766 $this->response('请先设置水印',Code::SYSTEM_ERROR);
767 } 767 }
768 - if($info['status'] == 1 && empty($info['image_data'])){ 768 + if($this->param['status'] == 1 && empty($info['image_data'])){
769 $this->response('请先设置水印',Code::SYSTEM_ERROR); 769 $this->response('请先设置水印',Code::SYSTEM_ERROR);
770 } 770 }
771 - if($info['status'] == 2 && empty($info['str_data'])){ 771 + if($this->param['status'] == 2 && empty($info['str_data'])){
772 $this->response('请先设置文字水印',Code::SYSTEM_ERROR); 772 $this->response('请先设置文字水印',Code::SYSTEM_ERROR);
773 } 773 }
774 $imageSetting->edit(['status'=>$this->param['status']],['project_id'=>$this->cache['project_id']]); 774 $imageSetting->edit(['status'=>$this->param['status']],['project_id'=>$this->cache['project_id']]);
@@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
9 9
10 namespace App\Http\Logic\Aside\Geo; 10 namespace App\Http\Logic\Aside\Geo;
11 11
12 -use App\Enums\Common\Code;  
13 use App\Http\Logic\Aside\BaseLogic; 12 use App\Http\Logic\Aside\BaseLogic;
14 use App\Models\Geo\GeoConf; 13 use App\Models\Geo\GeoConf;
15 use App\Models\Geo\GeoConfirm; 14 use App\Models\Geo\GeoConfirm;
@@ -43,7 +42,7 @@ class GeoConfirmLogic extends BaseLogic @@ -43,7 +42,7 @@ class GeoConfirmLogic extends BaseLogic
43 public function saveConfirmContent($param) 42 public function saveConfirmContent($param)
44 { 43 {
45 try { 44 try {
46 - $wechat = $param['wechat'] ?? true; 45 + $wechat = $param['wechat'] ?? 1;
47 unset($param['wechat']); 46 unset($param['wechat']);
48 $info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]); 47 $info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]);
49 if($info === false){ 48 if($info === false){
@@ -104,7 +103,7 @@ class GeoConfirmLogic extends BaseLogic @@ -104,7 +103,7 @@ class GeoConfirmLogic extends BaseLogic
104 'keyword' => '项目数据确认', 103 'keyword' => '项目数据确认',
105 'msg' => 104 'msg' =>
106 'cm:'.(($info['type'] == 1) ? '标题确认' : '关键词确认'). PHP_EOL . 105 'cm:'.(($info['type'] == 1) ? '标题确认' : '关键词确认'). PHP_EOL .
107 - '项目名称:'.$confInfo['company'] ?? '' . PHP_EOL . 106 + '项目名称:'.($confInfo['company'] ?? '') . PHP_EOL .
108 '负责人:'.$manage_name . PHP_EOL, 107 '负责人:'.$manage_name . PHP_EOL,
109 'isAtAll' => false, // 是否@所有人 108 'isAtAll' => false, // 是否@所有人
110 ], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9'); 109 ], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9');
@@ -84,41 +84,44 @@ class GeoQuestionLogic extends BaseLogic @@ -84,41 +84,44 @@ class GeoQuestionLogic extends BaseLogic
84 */ 84 */
85 public function saveGeoQuestion(){ 85 public function saveGeoQuestion(){
86 //处理数据 86 //处理数据
  87 + $max_num = 200;//最大数量
87 $count = count($this->param['question']); 88 $count = count($this->param['question']);
  89 + if(isset($this->param['id']) && !empty($this->param['id'])){
  90 + //编辑
  91 + $sum = $this->model->where('project_id',$this->param['project_id'])->where('id','!=',$this->param['id'])->sum('question_num') ?? 0;
  92 + }else{
  93 + //新增
  94 + $sum = $this->model->where('project_id',$this->param['project_id'])->sum('question_num') ?? 0;
  95 + }
  96 + if(($count + $sum) > $max_num){
  97 + $this->fail('当前问题数量大于最大数量200个问题,不允许保存');
  98 + }
88 $question = $this->param['question']; 99 $question = $this->param['question'];
89 $this->param['url'] = json_encode($this->param['url'] ?? [],true); 100 $this->param['url'] = json_encode($this->param['url'] ?? [],true);
90 $this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true); 101 $this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true);
91 - if($count <= 20){  
92 - if(isset($this->param['id']) && !empty($this->param['id'])){  
93 - $id = $this->param['id'];  
94 - $this->model->edit($this->param,['id'=>$id]);  
95 - }else{  
96 - $this->param['next_time'] = date('Y-m-d');  
97 - $id = $this->model->addReturnId($this->param);  
98 - }  
99 - return $this->success(['id'=>$id]);  
100 - }else{  
101 - $chunks = array_chunk($question, 20);  
102 - if(isset($this->param['id']) && !empty($this->param['id'])){  
103 - foreach ($chunks as $index => $chunk) {  
104 - $this->param['question'] = json_encode($chunk ?? [],true);  
105 - if($index == 0){  
106 - $id = $this->param['id'];  
107 - $this->model->edit($this->param,['id'=>$id]);  
108 - }else{  
109 - unset($this->param['id']);  
110 - $id = $this->model->addReturnId($this->param);  
111 - }  
112 - }  
113 - }else{  
114 - $this->param['next_time'] = date('Y-m-d');  
115 - foreach ($chunks as $chunk) {  
116 - $this->param['question'] = json_encode($chunk ?? [],true); 102 + $chunks = array_chunk($question, 20);
  103 + if(isset($this->param['id']) && !empty($this->param['id'])){
  104 + foreach ($chunks as $index => $chunk) {
  105 + $this->param['question_num'] = count($chunk);
  106 + $this->param['question'] = json_encode($chunk ?? [],true);
  107 + if($index == 0){
  108 + $id = $this->param['id'];
  109 + $this->model->edit($this->param,['id'=>$id]);
  110 + }else{
  111 + unset($this->param['id']);
117 $id = $this->model->addReturnId($this->param); 112 $id = $this->model->addReturnId($this->param);
118 } 113 }
119 } 114 }
120 - return $this->success(['id'=>$id]); 115 + }else{
  116 + $this->param['next_time'] = date('Y-m-d');
  117 + foreach ($chunks as $chunk) {
  118 + $this->param['question_num'] = count($chunk);
  119 + $this->param['question'] = json_encode($chunk ?? [],true);
  120 + $id = $this->model->addReturnId($this->param);
  121 + }
121 } 122 }
  123 + return $this->success(['id'=>$id]);
  124 +
122 } 125 }
123 126
124 /** 127 /**
@@ -65,9 +65,11 @@ class GeoWritingsLogic extends BaseLogic @@ -65,9 +65,11 @@ class GeoWritingsLogic extends BaseLogic
65 $this->param['status'] = GeoWritings::STATUS_INIT; 65 $this->param['status'] = GeoWritings::STATUS_INIT;
66 if(isset($this->param['id']) &&!empty($this->param['id'])){ 66 if(isset($this->param['id']) &&!empty($this->param['id'])){
67 $id = $this->param['id']; 67 $id = $this->param['id'];
  68 + $this->param['content_length'] = strlen($this->param['content'] ?? '');
68 $this->model->edit($this->param,['id'=>$id]); 69 $this->model->edit($this->param,['id'=>$id]);
69 }else{ 70 }else{
70 $this->param['type'] = GeoWritings::TYPE_SUBMIT; 71 $this->param['type'] = GeoWritings::TYPE_SUBMIT;
  72 + $this->param['content_length'] = strlen($this->param['content'] ?? '');
71 $this->param['uniqid'] = uniqid().$this->param['project_id']; 73 $this->param['uniqid'] = uniqid().$this->param['project_id'];
72 $id = $this->model->addReturnId($this->param); 74 $id = $this->model->addReturnId($this->param);
73 } 75 }
@@ -102,7 +104,7 @@ class GeoWritingsLogic extends BaseLogic @@ -102,7 +104,7 @@ class GeoWritingsLogic extends BaseLogic
102 */ 104 */
103 public function sendWechatMessage() 105 public function sendWechatMessage()
104 { 106 {
105 - $wechat = $this->param['wechat'] ?? true; 107 + $wechat = $this->param['wechat'] ?? 1;
106 $this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]); 108 $this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]);
107 $data = GeoWritings::sendConfirmMessage($this->param['project_id'],$wechat); 109 $data = GeoWritings::sendConfirmMessage($this->param['project_id'],$wechat);
108 if($data === false){ 110 if($data === false){
@@ -47,7 +47,7 @@ class GeoWritingsTaskRequest extends FormRequest @@ -47,7 +47,7 @@ class GeoWritingsTaskRequest extends FormRequest
47 'title.required' => 'GEO文标题不能为空', 47 'title.required' => 'GEO文标题不能为空',
48 'title.max' => 'GEO文标题最多120个字符', 48 'title.max' => 'GEO文标题最多120个字符',
49 'command_introduction.required' => '生成引言内容命令不能为空', 49 'command_introduction.required' => '生成引言内容命令不能为空',
50 - 'command_main.required' => '生成正文内容命令不能为空', 50 + 'command_main.required' => '生成正文内容命令不能为空'
51 ]; 51 ];
52 } 52 }
53 } 53 }
@@ -106,7 +106,7 @@ class GeoConfirm extends Base @@ -106,7 +106,7 @@ class GeoConfirm extends Base
106 * @param $id 106 * @param $id
107 * @return bool 107 * @return bool
108 */ 108 */
109 - public static function sendConfirmMessage($id, $friend_id,$send = true) 109 + public static function sendConfirmMessage($id, $friend_id,$send = 1)
110 { 110 {
111 $data = self::where(compact('id'))->first(); 111 $data = self::where(compact('id'))->first();
112 $project_id = $data->project_id; 112 $project_id = $data->project_id;
@@ -127,7 +127,7 @@ class GeoConfirm extends Base @@ -127,7 +127,7 @@ class GeoConfirm extends Base
127 'url' => 'https://oa.quanqiusou.cn/public-geo-confirm?token=' . $token 127 'url' => 'https://oa.quanqiusou.cn/public-geo-confirm?token=' . $token
128 ]; 128 ];
129 $content = json_encode($content_array, JSON_UNESCAPED_UNICODE); 129 $content = json_encode($content_array, JSON_UNESCAPED_UNICODE);
130 - if($send == true){ 130 + if($send){
131 $data->send_at = now(); 131 $data->send_at = now();
132 $data->status = self::STATUS_RUNNING; 132 $data->status = self::STATUS_RUNNING;
133 MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at')); 133 MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));
@@ -77,7 +77,7 @@ class GeoWritings extends Base @@ -77,7 +77,7 @@ class GeoWritings extends Base
77 * @return bool 77 * @return bool
78 * @throws \Exception 78 * @throws \Exception
79 */ 79 */
80 - public static function sendConfirmMessage($project_id,$wechat = true) 80 + public static function sendConfirmMessage($project_id,$wechat = 1)
81 { 81 {
82 $friend = ProjectAssociation::where(['project_id' => $project_id])->first(); 82 $friend = ProjectAssociation::where(['project_id' => $project_id])->first();
83 if (empty($friend)) { 83 if (empty($friend)) {
@@ -146,4 +146,29 @@ class Tickets extends Base @@ -146,4 +146,29 @@ class Tickets extends Base
146 } 146 }
147 } 147 }
148 148
  149 + /**
  150 + * @remark :
  151 + * @name :getorderTypeOptions
  152 + * @author :lyh
  153 + * @method :post
  154 + * @time :2025/11/24 14:43
  155 + */
  156 + public function getorderTypeOptions($project_cate = 1)
  157 + {
  158 + $data = [
  159 + '1' => ['资料上传', '美工设计', '网站修改', '优化问题', '优化报告', '网站同步', '页面翻译', '其他问题','关键词相关','上线审核','研发工单(客户不可见)'],
  160 + '2' => ['资料上传', '美工设计', '网站修改', '优化问题', '优化报告', '网站同步', '页面翻译', '其他问题','关键词相关','上线审核','GEO项目','研发工单(客户不可见)'],
  161 + '3' => ['功能问题', '操作问题', '数据问题', '功能需求', '培训需求', '其他问题','研发工单(客户不可见)'],
  162 + '4' => ['账号问题', '报告分析', '效果问题', '发帖问题', '视频问题', '美工设计', '其他问题','研发工单(客户不可见)']
  163 + ];
  164 + $dataSon = [
  165 + '研发工单(客户不可见)'=>[
  166 + '1'=>[],
  167 + '2'=>[],
  168 + '3'=>[],
  169 + '4'=>[],
  170 + ]
  171 + ];
  172 + return ['type'=>$data[$project_cate], 'data'=>$dataSon['研发工单(客户不可见)'][$project_cate]];
  173 + }
149 } 174 }
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace App\Models\Workchat; 3 namespace App\Models\Workchat;
4 4
5 use App\Models\Base; 5 use App\Models\Base;
  6 +use App\Models\Domain\DomainInfo;
6 use App\Models\Inquiry\InquiryFormData; 7 use App\Models\Inquiry\InquiryFormData;
7 use App\Models\Project\Project; 8 use App\Models\Project\Project;
8 use App\Models\ProjectAssociation\ProjectAssociation; 9 use App\Models\ProjectAssociation\ProjectAssociation;
@@ -64,6 +65,9 @@ class MessagePush extends Base @@ -64,6 +65,9 @@ class MessagePush extends Base
64 return false; 65 return false;
65 } 66 }
66 67
  68 + $domain = DomainInfo::where(['project_id' => $project_id, 'status' => DomainInfo::STATUS_ONE])->value('domain');
  69 + $domain_message = $domain ?: '';
  70 +
67 //特殊处理, 要求任何时候收到询盘都要及时推送到群里面 71 //特殊处理, 要求任何时候收到询盘都要及时推送到群里面
68 $special_project_ids = [650, 2045, 916, 3587, 568]; 72 $special_project_ids = [650, 2045, 916, 3587, 568];
69 //9-21 点,每条消息及时通知 73 //9-21 点,每条消息及时通知
@@ -75,7 +79,7 @@ class MessagePush extends Base @@ -75,7 +79,7 @@ class MessagePush extends Base
75 $model->friend_id = $friend_id; 79 $model->friend_id = $friend_id;
76 $model->type = self::TYPE_INQUIRY; 80 $model->type = self::TYPE_INQUIRY;
77 $model->ref_ids = $id; 81 $model->ref_ids = $id;
78 - $model->content = '[' . date('H:i', strtotime($submit_at)) . '] 您的全球搜网站收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!'; 82 + $model->content = '[' . date('H:i', strtotime($submit_at)) . '] 您的全球搜网站' . $domain_message . '收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
79 $model->send_time = $submit_at; 83 $model->send_time = $submit_at;
80 }else{ 84 }else{
81 //定时发送时间 85 //定时发送时间
@@ -89,7 +93,7 @@ class MessagePush extends Base @@ -89,7 +93,7 @@ class MessagePush extends Base
89 $model->ref_ids = $id; 93 $model->ref_ids = $id;
90 $model->countries = $country; 94 $model->countries = $country;
91 $model->send_time = $send_time; 95 $model->send_time = $send_time;
92 - $model->content = '[08:00] 您的全球搜网站收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!'; 96 + $model->content = '[08:00] 您的全球搜网站' . $domain_message . '收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
93 }else{ 97 }else{
94 $ref_ids = explode(',', $model->ref_ids); 98 $ref_ids = explode(',', $model->ref_ids);
95 $ref_ids[] = $id; 99 $ref_ids[] = $id;
@@ -108,7 +112,7 @@ class MessagePush extends Base @@ -108,7 +112,7 @@ class MessagePush extends Base
108 $country = implode(',', $countries); 112 $country = implode(',', $countries);
109 } 113 }
110 } 114 }
111 - $model->content = '[08:00] 您的全球搜网站收到来自【' . $country . '】'.$count.'条询盘信息,请登录后台或APP进行查看!'; 115 + $model->content = '[08:00] 您的全球搜网站' . $domain_message . '收到来自【' . $country . '】'.$count.'条询盘信息,请登录后台或APP进行查看!';
112 } 116 }
113 } 117 }
114 $model->save(); 118 $model->save();
@@ -31,7 +31,7 @@ class DingService @@ -31,7 +31,7 @@ class DingService
31 public function handle(array $body, $link = '') 31 public function handle(array $body, $link = '')
32 { 32 {
33 $link = $link ?: self::LINK; 33 $link = $link ?: self::LINK;
34 - $msgKey = mb_substr($body['msg'], 50); 34 + $msgKey = mb_substr($body['msg'], 100);
35 if (!$this->getData(RedisKey::DING_MSG . $msgKey)) { 35 if (!$this->getData(RedisKey::DING_MSG . $msgKey)) {
36 $arr = [ 36 $arr = [
37 'msgtype' => 'text', 37 'msgtype' => 'text',
@@ -325,6 +325,10 @@ class SyncSubmitTaskService @@ -325,6 +325,10 @@ class SyncSubmitTaskService
325 if($data['country'] == '新加坡' && $data['data']['referrer_url'] == 'https://www.google.com/' && $data['domain'] == 'www.dowellelectronic.com'){ 325 if($data['country'] == '新加坡' && $data['data']['referrer_url'] == 'https://www.google.com/' && $data['domain'] == 'www.dowellelectronic.com'){
326 throw new InquiryFilterException( '特殊过滤'); 326 throw new InquiryFilterException( '特殊过滤');
327 } 327 }
  328 + //来源是空的并且国家是德国 关杰 25/11/24
  329 + if($data['country'] == '德国' && empty($data['data']['referrer_url'])){
  330 + throw new InquiryFilterException( '特殊过滤');
  331 + }
328 332
329 $visit_data = $data['data']; 333 $visit_data = $data['data'];
330 $referrer_url = ''; 334 $referrer_url = '';
@@ -508,7 +512,7 @@ class SyncSubmitTaskService @@ -508,7 +512,7 @@ class SyncSubmitTaskService
508 } 512 }
509 513
510 //新加坡 并且 没有来源信息的访问信息屏蔽了 海龙 25/10/21 514 //新加坡 并且 没有来源信息的访问信息屏蔽了 海龙 25/10/21
511 - if($data['country'] == '新加坡' && empty($data['referer'])){ 515 + if(in_array($data['country'], ['新加坡']) && empty($data['referer'])){
512 throw new InquiryFilterException( '全局过滤4'); 516 throw new InquiryFilterException( '全局过滤4');
513 } 517 }
514 518
@@ -267,6 +267,8 @@ Route::middleware(['aloginauth'])->group(function () { @@ -267,6 +267,8 @@ Route::middleware(['aloginauth'])->group(function () {
267 Route::get('/projects_team/{id}', [Aside\WorkOrder\TicketProjectController::class, 'team'])->name('admin.tickets.projects_team')->summary('A端工单项目团队'); 267 Route::get('/projects_team/{id}', [Aside\WorkOrder\TicketProjectController::class, 'team'])->name('admin.tickets.projects_team')->summary('A端工单项目团队');
268 Route::get('/v56_projects/list', [Aside\WorkOrder\AsideTicketController::class, 'projectList'])->name('admin.tickets.projectList')->summary('A端V5V6项目列表') 268 Route::get('/v56_projects/list', [Aside\WorkOrder\AsideTicketController::class, 'projectList'])->name('admin.tickets.projectList')->summary('A端V5V6项目列表')
269 ->description("project_cate[项目分类1]: 1 V5, 2 V6, 3 超迹, 4 域途"); 269 ->description("project_cate[项目分类1]: 1 V5, 2 V6, 3 超迹, 4 域途");
  270 + Route::get('/v56_projects/getorderTypeOptions', [Aside\WorkOrder\AsideTicketController::class, 'getorderTypeOptions'])->name('admin.tickets.getorderTypeOptions')->summary('A端V5V6项目列表')
  271 + ->description("工单类型");
270 Route::post('/log/{id}', [Aside\WorkOrder\AsideTicketLogController::class, 'update'])->name('admin.tickets.log.update')->summary('A端工单操作日志更新,完成工单'); 272 Route::post('/log/{id}', [Aside\WorkOrder\AsideTicketLogController::class, 'update'])->name('admin.tickets.log.update')->summary('A端工单操作日志更新,完成工单');
271 Route::get('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'index'])->name('admin.tickets.chat.index')->summary('A端工单聊天记录'); 273 Route::get('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'index'])->name('admin.tickets.chat.index')->summary('A端工单聊天记录');
272 Route::post('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'store'])->name('admin.tickets.chat.store')->summary('A端工单聊天记录创建'); 274 Route::post('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'store'])->name('admin.tickets.chat.store')->summary('A端工单聊天记录创建');
@@ -656,6 +656,9 @@ Route::middleware(['bloginauth'])->group(function () { @@ -656,6 +656,9 @@ Route::middleware(['bloginauth'])->group(function () {
656 //2205项目单独处理 656 //2205项目单独处理
657 Route::any('2205/get2205List', [\App\Http\Controllers\Bside\ExtensionModule\Extension2205ModuleController::class, 'get2205List'])->name('extension_module_get2205List'); 657 Route::any('2205/get2205List', [\App\Http\Controllers\Bside\ExtensionModule\Extension2205ModuleController::class, 'get2205List'])->name('extension_module_get2205List');
658 Route::any('2205/save2205Status', [\App\Http\Controllers\Bside\ExtensionModule\Extension2205ModuleController::class, 'save2205Status'])->name('extension_module_save2205Status'); 658 Route::any('2205/save2205Status', [\App\Http\Controllers\Bside\ExtensionModule\Extension2205ModuleController::class, 'save2205Status'])->name('extension_module_save2205Status');
  659 + //3915项目处理
  660 + Route::any('3915/lists', [\App\Http\Controllers\Bside\ExtensionModule\Extension3915ModuleController::class, 'lists'])->name('extension_module_3915_lists');
  661 + Route::any('3915/importData', [\App\Http\Controllers\Bside\ExtensionModule\Extension3915ModuleController::class, 'importData'])->name('extension_module_3915_importData');
659 }); 662 });
660 663
661 //自定义小语种文本信息 664 //自定义小语种文本信息