作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into lyh-server

@@ -14,6 +14,8 @@ use App\Models\Devops\ServersIp; @@ -14,6 +14,8 @@ use App\Models\Devops\ServersIp;
14 use App\Models\Domain\DomainCreateTask; 14 use App\Models\Domain\DomainCreateTask;
15 use App\Models\Project\CountryCustom; 15 use App\Models\Project\CountryCustom;
16 use App\Models\Project\Project; 16 use App\Models\Project\Project;
  17 +use App\Models\ProjectAssociation\ProjectAssociation;
  18 +use App\Models\Workchat\MessagePush;
17 use Illuminate\Console\Command; 19 use Illuminate\Console\Command;
18 use App\Models\Domain\DomainInfo as DomainInfoModel; 20 use App\Models\Domain\DomainInfo as DomainInfoModel;
19 use Illuminate\Support\Facades\Log; 21 use Illuminate\Support\Facades\Log;
@@ -69,6 +71,7 @@ class DomainInfo extends Command @@ -69,6 +71,7 @@ class DomainInfo extends Command
69 $projectModel = new Project(); 71 $projectModel = new Project();
70 $serverIpModel = new ServersIp(); 72 $serverIpModel = new ServersIp();
71 $domainCreateTaskModel = new DomainCreateTask(); 73 $domainCreateTaskModel = new DomainCreateTask();
  74 + $end_day = date('Y-m-d H:i:s', strtotime('+1 month'));//域名1月后到期
72 $list = $domainModel->where('status', '=', 1)->get(); 75 $list = $domainModel->where('status', '=', 1)->get();
73 foreach ($list as $v) { 76 foreach ($list as $v) {
74 $project_info = $projectModel->read(['id' => $v['project_id'], 'type' => ['!=', Project::TYPE_CLOSE]], ['serve_id', 'project_type']); 77 $project_info = $projectModel->read(['id' => $v['project_id'], 'type' => ['!=', Project::TYPE_CLOSE]], ['serve_id', 'project_type']);
@@ -90,13 +93,19 @@ class DomainInfo extends Command @@ -90,13 +93,19 @@ class DomainInfo extends Command
90 $v->save(); 93 $v->save();
91 } 94 }
92 95
93 - if (empty($v['domain_end_time']) || $v['domain_end_time'] < date('Y-m-d H:i:s')) { 96 + if (empty($v['domain_end_time']) || $v['domain_end_time'] < $end_day) {
94 //获取主站域名有效期并更新 97 //获取主站域名有效期并更新
95 $valid_time = $this->getDomainValidTime($v['domain']); 98 $valid_time = $this->getDomainValidTime($v['domain']);
96 if ($valid_time['start'] && $valid_time['end']) { 99 if ($valid_time['start'] && $valid_time['end']) {
97 $v->domain_start_time = $valid_time['start']; 100 $v->domain_start_time = $valid_time['start'];
98 $v->domain_end_time = $valid_time['end']; 101 $v->domain_end_time = $valid_time['end'];
99 $v->save(); 102 $v->save();
  103 +
  104 + //域名到期提醒
  105 + if ($valid_time['end'] < $end_day) {
  106 + $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0;
  107 + $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end);
  108 + }
100 } 109 }
101 } 110 }
102 } else { 111 } else {
@@ -125,13 +134,19 @@ class DomainInfo extends Command @@ -125,13 +134,19 @@ class DomainInfo extends Command
125 $v->save(); 134 $v->save();
126 } 135 }
127 136
128 - if (empty($v['domain_end_time']) || $v['domain_end_time'] < date('Y-m-d H:i:s')) { 137 + if (empty($v['domain_end_time']) || $v['domain_end_time'] < $end_day) {
129 //获取主站域名有效期并更新 138 //获取主站域名有效期并更新
130 $valid_time = $this->getDomainValidTime($v['domain']); 139 $valid_time = $this->getDomainValidTime($v['domain']);
131 if ($valid_time['start'] && $valid_time['end']) { 140 if ($valid_time['start'] && $valid_time['end']) {
132 $v->domain_start_time = $valid_time['start']; 141 $v->domain_start_time = $valid_time['start'];
133 $v->domain_end_time = $valid_time['end']; 142 $v->domain_end_time = $valid_time['end'];
134 $v->save(); 143 $v->save();
  144 +
  145 + //域名到期提醒
  146 + if ($valid_time['end'] < $end_day) {
  147 + $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0;
  148 + $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end);
  149 + }
135 } 150 }
136 } 151 }
137 152
@@ -177,7 +192,7 @@ class DomainInfo extends Command @@ -177,7 +192,7 @@ class DomainInfo extends Command
177 $projectModel = new Project(); 192 $projectModel = new Project();
178 $serverIpModel = new ServersIp(); 193 $serverIpModel = new ServersIp();
179 $domainCreateTaskModel = new DomainCreateTask(); 194 $domainCreateTaskModel = new DomainCreateTask();
180 - $end_day = date('Y-m-d H:i:s', time() + 3 * 24 * 3600);//3天后到期 195 + $end_day = date('Y-m-d H:i:s', strtotime('+3 day'));//3天后到期
181 $list = $domainModel->where('status', '=', 1)->where('type', '!=', 2)->where('certificate_end_time', '<', $end_day)->get()->toArray(); 196 $list = $domainModel->where('status', '=', 1)->where('type', '!=', 2)->where('certificate_end_time', '<', $end_day)->get()->toArray();
182 foreach ($list as $v) { 197 foreach ($list as $v) {
183 $project_info = $projectModel->read(['id' => $v['project_id'], 'type' => ['!=', Project::TYPE_CLOSE]], ['serve_id', 'project_type']); 198 $project_info = $projectModel->read(['id' => $v['project_id'], 'type' => ['!=', Project::TYPE_CLOSE]], ['serve_id', 'project_type']);
@@ -230,7 +245,7 @@ class DomainInfo extends Command @@ -230,7 +245,7 @@ class DomainInfo extends Command
230 $projectModel = new Project(); 245 $projectModel = new Project();
231 $serverIpModel = new ServersIp(); 246 $serverIpModel = new ServersIp();
232 $domainCreateTaskModel = new DomainCreateTask(); 247 $domainCreateTaskModel = new DomainCreateTask();
233 - $end_day = date('Y-m-d H:i:s', time() + 3 * 24 * 3600);//3天后到期 248 + $end_day = date('Y-m-d H:i:s', strtotime('+3 day'));//3天后到期
234 $list = $domainModel->where('status', '=', 1)->where('amp_status', 1)->where('amp_type', '!=', 2)->where('amp_certificate_end_time', '<', $end_day)->get()->toArray(); 249 $list = $domainModel->where('status', '=', 1)->where('amp_status', 1)->where('amp_type', '!=', 2)->where('amp_certificate_end_time', '<', $end_day)->get()->toArray();
235 foreach ($list as $v) { 250 foreach ($list as $v) {
236 $domain_array = parse_url($v['domain']); 251 $domain_array = parse_url($v['domain']);
@@ -287,7 +302,7 @@ class DomainInfo extends Command @@ -287,7 +302,7 @@ class DomainInfo extends Command
287 $projectModel = new Project(); 302 $projectModel = new Project();
288 $serverIpModel = new ServersIp(); 303 $serverIpModel = new ServersIp();
289 $domainCreateTaskModel = new DomainCreateTask(); 304 $domainCreateTaskModel = new DomainCreateTask();
290 - $end_day = date('Y-m-d H:i:s', time() + 3 * 24 * 3600);//3天后到期 305 + $end_day = date('Y-m-d H:i:s', strtotime('+3 day'));//3天后到期
291 $list = $customModel->where('status', 1)->where('is_create', 1)->where('type', '=', 1)->where('certificate_end_time', '<', $end_day)->get()->toArray(); 306 $list = $customModel->where('status', 1)->where('is_create', 1)->where('type', '=', 1)->where('certificate_end_time', '<', $end_day)->get()->toArray();
292 foreach ($list as $v) { 307 foreach ($list as $v) {
293 $project_info = $projectModel->read(['id' => $v['project_id'], 'type' => ['!=', Project::TYPE_CLOSE]], ['serve_id']); 308 $project_info = $projectModel->read(['id' => $v['project_id'], 'type' => ['!=', Project::TYPE_CLOSE]], ['serve_id']);
@@ -379,4 +394,38 @@ class DomainInfo extends Command @@ -379,4 +394,38 @@ class DomainInfo extends Command
379 } 394 }
380 return ['start' => $start, 'end' => $end]; 395 return ['start' => $start, 'end' => $end];
381 } 396 }
  397 +
  398 + /**
  399 + * 推送域名到期微信消息提醒
  400 + * @param $project_id
  401 + * @param $domain_id
  402 + * @param $domain
  403 + * @param $is_end
  404 + * @author Akun
  405 + * @date 2025/08/14 9:56
  406 + */
  407 + public function domainChatMessage($project_id, $domain_id, $domain, $is_end)
  408 + {
  409 + //项目是否有绑定群
  410 + $friend_id = ProjectAssociation::where('project_id', $project_id)
  411 + ->where('status', ProjectAssociation::STATUS_NORMAL)
  412 + ->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT)
  413 + ->value('friend_id');
  414 + if ($friend_id) {
  415 + $tips = $is_end ? ' 已经到期,请及时处理。' : ' 有效期不足一个月,请留意。';
  416 + $message = '【域名到期提醒】' . PHP_EOL . '域名 ' . $domain . $tips;
  417 + $param = [
  418 + 'project_id' => $project_id,
  419 + 'friend_id' => $friend_id,
  420 + 'type' => MessagePush::TYPE_DOMAIN,
  421 + 'content' => $message,
  422 + 'ref_ids' => $domain_id,
  423 + 'send_time' => date('Y-m-d 14:00:00'),
  424 + 'status' => 0,
  425 + ];
  426 + //写入一条推送消息 自动消费
  427 + $messagePushModel = new MessagePush();
  428 + $messagePushModel->add($param);
  429 + }
  430 + }
382 } 431 }
@@ -434,9 +434,6 @@ class WebTraffic extends Command @@ -434,9 +434,6 @@ class WebTraffic extends Command
434 $query->whereNotIn('ip_area', $main_countries); 434 $query->whereNotIn('ip_area', $main_countries);
435 } 435 }
436 })->inRandomOrder()->first(); 436 })->inRandomOrder()->first();
437 - if(!$ipdata){  
438 - continue;  
439 - }  
440 $ipdata = (array)$ipdata ?: []; 437 $ipdata = (array)$ipdata ?: [];
441 $ipdata['diff'] = $time_zones[$ipdata['ip_area']]; 438 $ipdata['diff'] = $time_zones[$ipdata['ip_area']];
442 $data[] = $ipdata; 439 $data[] = $ipdata;
@@ -354,7 +354,7 @@ class FetchTicketProjects extends Command @@ -354,7 +354,7 @@ class FetchTicketProjects extends Command
354 // 第一负责人 354 // 第一负责人
355 $engineer_id = $assm_id; 355 $engineer_id = $assm_id;
356 if ($project_cate == 3) 356 if ($project_cate == 3)
357 - $is_del = !empty($item["go_online"]); 357 + $is_del = empty($item["go_online"]);
358 else{ 358 else{
359 // 域途,以服务时间为准 $item['yutu_service_start_time'] 是开始时间 + 有效天数 yutu_planday 359 // 域途,以服务时间为准 $item['yutu_service_start_time'] 是开始时间 + 有效天数 yutu_planday
360 $is_del = !empty($item['yutu_service_start_time']) && !empty($item['yutu_planday']) 360 $is_del = !empty($item['yutu_service_start_time']) && !empty($item['yutu_planday'])
@@ -66,6 +66,20 @@ class AsideTicketController extends BaseController @@ -66,6 +66,20 @@ class AsideTicketController extends BaseController
66 ->orWhere('company_name', 'like', '%' . $search . '%'); 66 ->orWhere('company_name', 'like', '%' . $search . '%');
67 }); 67 });
68 }); 68 });
  69 + })
  70 + // 根据TicketProject的status字段筛选
  71 + ->when($request->input('project_status') !== null, function ($query) use ($request) {
  72 + $projectStatus = $request->input('project_status');
  73 + return $query->whereHas('project', function ($q) use ($projectStatus) {
  74 + $q->where('status', $projectStatus);
  75 + });
  76 + })
  77 + // 根据TicketProject的project_cate字段筛选
  78 + ->when($request->input('project_cate') !== null, function ($query) use ($request) {
  79 + $projectCate = $request->input('project_cate');
  80 + return $query->whereHas('project', function ($q) use ($projectCate) {
  81 + $q->where('project_cate', $projectCate);
  82 + });
69 }); 83 });
70 //TODO::用户部门搜索 84 //TODO::用户部门搜索
71 if(isset($this->param['dept_id']) && !empty($this->param['dept_id'])){ 85 if(isset($this->param['dept_id']) && !empty($this->param['dept_id'])){
@@ -111,7 +111,7 @@ class RankDataLogic extends BaseLogic @@ -111,7 +111,7 @@ class RankDataLogic extends BaseLogic
111 $lang_data = Arr::setValueToKey($lang_data, 'language'); 111 $lang_data = Arr::setValueToKey($lang_data, 'language');
112 $data['langs'] = []; 112 $data['langs'] = [];
113 $languageModel = new MinorLanguages(); 113 $languageModel = new MinorLanguages();
114 - $languageList = $languageModel->list(['project_id'=>$project['id']]); 114 + $languageList = $languageModel->list(['project_id'=>$project['id'], 'is_delete' => 0]);
115 if(!empty($languageList) && is_array($languageList)){ 115 if(!empty($languageList) && is_array($languageList)){
116 foreach($languageList as $lang){ 116 foreach($languageList as $lang){
117 if($lang['lang'] =='ja'){ 117 if($lang['lang'] =='ja'){
@@ -33,6 +33,8 @@ class AsideTicketListRequest extends FormRequest @@ -33,6 +33,8 @@ class AsideTicketListRequest extends FormRequest
33 'size' => 'nullable|integer', 33 'size' => 'nullable|integer',
34 'sort_field' => 'nullable|in:created_at,plan_end_at', 34 'sort_field' => 'nullable|in:created_at,plan_end_at',
35 'sort_order' => 'nullable|in:asc,desc', 35 'sort_order' => 'nullable|in:asc,desc',
  36 + 'project_status' => 'nullable|in:1,2,3|integer',
  37 + 'project_cate' => 'nullable|in:1,2,3,4|integer',
36 ]; 38 ];
37 } 39 }
38 } 40 }
@@ -28,6 +28,7 @@ class MessagePush extends Base @@ -28,6 +28,7 @@ class MessagePush extends Base
28 const TYPE_INQUIRY = 'inquiry'; 28 const TYPE_INQUIRY = 'inquiry';
29 const TYPE_WEEK = 'week'; 29 const TYPE_WEEK = 'week';
30 const TYPE_TICKET = 'Ticket'; 30 const TYPE_TICKET = 'Ticket';
  31 + const TYPE_DOMAIN = 'domain';
31 //设置关联表名 32 //设置关联表名
32 /** 33 /**
33 * @var mixed 34 * @var mixed
@@ -770,7 +770,6 @@ Route::group([], function () { @@ -770,7 +770,6 @@ Route::group([], function () {
770 }); 770 });
771 Route::any('/login', [\App\Http\Controllers\Bside\LoginController::class, 'login'])->name('login'); 771 Route::any('/login', [\App\Http\Controllers\Bside\LoginController::class, 'login'])->name('login');
772 Route::any('/projectLogin', [\App\Http\Controllers\Bside\LoginController::class, 'projectLogin'])->name('projectLogin'); 772 Route::any('/projectLogin', [\App\Http\Controllers\Bside\LoginController::class, 'projectLogin'])->name('projectLogin');
773 - Route::any('/ceshi', [\App\Http\Controllers\Bside\TestController::class, 'ceshi'])->name('ceshi');  
774 Route::any('/file_manager_downLoad', [\App\Http\Controllers\Bside\FileManage\FileManageController::class, 'downLoad'])->name('file_manager_downLoad'); 773 Route::any('/file_manager_downLoad', [\App\Http\Controllers\Bside\FileManage\FileManageController::class, 'downLoad'])->name('file_manager_downLoad');
775 Route::any('/stringTranslation', [\App\Http\Controllers\Bside\LoginController::class, 'stringTranslation'])->name('stringTranslation'); 774 Route::any('/stringTranslation', [\App\Http\Controllers\Bside\LoginController::class, 'stringTranslation'])->name('stringTranslation');
776 Route::any('/sendLoginSms', [\App\Http\Controllers\Bside\LoginController::class, 'sendLoginSms'])->name('sendLoginSms'); 775 Route::any('/sendLoginSms', [\App\Http\Controllers\Bside\LoginController::class, 'sendLoginSms'])->name('sendLoginSms');