作者 刘锟

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

@@ -296,13 +296,13 @@ class AiBlogTask extends Command @@ -296,13 +296,13 @@ class AiBlogTask extends Command
296 $domain = $domainModel->getProjectIdDomain($project_id); 296 $domain = $domainModel->getProjectIdDomain($project_id);
297 if (empty($domain)) { 297 if (empty($domain)) {
298 $this->output('send: 域名不存在, project id: ' . $project_id); 298 $this->output('send: 域名不存在, project id: ' . $project_id);
299 - return true; 299 + continue;
300 } 300 }
301 //判断是否是自建站服务器,如果是,不请求C端接口,数据直接入库 301 //判断是否是自建站服务器,如果是,不请求C端接口,数据直接入库
302 $project_info = $project_model->read(['id'=>$project_id],['serve_id']); 302 $project_info = $project_model->read(['id'=>$project_id],['serve_id']);
303 if(!$project_info){ 303 if(!$project_info){
304 $this->output('send: 项目不存在, project id: ' . $project_id); 304 $this->output('send: 项目不存在, project id: ' . $project_id);
305 - return true; 305 + continue;
306 } 306 }
307 $serve_ip_model = new ServersIp(); 307 $serve_ip_model = new ServersIp();
308 $serve_ip_info = $serve_ip_model->read(['id'=>$project_info['serve_id']],['servers_id']); 308 $serve_ip_info = $serve_ip_model->read(['id'=>$project_info['serve_id']],['servers_id']);
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :CheckListController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/4/17 9:25
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Optimize;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Models\Project\OptimizeCheckList;
  15 +use Illuminate\Http\Request;
  16 +
  17 +/**
  18 + * @remark :保存清单
  19 + * @name :CheckListController
  20 + * @author :lyh
  21 + * @method :post
  22 + * @time :2025/4/17 9:25
  23 + */
  24 +class CheckListController extends BaseController
  25 +{
  26 + public function __construct(Request $request)
  27 + {
  28 + parent::__construct($request);
  29 + $this->model = new OptimizeCheckList();
  30 + }
  31 +
  32 + /**
  33 + * @remark :获取分页检查清单数据
  34 + * @name :lists
  35 + * @author :lyh
  36 + * @method :post
  37 + * @time :2025/4/17 9:31
  38 + */
  39 + public function lists(){
  40 + $field = ['id','status','sort','text','created_at'];
  41 + $data = $this->model->list($this->map,$this->page,$this->row,'id',$field);
  42 + $this->response('success',Code::SUCCESS,$data);
  43 + }
  44 +
  45 + /**
  46 + * @remark :保存检查清单
  47 + * @name :save
  48 + * @author :lyh
  49 + * @method :post
  50 + * @time :2025/4/17 9:32
  51 + */
  52 + public function save(){
  53 + if(isset($this->param['id']) && !empty($this->param['id'])){
  54 + $id = $this->param['id'];
  55 + $this->model->edit($this->param,['id'=>$this->param['id']]);
  56 + }else{
  57 + $id = $this->model->addReturnId($this->param);
  58 + }
  59 + $this->response('success',Code::SUCCESS,['id'=>$id]);
  60 + }
  61 +
  62 + /**
  63 + * @remark :修改状态
  64 + * @name :status
  65 + * @author :lyh
  66 + * @method :post
  67 + * @time :2025/4/17 9:48
  68 + */
  69 + public function status(){
  70 + $this->request->validate([
  71 + 'id'=>'required',
  72 + 'status'=>'required'
  73 + ],[
  74 + 'id.required' => '主键不能为空',
  75 + 'status.required' => '状态不能为空',
  76 + ]);
  77 + $data = $this->model->edit(['status'=>$this->param['status']],['id'=>$this->param['id']]);
  78 + $this->response('success',Code::SUCCESS,$data);
  79 + }
  80 +
  81 + /**
  82 + * @remark :删除数据
  83 + * @name :del
  84 + * @author :lyh
  85 + * @method :post
  86 + * @time :2025/4/17 9:48
  87 + */
  88 + public function del(){
  89 + $this->request->validate([
  90 + 'id'=>'required',
  91 + ],[
  92 + 'id.required' => '主键不能为空',
  93 + ]);
  94 + if(!is_array($this->param['id'])){
  95 + $this->param['id'] = ['in',[$this->param['id']]];
  96 + }
  97 + $data = $this->model->del($this->map);
  98 + $this->response('success',Code::SUCCESS,$data);
  99 + }
  100 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :CheckLogController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/4/17 10:07
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Optimize;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Models\Project\OptimizeCheckLog;
  15 +use Illuminate\Http\Request;
  16 +
  17 +/**
  18 + * @remark :检查日志
  19 + * @name :CheckLogController
  20 + * @author :lyh
  21 + * @method :post
  22 + * @time :2025/4/17 10:15
  23 + */
  24 +class CheckLogController extends BaseController
  25 +{
  26 + public function __construct(Request $request)
  27 + {
  28 + parent::__construct($request);
  29 + $this->model = new OptimizeCheckLog();
  30 + }
  31 +
  32 + /**
  33 + * @remark :检查日志列表
  34 + * @name :lists
  35 + * @author :lyh
  36 + * @method :post
  37 + * @time :2025/4/17 10:17
  38 + */
  39 + public function lists(){
  40 + $field = ['id','check_id','date','status','images','result','created_at'];
  41 + $this->map['status'] = 1;
  42 + $lists = $this->model->lists($this->map,$this->page,$this->row,'id',$field);
  43 + $this->response('success',Code::SUCCESS,$lists);
  44 + }
  45 +
  46 + /**
  47 + * @remark :保存数据
  48 + * @name :save
  49 + * @author :lyh
  50 + * @method :post
  51 + * @time :2025/4/17 10:27
  52 + */
  53 + public function save(){
  54 + $this->request->validate([
  55 + 'id'=>'required', 'check_id'=>'required',
  56 + 'date'=>'required', 'result'=>'required',
  57 + ],[
  58 + 'id.required' => '主键不能为空', 'check_id.required' => '问题id不能为空',
  59 + 'date.required' => '时间不能为空', 'result.required' => '检查结果不能为空',
  60 + ]);
  61 + $this->param = $this->model->saveHandleParam($this->param,$this->manage['id']);
  62 + if(isset($this->param['id']) && !empty($this->param['id'])){
  63 + $id = $this->param['id'];
  64 + $this->model->edit($this->param,['id'=>$this->param['id']]);
  65 + }else{
  66 + $id = $this->model->addReturnId($this->param);
  67 + }
  68 + $this->response('success',Code::SUCCESS,['id'=>$id]);
  69 + }
  70 +
  71 + /**
  72 + * @remark :修改状态
  73 + * @name :status
  74 + * @author :lyh
  75 + * @method :post
  76 + * @time :2025/4/17 10:43
  77 + */
  78 + public function status(){
  79 + $this->request->validate([
  80 + 'id'=>'required',
  81 + 'status'=>'required',
  82 + ],[
  83 + 'id.required' => '主键不能为空',
  84 + 'status.required' => 'status不能为空',
  85 + ]);
  86 + $data = $this->model->edit(['status'=>$this->param['status']],['id'=>$this->param['id']]);
  87 + $this->response('success',Code::SUCCESS,$data);
  88 + }
  89 +
  90 + /**
  91 + * @remark :删除数据
  92 + * @name :del
  93 + * @author :lyh
  94 + * @method :post
  95 + * @time :2025/4/17 10:52
  96 + */
  97 + public function del(){
  98 + $this->request->validate([
  99 + 'id'=>'required',
  100 + ],[
  101 + 'id.required' => '主键不能为空',
  102 + ]);
  103 + if(!is_array($this->param['id'])){
  104 + $this->param['id'] = ['in',[$this->param['id']]];
  105 + }
  106 + $data = $this->model->del($this->map);
  107 + $this->response('success',Code::SUCCESS,$data);
  108 + }
  109 +}
@@ -295,4 +295,21 @@ class KeywordController extends BaseController @@ -295,4 +295,21 @@ class KeywordController extends BaseController
295 $logic->delAllKeyword(); 295 $logic->delAllKeyword();
296 $this->response('success'); 296 $this->response('success');
297 } 297 }
  298 +
  299 + /**
  300 + * @remark :删除关键词所有关联产品
  301 + * @name :delRelatedProductId
  302 + * @author :lyh
  303 + * @method :post
  304 + * @time :2025/4/17 11:01
  305 + */
  306 + public function delRelatedProductId(KeywordLogic $logic){
  307 + $this->request->validate([
  308 + 'keyword_id'=>'required',
  309 + ],[
  310 + 'keyword_id.required' => '关键词ID不能为空',
  311 + ]);
  312 + $logic->delAllRelated($this->param['keyword_id']);
  313 + $this->response('success');
  314 + }
298 } 315 }
@@ -826,4 +826,5 @@ class ProductController extends BaseController @@ -826,4 +826,5 @@ class ProductController extends BaseController
826 } 826 }
827 return $keyword_name; 827 return $keyword_name;
828 } 828 }
  829 +
829 } 830 }
@@ -1025,7 +1025,7 @@ class ProjectLogic extends BaseLogic @@ -1025,7 +1025,7 @@ class ProjectLogic extends BaseLogic
1025 public function saveOtherProject(){ 1025 public function saveOtherProject(){
1026 //获取当前数据详情 1026 //获取当前数据详情
1027 $projectInfo = $this->getProjectInfo($this->param['id']); 1027 $projectInfo = $this->getProjectInfo($this->param['id']);
1028 - if(($projectInfo['created_at'] >= '2014-12-01 00:00:00')){//12月1号过后默认不开启 1028 + if(($projectInfo['created_at'] >= '2024-12-01 00:00:00')){//12月1号过后默认不开启
1029 $this->param['aicc'] = Project::TYPE_ZERO; 1029 $this->param['aicc'] = Project::TYPE_ZERO;
1030 } 1030 }
1031 if($this->param['aicc'] == Project::TYPE_ONE && !empty($this->param['exclusive_aicc_day'])){ 1031 if($this->param['aicc'] == Project::TYPE_ONE && !empty($this->param['exclusive_aicc_day'])){
@@ -298,6 +298,23 @@ class KeywordLogic extends BaseLogic @@ -298,6 +298,23 @@ class KeywordLogic extends BaseLogic
298 } 298 }
299 299
300 /** 300 /**
  301 + * @remark :对应删除关联关系
  302 + * @name :delRelated
  303 + * @author :lyh
  304 + * @method :post
  305 + * @time :2024/11/28 9:46
  306 + */
  307 + public function delAllRelated($keyword_id){
  308 + $productModel = new Product();
  309 + $productModel->update(['keyword_id' => DB::raw("REPLACE(keyword_id, ',$keyword_id,' , ',')"),'keyword_video_id' => DB::raw("REPLACE(keyword_video_id, ',$keyword_id,' , ',')")]);
  310 + $productModel->where('keyword_id',',')->orWhere('keyword_video_id',',')
  311 + ->update(['keyword_id' => DB::raw("REPLACE(keyword_id, ',' , '')"),'keyword_video_id' => DB::raw("REPLACE(keyword_video_id, ',' , '')")]);
  312 + $keywordRelatedModel = new KeywordRelated();
  313 + $keywordRelatedModel->del(['keyword_id'=>$keyword_id]);
  314 + return $this->success();
  315 + }
  316 +
  317 + /**
301 * @remark :删除所有的关键字 318 * @remark :删除所有的关键字
302 * @name :delAllKeyword 319 * @name :delAllKeyword
303 * @author :lyh 320 * @author :lyh
@@ -51,7 +51,6 @@ class RankDataLogic extends BaseLogic @@ -51,7 +51,6 @@ class RankDataLogic extends BaseLogic
51 }else{ 51 }else{
52 $api_no = $project['deploy_optimize']['api_no'] ?? 0; 52 $api_no = $project['deploy_optimize']['api_no'] ?? 0;
53 } 53 }
54 -  
55 $domain_info = (new DomainInfoLogic)->getDomainInfo($project_id); 54 $domain_info = (new DomainInfoLogic)->getDomainInfo($project_id);
56 $rank = RankData::where('project_id', $project_id)->where('api_no', $api_no)->first(); 55 $rank = RankData::where('project_id', $project_id)->where('api_no', $api_no)->first();
57 if(empty($rank) && ($project['deploy_optimize']['api_no'] != 0)){ 56 if(empty($rank) && ($project['deploy_optimize']['api_no'] != 0)){
@@ -11,6 +11,13 @@ namespace App\Models\Project; @@ -11,6 +11,13 @@ namespace App\Models\Project;
11 11
12 use App\Models\Base; 12 use App\Models\Base;
13 13
  14 +/**
  15 + * @remark :售后数据统计
  16 + * @name :After
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/4/17 9:26
  20 + */
14 class After extends Base 21 class After extends Base
15 { 22 {
16 protected $table = 'gl_project_after'; 23 protected $table = 'gl_project_after';
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :OptimizeCheckList.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/4/17 9:27
  8 + */
  9 +
  10 +namespace App\Models\Project;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :优化检查清单
  16 + * @name :OptimizeCheckList
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/4/17 9:27
  20 + */
  21 +class OptimizeCheckList extends Base
  22 +{
  23 + protected $table = 'gl_optimize_check_list';
  24 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :OptimizeCheckList.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/4/17 9:27
  8 + */
  9 +
  10 +namespace App\Models\Project;
  11 +
  12 +use App\Helper\Arr;
  13 +use App\Models\Base;
  14 +
  15 +/**
  16 + * @remark :优化检查日志
  17 + * @name :OptimizeCheckList
  18 + * @author :lyh
  19 + * @method :post
  20 + * @time :2025/4/17 9:27
  21 + */
  22 +class OptimizeCheckLog extends Base
  23 +{
  24 + protected $table = 'gl_optimize_check_log';
  25 +
  26 + /**
  27 + * @remark :获取器图片数据
  28 + * @name :getImagesAttribute
  29 + * @author :lyh
  30 + * @method :post
  31 + * @time :2025/4/17 10:26
  32 + */
  33 + public function getImagesAttribute($value){
  34 + return Arr::s2a($value);
  35 + }
  36 +
  37 + /**
  38 + * @remark :保存数据设置参数
  39 + * @name :handleParam
  40 + * @author :lyh
  41 + * @method :post
  42 + * @time :2025/4/17 10:35
  43 + */
  44 + public function saveHandleParam($param,$manage_id){
  45 + if(isset($param['images'])){
  46 + $param['images'] = Arr::a2s($param['images'] ?? []);
  47 + }
  48 + $this->param['operator_id'] = $manage_id;
  49 + $this->param['date'] = date('Y-m-d hH:i:s');
  50 + return $param;
  51 + }
  52 +}
@@ -283,6 +283,7 @@ Route::middleware(['bloginauth'])->group(function () { @@ -283,6 +283,7 @@ Route::middleware(['bloginauth'])->group(function () {
283 Route::any('/delProductType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delProductType'])->name('product_delProductType'); 283 Route::any('/delProductType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delProductType'])->name('product_delProductType');
284 Route::any('/getButton', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getButton'])->name('product_getButton'); 284 Route::any('/getButton', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getButton'])->name('product_getButton');
285 Route::any('/batchSetKeyword', [\App\Http\Controllers\Bside\Product\ProductController::class, 'batchSetKeyword'])->name('product_batchSetKeyword'); 285 Route::any('/batchSetKeyword', [\App\Http\Controllers\Bside\Product\ProductController::class, 'batchSetKeyword'])->name('product_batchSetKeyword');
  286 +
286 //产品分类batchSetKeyword 287 //产品分类batchSetKeyword
287 Route::get('category', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'index'])->name('product_category'); 288 Route::get('category', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'index'])->name('product_category');
288 Route::get('category/info', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'info'])->name('product_category_info'); 289 Route::get('category/info', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'info'])->name('product_category_info');
@@ -304,6 +305,7 @@ Route::middleware(['bloginauth'])->group(function () { @@ -304,6 +305,7 @@ Route::middleware(['bloginauth'])->group(function () {
304 Route::any('keyword/batchUpdateKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchUpdateKeyword'])->name('product_keyword_batchUpdateKeyword'); 305 Route::any('keyword/batchUpdateKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchUpdateKeyword'])->name('product_keyword_batchUpdateKeyword');
305 Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo'); 306 Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo');
306 Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled'); 307 Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled');
  308 + Route::any('keyword/delRelatedProductId', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelatedProductId'])->name('product_keyword_delRelatedProductId');
307 //产品参数 309 //产品参数
308 Route::get('attr', [\App\Http\Controllers\Bside\Product\AttrController::class, 'index'])->name('product_attr'); 310 Route::get('attr', [\App\Http\Controllers\Bside\Product\AttrController::class, 'index'])->name('product_attr');
309 Route::get('attr/info', [\App\Http\Controllers\Bside\Product\AttrController::class, 'info'])->name('product_attr_info'); 311 Route::get('attr/info', [\App\Http\Controllers\Bside\Product\AttrController::class, 'info'])->name('product_attr_info');