作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -121,6 +121,7 @@ class RemainDay extends Command @@ -121,6 +121,7 @@ class RemainDay extends Command
121 if($deploy_build['seo_plan'] == 1){ 121 if($deploy_build['seo_plan'] == 1){
122 if($deploy_build['seo_service_duration'] != 0){ 122 if($deploy_build['seo_service_duration'] != 0){
123 if(in_array($item['id'],$this->bm_projectId)){ 123 if(in_array($item['id'],$this->bm_projectId)){
  124 + $compliance_day = (int)$item['bm_finish_remain_day'];
124 $seo_remain_day = $deploy_build['seo_service_duration'] - (int)$item['bm_finish_remain_day']; 125 $seo_remain_day = $deploy_build['seo_service_duration'] - (int)$item['bm_finish_remain_day'];
125 }else{ 126 }else{
126 //按自然日统计 127 //按自然日统计
@@ -133,7 +134,7 @@ class RemainDay extends Command @@ -133,7 +134,7 @@ class RemainDay extends Command
133 $this->project->edit(['seo_remain_day'=>$seo_remain_day,'bm_finish_remain_day'=>$compliance_day ?? 0],['id'=>$item['id']]); 134 $this->project->edit(['seo_remain_day'=>$seo_remain_day,'bm_finish_remain_day'=>$compliance_day ?? 0],['id'=>$item['id']]);
134 }else{ 135 }else{
135 //同时包括白帽版本+默认版本的项目 136 //同时包括白帽版本+默认版本的项目
136 - $this->project->edit(['seo_remain_day'=>$seo_remain_day],['id'=>$item['id']]); 137 + $this->project->edit(['seo_remain_day'=>$seo_remain_day,'bm_finish_remain_day'=>$compliance_day ?? 0],['id'=>$item['id']]);
137 } 138 }
138 } 139 }
139 } 140 }
@@ -88,7 +88,27 @@ class ClearSeoTdk extends Command @@ -88,7 +88,27 @@ class ClearSeoTdk extends Command
88 'seo_description' => '', 88 'seo_description' => '',
89 'keyword_title' => '', 89 'keyword_title' => '',
90 'keyword_content' => '', 90 'keyword_content' => '',
91 - ] 91 + ],
  92 + 'gl_ai_blog' => [
  93 + 'seo_title' => '',
  94 + 'seo_keyword' => '',
  95 + 'seo_description' => '',
  96 + ],
  97 + 'gl_ai_blog_author' => [
  98 + 'seo_title' => '',
  99 + 'seo_keyword' => '',
  100 + 'seo_description' => '',
  101 + ],
  102 + 'gl_custom_module_category' => [
  103 + 'seo_title' => '',
  104 + 'seo_keywords' => '',
  105 + 'seo_description' => '',
  106 + ],
  107 + 'gl_custom_module_content' => [
  108 + 'seo_title' => '',
  109 + 'seo_keywords' => '',
  110 + 'seo_description' => '',
  111 + ],
92 ]; 112 ];
93 113
94 /** 114 /**
@@ -78,8 +78,7 @@ class AsideTicketController extends BaseController @@ -78,8 +78,7 @@ class AsideTicketController extends BaseController
78 */ 78 */
79 public function getProjects($search) 79 public function getProjects($search)
80 { 80 {
81 - $projects = TicketProject::where('is_del', 0)  
82 - ->where(function ($query) use ($search) { 81 + $projects = TicketProject::where(function ($query) use ($search) {
83 // 查找项目名称或公司名称 82 // 查找项目名称或公司名称
84 $query->where('title', 'like', '%' . $search . '%') 83 $query->where('title', 'like', '%' . $search . '%')
85 ->orWhere('company_name', 'like', '%' . $search . '%'); 84 ->orWhere('company_name', 'like', '%' . $search . '%');
@@ -99,8 +98,7 @@ class AsideTicketController extends BaseController @@ -99,8 +98,7 @@ class AsideTicketController extends BaseController
99 $dept_id = ManageHr::where('manage_id', $this->manage['id']) 98 $dept_id = ManageHr::where('manage_id', $this->manage['id'])
100 ->value('dept_id'); 99 ->value('dept_id');
101 100
102 - $lists = TicketProject::where('is_del', 0)  
103 - ->when(($this->manage['role'] != 1 && $dept_id != 5), function ($query) use ($dept_id) { 101 + $lists = TicketProject::when(($this->manage['role'] != 1 && $dept_id != 5), function ($query) use ($dept_id) {
104 /** 102 /**
105 * 超管看所有项目 $this->manage['role']=1 103 * 超管看所有项目 $this->manage['role']=1
106 * 全球搜: 技术部ID 1、售后部ID 2 104 * 全球搜: 技术部ID 1、售后部ID 2
@@ -171,12 +169,13 @@ class AsideTicketController extends BaseController @@ -171,12 +169,13 @@ class AsideTicketController extends BaseController
171 $ticket->submit_username = $this->manage['name']; 169 $ticket->submit_username = $this->manage['name'];
172 $ticket->star = $request->input('star', 3); 170 $ticket->star = $request->input('star', 3);
173 $ticket->plan_end_at = $request->input('plan_end_at', null); 171 $ticket->plan_end_at = $request->input('plan_end_at', null);
  172 + $ticket->close_wechat = $request->input('close_wechat', false);
174 $ticket->save(); 173 $ticket->save();
175 174
176 // 分配工单参与人 175 // 分配工单参与人
177 $ticket->saveEngineers($request->input('engineer_ids', [])); 176 $ticket->saveEngineers($request->input('engineer_ids', []));
178 $nickname = ManageHr::where('manage_id', $this->manage['id'])->value('nickname') ?? mb_substr($ticket->submit_username, 0, 1) . '**'; 177 $nickname = ManageHr::where('manage_id', $this->manage['id'])->value('nickname') ?? mb_substr($ticket->submit_username, 0, 1) . '**';
179 - if ($project->wechat_switch) 178 + if ($project->wechat_switch && !$ticket->close_wechat)
180 $project->pushWechatGroupMsg("创贸({$nickname})新增了工单(ID:{$ticket->id}),请及时处理!"); 179 $project->pushWechatGroupMsg("创贸({$nickname})新增了工单(ID:{$ticket->id}),请及时处理!");
181 return $ticket; 180 return $ticket;
182 }); 181 });
@@ -237,7 +236,7 @@ class AsideTicketController extends BaseController @@ -237,7 +236,7 @@ class AsideTicketController extends BaseController
237 ->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now()]); 236 ->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now()]);
238 // 推动微信通知 237 // 推动微信通知
239 $project = $ticket->project; 238 $project = $ticket->project;
240 - if ($project->wechat_switch) 239 + if ($project->wechat_switch && !$ticket->close_wechat)
241 $project->pushWechatGroupMsg("工单(ID:{$ticket->id})已全部完成,请访问查看详情!"); 240 $project->pushWechatGroupMsg("工单(ID:{$ticket->id})已全部完成,请访问查看详情!");
242 $ticket->pushDing('finish'); 241 $ticket->pushDing('finish');
243 242
@@ -92,7 +92,7 @@ class AsideTicketLogController extends BaseController @@ -92,7 +92,7 @@ class AsideTicketLogController extends BaseController
92 $ticket->status = Tickets::STATUS_COMPLETED; 92 $ticket->status = Tickets::STATUS_COMPLETED;
93 $ticket->end_at = now(); 93 $ticket->end_at = now();
94 $project = $ticket->project; 94 $project = $ticket->project;
95 - if ($project->wechat_switch) 95 + if ($project->wechat_switch && !$ticket->close_wechat)
96 $project->pushWechatGroupMsg("工单(ID:{$ticket->id})已全部完成,请访问查看详情!"); 96 $project->pushWechatGroupMsg("工单(ID:{$ticket->id})已全部完成,请访问查看详情!");
97 $ticket->pushDing('finish'); 97 $ticket->pushDing('finish');
98 } 98 }
@@ -66,7 +66,8 @@ class TicketChatController extends BaseController @@ -66,7 +66,8 @@ class TicketChatController extends BaseController
66 $chat->save(); 66 $chat->save();
67 $project = $ticket->project; 67 $project = $ticket->project;
68 $nickname = ManageHr::where('manage_id', $this->manage['id'])->value('nickname') ?? mb_substr($ticket->submit_username, 0, 1) . '**'; 68 $nickname = ManageHr::where('manage_id', $this->manage['id'])->value('nickname') ?? mb_substr($ticket->submit_username, 0, 1) . '**';
69 - $project->pushWechatGroupMsg("创贸({$nickname})对工单(ID:{$ticket->id})进行了补充,请及时查看处理!"); 69 + if ($project->wechat_switch && !$ticket->close_wechat)
  70 + $project->pushWechatGroupMsg("创贸({$nickname})对工单(ID:{$ticket->id})进行了补充,请及时查看处理!");
70 $this->response('success', Code::SUCCESS, $chat); 71 $this->response('success', Code::SUCCESS, $chat);
71 } 72 }
72 73
@@ -50,7 +50,7 @@ class GeoQuestionResLogic extends BaseLogic @@ -50,7 +50,7 @@ class GeoQuestionResLogic extends BaseLogic
50 $filed = ['id','project_id','question_id','platform','question','en_question','keywords','url','created_at','updated_at']; 50 $filed = ['id','project_id','question_id','platform','question','en_question','keywords','url','created_at','updated_at'];
51 if(!empty($map['created_at'])){ 51 if(!empty($map['created_at'])){
52 $map['project_id'] = $this->user['project_id']; 52 $map['project_id'] = $this->user['project_id'];
53 - $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].'23:59:59']]; 53 + $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']];
54 $this->model = new GeoQuestionLog(); 54 $this->model = new GeoQuestionLog();
55 } 55 }
56 $query = $this->model->formatQuery($map); 56 $query = $this->model->formatQuery($map);
@@ -83,7 +83,7 @@ class GeoQuestionResLogic extends BaseLogic @@ -83,7 +83,7 @@ class GeoQuestionResLogic extends BaseLogic
83 */ 83 */
84 public function countQuantity(){ 84 public function countQuantity(){
85 $questionModel = new GeoQuestion(); 85 $questionModel = new GeoQuestion();
86 - $list = $questionModel->list(['project_id',$this->user['project_id']],['question','keywords','url']); 86 + $list = $questionModel->list(['project_id'=>$this->user['project_id']],['question','keywords','url']);
87 $questionTotalCount = $urlTotalCount = $keywordsTotalCount = $keywordUrlCount = 0; 87 $questionTotalCount = $urlTotalCount = $keywordsTotalCount = $keywordUrlCount = 0;
88 foreach ($list as $item){ 88 foreach ($list as $item){
89 $questionTotalCount += count($item['question'] ?? []); 89 $questionTotalCount += count($item['question'] ?? []);
@@ -91,15 +91,13 @@ class GeoQuestionResLogic extends BaseLogic @@ -91,15 +91,13 @@ class GeoQuestionResLogic extends BaseLogic
91 $urlTotalCount += count($item['url'] ?? []); 91 $urlTotalCount += count($item['url'] ?? []);
92 } 92 }
93 $keywordArr = []; 93 $keywordArr = [];
94 - $questionResModel = new GeoQuestionResult();  
95 - $resList = $questionResModel->list(['project_id',$this->user['project_id']],['keywords_num','url_num']); 94 + $questionResModel = new GeoQuestionLog();
  95 + $resList = $questionResModel->list(['project_id'=>$this->user['project_id']],['keywords','url','keywords_num','url_num']);
96 foreach ($resList as $resItem){ 96 foreach ($resList as $resItem){
97 - $keywordsNumArr = json_decode($resItem['keywords_num'] ?? [], true); // 转为 PHP 关联数组  
98 - $keywordUrlCount += array_sum($keywordsNumArr); // 获取值的总和  
99 - $urlNumArr = json_decode($resItem['url'] ?? [],true);  
100 - $keywordUrlCount += array_sum($urlNumArr); // 获取值的总和 97 + $keywordUrlCount += count($resItem['keywords']);
  98 + $keywordUrlCount += count($resItem['url']);
101 foreach ($resItem['keywords_num'] as $key => $value) { 99 foreach ($resItem['keywords_num'] as $key => $value) {
102 - $keywordArr[$key] = ($keywordArr[$key] ?? 0) + $value; 100 + $keywordArr[$key] = ($keywordArr[$key] ?? 0) + (($value != 0) ? 1 : 0);
103 } 101 }
104 } 102 }
105 $data = [ 103 $data = [
@@ -31,6 +31,7 @@ class AsideTicketStoreRequest extends FormRequest @@ -31,6 +31,7 @@ class AsideTicketStoreRequest extends FormRequest
31 'engineer_ids' => 'array', 31 'engineer_ids' => 'array',
32 'star' => 'nullable|in:1,2,3|integer', 32 'star' => 'nullable|in:1,2,3|integer',
33 'plan_end_at' => 'nullable|date', 33 'plan_end_at' => 'nullable|date',
  34 + 'close_wechat' => 'nullable|boolean',
34 ]; 35 ];
35 } 36 }
36 } 37 }
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 9
10 namespace App\Models\Geo; 10 namespace App\Models\Geo;
11 11
  12 +use App\Helper\Arr;
12 use App\Models\Base; 13 use App\Models\Base;
13 14
14 /** 15 /**
@@ -21,4 +22,80 @@ use App\Models\Base; @@ -21,4 +22,80 @@ use App\Models\Base;
21 class GeoQuestionLog extends Base 22 class GeoQuestionLog extends Base
22 { 23 {
23 protected $table = 'gl_geo_question_log'; 24 protected $table = 'gl_geo_question_log';
  25 +
  26 + /**
  27 + * @remark :geo提交关键字获取器
  28 + * @name :getUrlAttribute
  29 + * @author :lyh
  30 + * @method :post
  31 + * @time :2025/7/3 9:53
  32 + */
  33 + public function getKeywordsAttribute($value)
  34 + {
  35 + if($value){
  36 + $value = Arr::s2a($value);
  37 + }
  38 + return $value;
  39 + }
  40 +
  41 + /**
  42 + * @remark :geo提交网址获取器
  43 + * @name :getUrlAttribute
  44 + * @author :lyh
  45 + * @method :post
  46 + * @time :2025/7/3 9:52
  47 + */
  48 + public function getUrlAttribute($value)
  49 + {
  50 + if($value){
  51 + $value = Arr::s2a($value);
  52 + }
  53 + return $value;
  54 + }
  55 +
  56 + /**
  57 + * @remark :geo提交结果获取器
  58 + * @name :getUrlAttribute
  59 + * @author :lyh
  60 + * @method :post
  61 + * @time :2025/7/3 9:52
  62 + */
  63 + public function getTextAttribute($value)
  64 + {
  65 + if($value){
  66 + $value = Arr::s2a($value);
  67 + }
  68 + return $value;
  69 + }
  70 +
  71 + /**
  72 + * @remark :命中的关键词数量
  73 + * @name :getKeywordsNumAttribute
  74 + * @author :lyh
  75 + * @method :post
  76 + * @time :2025/7/21 11:33
  77 + */
  78 + public function getKeywordsNumAttribute($value)
  79 + {
  80 + if($value){
  81 + $value = Arr::s2a($value);
  82 + }
  83 + return $value;
  84 + }
  85 +
  86 + /**
  87 + * @remark :命中的url数量
  88 + * @name :getUrlNumAttribute
  89 + * @author :lyh
  90 + * @method :post
  91 + * @time :2025/7/21 11:34
  92 + */
  93 + public function getUrlNumAttribute($value)
  94 + {
  95 + if($value){
  96 + $value = Arr::s2a($value);
  97 + }
  98 + return $value;
  99 + }
  100 +
24 } 101 }
@@ -435,6 +435,10 @@ class Project extends Base @@ -435,6 +435,10 @@ class Project extends Base
435 } 435 }
436 436
437 $project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id'); 437 $project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id');
  438 + if(empty($project_id)){
  439 + //项目多语言自定义跳转连接
  440 + $project_id = CountryCustom::where('is_create', 1)->where('custom_domain', $domain)->value('project_id');
  441 + }
438 if (empty($project_id)) { 442 if (empty($project_id)) {
439 //是否小语种域名或amp站域名 443 //是否小语种域名或amp站域名
440 $domainPrefix = explode(".",$domain); 444 $domainPrefix = explode(".",$domain);
@@ -53,7 +53,25 @@ class Tickets extends Base @@ -53,7 +53,25 @@ class Tickets extends Base
53 elseif ($this->project->project_cate == 4) 53 elseif ($this->project->project_cate == 4)
54 $canyu[] = 85; // 黄小玉 54 $canyu[] = 85; // 黄小玉
55 else{ 55 else{
56 - // todo 待完善 56 + // todo V5V6 的项目, 组长能够给看到组员的工单
  57 + $leaders = [];
  58 + foreach (array_merge($engineer_ids, $canyu) as $engineer_id)
  59 + {
  60 + $engineer = ManageHr::where('manage_id', $engineer_id)->first();
  61 + if ($engineer)
  62 + {
  63 + $leader = ManageHr::where('is_leader', 1)
  64 + ->where('status', ManageHr::STATUS_ONE)
  65 + ->where('dept_id', $engineer->dept_id)
  66 + ->where('belong_group', $engineer->belong_group)
  67 + ->value('manage_id');
  68 + if ($leader)
  69 + $leaders[] = $leader;
  70 + }
  71 +
  72 + }
  73 + // 合并组长 id 到 $canyu
  74 + $canyu = array_merge($canyu, $leaders);
57 } 75 }
58 76
59 $all_engineer_ids = array_unique(array_merge($canyu, $engineer_ids)); 77 $all_engineer_ids = array_unique(array_merge($canyu, $engineer_ids));
@@ -62,7 +62,7 @@ class MessagePush extends Base @@ -62,7 +62,7 @@ class MessagePush extends Base
62 } 62 }
63 63
64 //特殊处理, 要求任何时候收到询盘都要及时推送到群里面 64 //特殊处理, 要求任何时候收到询盘都要及时推送到群里面
65 - $special_project_ids = [650, 2045]; 65 + $special_project_ids = [650, 2045, 916];
66 //9-21 点,每条消息及时通知 66 //9-21 点,每条消息及时通知
67 //21-第二天 9 点,整合一起通知 67 //21-第二天 9 点,整合一起通知
68 $hour = date('H', strtotime($submit_at)); 68 $hour = date('H', strtotime($submit_at));