作者 刘锟

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

@@ -27,7 +27,7 @@ class RemainDay extends Command @@ -27,7 +27,7 @@ class RemainDay extends Command
27 * @var 按优化时间统计 27 * @var 按优化时间统计
28 */ 28 */
29 protected $projectId = [ 29 protected $projectId = [
30 - 1434,1812,276,2414,2974,793 30 + 1434,1812,276,2414,2974,
31 ];//需要单独处理的项目 31 ];//需要单独处理的项目
32 32
33 /** 33 /**
@@ -37,7 +37,13 @@ class RemainDay extends Command @@ -37,7 +37,13 @@ class RemainDay extends Command
37 protected $bm_projectId = [ 37 protected $bm_projectId = [
38 4247,4299,4310,4215,4038,4084,4148,4178,4405 38 4247,4299,4310,4215,4038,4084,4148,4178,4405
39 ]; 39 ];
40 - 40 + /**
  41 + * @var
  42 + * 优化项目,中途切换按服务时间长计时,单独计算
  43 + */
  44 + protected $projectSwitchId = [
  45 + 793,
  46 + ];
41 47
42 /** 48 /**
43 * @var 暂停的项目 49 * @var 暂停的项目
@@ -85,8 +91,8 @@ class RemainDay extends Command @@ -85,8 +91,8 @@ class RemainDay extends Command
85 public function saveRemainDay(){ 91 public function saveRemainDay(){
86 $list = $this->project->list(['extend_type'=>Project::TYPE_ZERO,'type'=>['in',[Project::TYPE_TWO,Project::TYPE_THREE,Project::TYPE_FOUR,Project::TYPE_SIX]]],'id',['id','type','level','uptime','remain_day','is_remain_today','pause_days','finish_remain_day','bm_finish_remain_day']); 92 $list = $this->project->list(['extend_type'=>Project::TYPE_ZERO,'type'=>['in',[Project::TYPE_TWO,Project::TYPE_THREE,Project::TYPE_FOUR,Project::TYPE_SIX]]],'id',['id','type','level','uptime','remain_day','is_remain_today','pause_days','finish_remain_day','bm_finish_remain_day']);
87 foreach ($list as $item){ 93 foreach ($list as $item){
88 - $deploy_build = $this->deployBuild->read(['project_id'=>$item['id']],['service_duration','seo_service_duration','plan','seo_plan']);  
89 echo 'start->项目id:' . $item['id'] . '执行时间:'. date('Y-m-d H:i:s') . PHP_EOL; 94 echo 'start->项目id:' . $item['id'] . '执行时间:'. date('Y-m-d H:i:s') . PHP_EOL;
  95 + $deploy_build = $this->deployBuild->read(['project_id'=>$item['id']],['service_duration','seo_service_duration','plan','seo_plan']);
90 if(in_array($item['id'],$this->ceaseProjectId)){//暂停的项目 96 if(in_array($item['id'],$this->ceaseProjectId)){//暂停的项目
91 if(($item['type'] == Project::TYPE_TWO) && ($item['is_remain_today'] == 1)){ 97 if(($item['type'] == Project::TYPE_TWO) && ($item['is_remain_today'] == 1)){
92 $pause_days = $item['pause_days'] + 1; 98 $pause_days = $item['pause_days'] + 1;
@@ -97,6 +103,11 @@ class RemainDay extends Command @@ -97,6 +103,11 @@ class RemainDay extends Command
97 $this->project->edit(['pause_days'=>$pause_days],['id'=>$item['id']]); 103 $this->project->edit(['pause_days'=>$pause_days],['id'=>$item['id']]);
98 continue; 104 continue;
99 } 105 }
  106 + //todo::优化项目中途达标计时切换为按天计时
  107 + if(in_array($item['id'],$this->projectSwitchId)){
  108 + $this->project->edit(['remain_day'=>$item['remain_day'] - 1,'finish_remain_day'=>$item['finish_remain_day'] + 1],['id'=>$item['id']]);
  109 + continue;
  110 + }
100 //白帽版本单独计算 111 //白帽版本单独计算
101 $this->seoRemainDay($deploy_build,$item); 112 $this->seoRemainDay($deploy_build,$item);
102 //默认版本统计 113 //默认版本统计
@@ -53,6 +53,7 @@ class SendProduct extends Command @@ -53,6 +53,7 @@ class SendProduct extends Command
53 if(empty($domain)){ 53 if(empty($domain)){
54 continue; 54 continue;
55 } 55 }
  56 + try {
56 $arr1 = $this->sendProduct(); 57 $arr1 = $this->sendProduct();
57 $arr2 = $this->sendBlog(); 58 $arr2 = $this->sendBlog();
58 $arr3 = $this->sendNews(); 59 $arr3 = $this->sendNews();
@@ -67,10 +68,13 @@ class SendProduct extends Command @@ -67,10 +68,13 @@ class SendProduct extends Command
67 'language'=> [], 68 'language'=> [],
68 'is_sitemap' => 0 69 'is_sitemap' => 0
69 ]; 70 ];
  71 + //TODO::通知C端生成界面
70 http_post($c_url, json_encode($param)); 72 http_post($c_url, json_encode($param));
71 } 73 }
72 - //TODO::通知C端生成界面 74 + }catch (\Exception $e){
73 DB::disconnect('custom_mysql'); 75 DB::disconnect('custom_mysql');
  76 + continue;
  77 + }
74 } 78 }
75 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 79 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
76 } 80 }
@@ -83,7 +87,6 @@ class SendProduct extends Command @@ -83,7 +87,6 @@ class SendProduct extends Command
83 * @time :2024/8/30 14:44 87 * @time :2024/8/30 14:44
84 */ 88 */
85 public function sendProduct(){ 89 public function sendProduct(){
86 - $start_date = date('Y-m-d 00:00:00');  
87 $end_date = date('Y-m-d 23:59:59'); 90 $end_date = date('Y-m-d 23:59:59');
88 $productModel = new Product(); 91 $productModel = new Product();
89 $arr = $productModel->formatQuery(['send_time'=>['<=',$end_date],'status'=>3])->pluck('route')->toArray(); 92 $arr = $productModel->formatQuery(['send_time'=>['<=',$end_date],'status'=>3])->pluck('route')->toArray();
@@ -99,7 +102,6 @@ class SendProduct extends Command @@ -99,7 +102,6 @@ class SendProduct extends Command
99 * @time :2024/8/30 15:19 102 * @time :2024/8/30 15:19
100 */ 103 */
101 public function sendBlog(){ 104 public function sendBlog(){
102 - $start_date = date('Y-m-d 00:00:00');  
103 $end_date = date('Y-m-d 23:59:59'); 105 $end_date = date('Y-m-d 23:59:59');
104 $blogModel = new Blog(); 106 $blogModel = new Blog();
105 $arr = $blogModel->formatQuery(['release_at'=>['<=',$end_date],'status'=>3])->pluck('url')->toArray(); 107 $arr = $blogModel->formatQuery(['release_at'=>['<=',$end_date],'status'=>3])->pluck('url')->toArray();
@@ -115,7 +117,6 @@ class SendProduct extends Command @@ -115,7 +117,6 @@ class SendProduct extends Command
115 * @time :2024/8/30 15:19 117 * @time :2024/8/30 15:19
116 */ 118 */
117 public function sendNews(){ 119 public function sendNews(){
118 - $start_date = date('Y-m-d 00:00:00');  
119 $end_date = date('Y-m-d 23:59:59'); 120 $end_date = date('Y-m-d 23:59:59');
120 $newsModel = new News(); 121 $newsModel = new News();
121 $arr = $newsModel->formatQuery(['release_at'=>['<=',$end_date],'status'=>3])->pluck('url')->toArray(); 122 $arr = $newsModel->formatQuery(['release_at'=>['<=',$end_date],'status'=>3])->pluck('url')->toArray();
@@ -31,13 +31,15 @@ class GeoController extends BaseController @@ -31,13 +31,15 @@ class GeoController extends BaseController
31 try { 31 try {
32 $token = trim($this->param['token']); 32 $token = trim($this->param['token']);
33 $param = Crypt::decrypt($token); 33 $param = Crypt::decrypt($token);
34 - if ($param['send_at'] + 86400 < time()) {}  
35 - $project_id = $param['project_id'];  
36 - } catch (\Exception $e) {  
37 - return $this->error('非法请求'); 34 + }catch (\Exception $e){
  35 + $this->response('非法请求',Code::SYSTEM_ERROR);
  36 + }
  37 + if ($param['send_at'] + 86400 < time()) {
  38 + $this->response('非法请求,已过期',Code::SYSTEM_ERROR);
38 } 39 }
  40 + $project_id = $param['project_id'];
39 $projectModel = new Project(); 41 $projectModel = new Project();
40 - $projectInfo = $projectModel->read(['project_id' => $project_id],['title','version']); 42 + $projectInfo = $projectModel->read(['id' => $project_id],['title','version']);
41 $geoWritingsModel = new GeoWritings(); 43 $geoWritingsModel = new GeoWritings();
42 $lists = $geoWritingsModel->list(['project_id' => $project_id, 'status' => 2 ,'is_del' => GeoWritings::IS_DEL_FALSE],'id',['title', 'status', 'uniqid', 'confirm_at']); 44 $lists = $geoWritingsModel->list(['project_id' => $project_id, 'status' => 2 ,'is_del' => GeoWritings::IS_DEL_FALSE],'id',['title', 'status', 'uniqid', 'confirm_at']);
43 $result = [ 45 $result = [
@@ -93,7 +95,7 @@ class GeoController extends BaseController @@ -93,7 +95,7 @@ class GeoController extends BaseController
93 $this->param['content_length'] = strlen($this->param['content']); 95 $this->param['content_length'] = strlen($this->param['content']);
94 $this->param['status'] = GeoWritings::STATUS_FINISH; 96 $this->param['status'] = GeoWritings::STATUS_FINISH;
95 $geoWritingsModel->edit($this->param,['uniqid' => $token]); 97 $geoWritingsModel->edit($this->param,['uniqid' => $token]);
96 - return true; 98 + $this->response('success',Code::SUCCESS);
97 } 99 }
98 100
99 /** 101 /**
@@ -134,6 +136,8 @@ class GeoController extends BaseController @@ -134,6 +136,8 @@ class GeoController extends BaseController
134 ]); 136 ]);
135 $geoConfirmModel = new GeoConfirm(); 137 $geoConfirmModel = new GeoConfirm();
136 $this->param['status'] = $geoConfirmModel::STATUS_FINISH; 138 $this->param['status'] = $geoConfirmModel::STATUS_FINISH;
  139 + $this->param['confirm_ip'] = $this->request->ip();
  140 + $this->param['confirm_at'] = date('Y-m-d H:i:s');
137 $result = $geoConfirmModel->edit($this->param,['uniqid'=>$this->param['uniqid']]); 141 $result = $geoConfirmModel->edit($this->param,['uniqid'=>$this->param['uniqid']]);
138 $this->response('success',Code::SUCCESS,$result); 142 $this->response('success',Code::SUCCESS,$result);
139 } 143 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :SettingFaqController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/10/29 16:32
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Bside\Setting;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Bside\BaseController;
  14 +use App\Http\Logic\Bside\Setting\SettingFaqLogic;
  15 +use Illuminate\Http\Request;
  16 +
  17 +class SettingFaqController extends BaseController
  18 +{
  19 +
  20 + public function __construct(Request $request)
  21 + {
  22 + parent::__construct($request);
  23 + $this->logic = new SettingFaqLogic();
  24 + }
  25 +
  26 + /**
  27 + * @remark :faq列表页数据
  28 + * @name :lists
  29 + * @author :lyh
  30 + * @method :post
  31 + * @time :2025/10/29 16:38
  32 + */
  33 + public function lists()
  34 + {
  35 + $lists = $this->logic->getFaqLists($this->map,$this->page,$this->row,$this->order);
  36 + $this->response('success',Code::SUCCESS,$lists);
  37 + }
  38 +}
@@ -44,7 +44,7 @@ class GeoConfirmLogic extends BaseLogic @@ -44,7 +44,7 @@ class GeoConfirmLogic extends BaseLogic
44 if($info === false){ 44 if($info === false){
45 $id = $this->model->addReturnId($param); 45 $id = $this->model->addReturnId($param);
46 }else{ 46 }else{
47 - $id = $param['id']; 47 + $id = $info['id'];
48 $this->model->edit($param,['id'=>$info['id']]); 48 $this->model->edit($param,['id'=>$info['id']]);
49 } 49 }
50 $friend = ProjectAssociation::where(['project_id' => $param['project_id']])->first(); 50 $friend = ProjectAssociation::where(['project_id' => $param['project_id']])->first();
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :SettingFaqLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/10/29 16:34
  8 + */
  9 +
  10 +namespace App\Http\Logic\Bside\Setting;
  11 +
  12 +use App\Http\Logic\Bside\BaseLogic;
  13 +use App\Models\WebSetting\SettingFaq;
  14 +
  15 +class SettingFaqLogic extends BaseLogic
  16 +{
  17 + public function __construct()
  18 + {
  19 + parent::__construct();
  20 + $this->model = new SettingFaq();
  21 + $this->param = $this->requestAll;
  22 + }
  23 +
  24 + /**
  25 + * @remark :获取列表页数据
  26 + * @name :getFaqLists
  27 + * @author :lyh
  28 + * @method :post
  29 + * @time :2025/10/29 16:50
  30 + */
  31 + public function getFaqLists($map = [],$page = 1, $row = 10,$order = 'id')
  32 + {
  33 + $lists = $this->model->lists($map,$page,$row,$order);
  34 + return $this->success($lists);
  35 + }
  36 +
  37 + /**
  38 + * @remark :保存数据
  39 + * @name :saveFaq
  40 + * @author :lyh
  41 + * @method :post
  42 + * @time :2025/10/29 16:50
  43 + */
  44 + public function saveFaq()
  45 + {
  46 +
  47 + if(isset($this->param['id']) && !empty($this->param['id'])){
  48 + $id = $this->param['id'];
  49 + $this->model->edit($this->param,['id'=>$id]);
  50 + }else{
  51 + $id = $this->model->addReturnId($this->param);
  52 + }
  53 + return $this->success(['id' => $id]);
  54 + }
  55 +}
@@ -77,21 +77,20 @@ class GeoWritings extends Base @@ -77,21 +77,20 @@ class GeoWritings extends Base
77 */ 77 */
78 public static function sendConfirmMessage($project_id) 78 public static function sendConfirmMessage($project_id)
79 { 79 {
80 -// $friend = ProjectAssociation::where(['project_id' => $project_id])->first();  
81 -// if (empty($friend)) {  
82 -// return false;  
83 -// } 80 + $friend = ProjectAssociation::where(['project_id' => $project_id])->first();
  81 + if (empty($friend)) {
  82 + return false;
  83 + }
84 $content_type = 'Link'; 84 $content_type = 'Link';
85 $send_time = now(); 85 $send_time = now();
86 $type = MessagePush::TYPE_GEO_CONFIRM; 86 $type = MessagePush::TYPE_GEO_CONFIRM;
87 -// $friend_id = $friend->friend_id; 87 + $friend_id = $friend->friend_id;
88 $created_at = $updated_at = now(); 88 $created_at = $updated_at = now();
89 $param = [ 89 $param = [
90 'project_id' => $project_id, 90 'project_id' => $project_id,
91 'send_at' => time() 91 'send_at' => time()
92 ]; 92 ];
93 $token = Crypt::encrypt($param); 93 $token = Crypt::encrypt($param);
94 - return ['token'=>$token];  
95 $content_array = [ 94 $content_array = [
96 'title' => "确认核心文章", 95 'title' => "确认核心文章",
97 'desc' => '确认核心文章', 96 'desc' => '确认核心文章',
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :SettingFaq.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/10/29 16:35
  8 + */
  9 +
  10 +namespace App\Models\WebSetting;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +class SettingFaq extends Base
  15 +{
  16 + protected $table = 'gl_setting_faq';
  17 +}