Merge remote-tracking branch 'origin/master' into akun
正在显示
9 个修改的文件
包含
67 行增加
和
55 行删除
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * @remark : | ||
| 4 | - * @name :UpdateHeartbeat.php | ||
| 5 | - * @author :lyh | ||
| 6 | - * @method :post | ||
| 7 | - * @time :2024/8/28 15:13 | ||
| 8 | - */ | ||
| 9 | - | ||
| 10 | -namespace App\Console\Commands\Update; | ||
| 11 | - | ||
| 12 | -use App\Models\Log\OperationHeartbeat; | ||
| 13 | -use Illuminate\Console\Command; | ||
| 14 | - | ||
| 15 | - | ||
| 16 | -class UpdateHeartbeat extends Command | ||
| 17 | -{ | ||
| 18 | - /** | ||
| 19 | - * The name and signature of the console command. | ||
| 20 | - * | ||
| 21 | - * @var string | ||
| 22 | - */ | ||
| 23 | - protected $signature = 'operation_heartbeat'; | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * The console command description. | ||
| 27 | - * | ||
| 28 | - * @var string | ||
| 29 | - */ | ||
| 30 | - protected $description = '心跳半小时未操作更新为未操作'; | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - /** | ||
| 34 | - * @remark :更新半小时未操作的界面 | ||
| 35 | - * @name :handle | ||
| 36 | - * @author :lyh | ||
| 37 | - * @method :post | ||
| 38 | - * @time :2024/8/28 15:25 | ||
| 39 | - */ | ||
| 40 | - public function handle(){ | ||
| 41 | - $date = date('Y-m-d H:i:s',time() - 10 * 60); | ||
| 42 | - $operationHeartbeatModel = new OperationHeartbeat(); | ||
| 43 | - $operationHeartbeatModel->edit(['status'=>0],['updated_at'=>['<=',$date]]); | ||
| 44 | - echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | ||
| 45 | - return true; | ||
| 46 | - } | ||
| 47 | -} |
| @@ -75,9 +75,15 @@ class OperationHeartbeatController extends BaseController | @@ -75,9 +75,15 @@ class OperationHeartbeatController extends BaseController | ||
| 75 | $condition = ['project_id'=>$this->user['project_id'],'source'=>$this->param['source'],'source_id'=>$this->param['source_id'], | 75 | $condition = ['project_id'=>$this->user['project_id'],'source'=>$this->param['source'],'source_id'=>$this->param['source_id'], |
| 76 | 'is_list'=>$this->param['is_list'],'is_custom'=>$this->param['is_custom'],'is_template'=>$this->param['is_template']]; | 76 | 'is_list'=>$this->param['is_list'],'is_custom'=>$this->param['is_custom'],'is_template'=>$this->param['is_template']]; |
| 77 | $operationHeartbeatModel = new OperationHeartbeat(); | 77 | $operationHeartbeatModel = new OperationHeartbeat(); |
| 78 | - $info = $operationHeartbeatModel->read($condition,['id','status']); | 78 | + $info = $operationHeartbeatModel->read($condition,['id','status','updated_at']); |
| 79 | if($info === false){ | 79 | if($info === false){ |
| 80 | $info = []; | 80 | $info = []; |
| 81 | + }else{ | ||
| 82 | + $date_time = strtotime($info['updated_at']) + 7200; | ||
| 83 | + if($date_time < time()){ | ||
| 84 | + $operationHeartbeatModel->edit(['status'=>0],$condition); | ||
| 85 | + $info['status'] = 0; | ||
| 86 | + } | ||
| 81 | } | 87 | } |
| 82 | $this->response('success',Code::SUCCESS,$info); | 88 | $this->response('success',Code::SUCCESS,$info); |
| 83 | } | 89 | } |
| @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Keyword; | @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Keyword; | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Http\Controllers\Bside\BaseController; | 13 | use App\Http\Controllers\Bside\BaseController; |
| 14 | use App\Models\Project\DeployOptimize; | 14 | use App\Models\Project\DeployOptimize; |
| 15 | +use App\Models\Project\MinorLanguages; | ||
| 15 | use App\Models\Project\ProjectKeyword; | 16 | use App\Models\Project\ProjectKeyword; |
| 16 | 17 | ||
| 17 | class ProjectKeywordController extends BaseController | 18 | class ProjectKeywordController extends BaseController |
| @@ -35,11 +36,23 @@ class ProjectKeywordController extends BaseController | @@ -35,11 +36,23 @@ class ProjectKeywordController extends BaseController | ||
| 35 | if($keywordInfo === false){ | 36 | if($keywordInfo === false){ |
| 36 | $data['search_keywords'] = ''; | 37 | $data['search_keywords'] = ''; |
| 37 | $data['customer_keywords'] = ''; | 38 | $data['customer_keywords'] = ''; |
| 38 | - $this->response('success',Code::SUCCESS,$data); | 39 | + }else{ |
| 40 | + $data['search_keywords'] = $keywordInfo['search_keywords']; | ||
| 41 | + $data['customer_keywords'] = $keywordInfo['customer_keywords']; | ||
| 39 | } | 42 | } |
| 40 | - $data['search_keywords'] = $keywordInfo['search_keywords']; | ||
| 41 | - $data['customer_keywords'] = $keywordInfo['customer_keywords']; | ||
| 42 | $this->response('success',Code::SUCCESS,$data); | 43 | $this->response('success',Code::SUCCESS,$data); |
| 43 | } | 44 | } |
| 44 | 45 | ||
| 46 | + /** | ||
| 47 | + * @remark :获取小语种关键词 | ||
| 48 | + * @name :minorKeyword | ||
| 49 | + * @author :lyh | ||
| 50 | + * @method :post | ||
| 51 | + * @time :2024/9/20 17:49 | ||
| 52 | + */ | ||
| 53 | + public function minorKeyword(){ | ||
| 54 | + $minorLanguageModel = new MinorLanguages(); | ||
| 55 | + $data = $minorLanguageModel->list(['project_id'=>$this->user['project_id']]); | ||
| 56 | + $this->response('success',Code::SUCCESS,$data); | ||
| 57 | + } | ||
| 45 | } | 58 | } |
| @@ -774,4 +774,23 @@ class ProductController extends BaseController | @@ -774,4 +774,23 @@ class ProductController extends BaseController | ||
| 774 | ]; | 774 | ]; |
| 775 | $this->response('success',Code::SUCCESS,$data); | 775 | $this->response('success',Code::SUCCESS,$data); |
| 776 | } | 776 | } |
| 777 | + | ||
| 778 | + /** | ||
| 779 | + * @remark :批量设置产品 | ||
| 780 | + * @name :batchSetKeyword | ||
| 781 | + * @author :lyh | ||
| 782 | + * @method :post | ||
| 783 | + * @time :2024/9/20 16:46 | ||
| 784 | + */ | ||
| 785 | + public function batchSetKeyword(ProductLogic $logic){ | ||
| 786 | + $this->request->validate([ | ||
| 787 | + 'id'=>'required|array', | ||
| 788 | + 'keyword_id'=>'required|array', | ||
| 789 | + ],[ | ||
| 790 | + 'id.required' => '产品ID不能为空', | ||
| 791 | + 'category_id.required' => '关键词ID不能为空', | ||
| 792 | + ]); | ||
| 793 | + $logic->batchSetKeyword(); | ||
| 794 | + $this->response('success'); | ||
| 795 | + } | ||
| 777 | } | 796 | } |
| @@ -488,7 +488,6 @@ class ProjectLogic extends BaseLogic | @@ -488,7 +488,6 @@ class ProjectLogic extends BaseLogic | ||
| 488 | * @date 2024/1/19 | 488 | * @date 2024/1/19 |
| 489 | */ | 489 | */ |
| 490 | public function saveInquiryFilterConfig($config){ | 490 | public function saveInquiryFilterConfig($config){ |
| 491 | -// | ||
| 492 | $config['filter_countries'] = !empty($config['filter_countries']) ? Arr::lineToArray($config['filter_countries']) : json_encode([]); | 491 | $config['filter_countries'] = !empty($config['filter_countries']) ? Arr::lineToArray($config['filter_countries']) : json_encode([]); |
| 493 | $config['filter_contents'] = !empty($config['filter_contents']) ? Arr::lineToArray($config['filter_contents']) : json_encode([]); | 492 | $config['filter_contents'] = !empty($config['filter_contents']) ? Arr::lineToArray($config['filter_contents']) : json_encode([]); |
| 494 | $config['filter_referers'] = !empty($config['filter_referers']) ? Arr::lineToArray($config['filter_referers']) : json_encode([]); | 493 | $config['filter_referers'] = !empty($config['filter_referers']) ? Arr::lineToArray($config['filter_referers']) : json_encode([]); |
| @@ -496,7 +495,6 @@ class ProjectLogic extends BaseLogic | @@ -496,7 +495,6 @@ class ProjectLogic extends BaseLogic | ||
| 496 | $config['filter_mobiles'] = !empty($config['filter_mobiles']) ? Arr::lineToArray($config['filter_mobiles']) : json_encode([]); | 495 | $config['filter_mobiles'] = !empty($config['filter_mobiles']) ? Arr::lineToArray($config['filter_mobiles']) : json_encode([]); |
| 497 | $config['filter_names'] = !empty($config['filter_names']) ? Arr::lineToArray($config['filter_names']) : json_encode([]); | 496 | $config['filter_names'] = !empty($config['filter_names']) ? Arr::lineToArray($config['filter_names']) : json_encode([]); |
| 498 | $config['black_ips'] = !empty($config['black_ips']) ? Arr::lineToArray($config['black_ips']) : json_encode([]); | 497 | $config['black_ips'] = !empty($config['black_ips']) ? Arr::lineToArray($config['black_ips']) : json_encode([]); |
| 499 | - | ||
| 500 | $InquiryFilterConfigModel = new InquiryFilterConfig(); | 498 | $InquiryFilterConfigModel = new InquiryFilterConfig(); |
| 501 | $info = $InquiryFilterConfigModel->read(['project_id'=>$config['project_id']]); | 499 | $info = $InquiryFilterConfigModel->read(['project_id'=>$config['project_id']]); |
| 502 | if($info === false){ | 500 | if($info === false){ |
| @@ -937,4 +937,17 @@ class ProductLogic extends BaseLogic | @@ -937,4 +937,17 @@ class ProductLogic extends BaseLogic | ||
| 937 | $this->model->edit(['keyword_id'=>null],['id'=>$this->param['id']]); | 937 | $this->model->edit(['keyword_id'=>null],['id'=>$this->param['id']]); |
| 938 | return $this->success(['id'=>$this->param['id']]); | 938 | return $this->success(['id'=>$this->param['id']]); |
| 939 | } | 939 | } |
| 940 | + | ||
| 941 | + /** | ||
| 942 | + * @remark :批量设置产品关键词 | ||
| 943 | + * @name :batchSetKeyword | ||
| 944 | + * @author :lyh | ||
| 945 | + * @method :post | ||
| 946 | + * @time :2024/9/20 16:48 | ||
| 947 | + */ | ||
| 948 | + public function batchSetKeyword(){ | ||
| 949 | + $this->param['keyword_id'] = ','.implode(',',$this->param['keyword_id']).','; | ||
| 950 | + $this->edit(['keyword_id'=>$this->param['keyword_id']],['id'=>['in',$this->param['id']]]); | ||
| 951 | + return $this->success(); | ||
| 952 | + } | ||
| 940 | } | 953 | } |
| @@ -50,6 +50,15 @@ class SyncSubmitTaskService | @@ -50,6 +50,15 @@ class SyncSubmitTaskService | ||
| 50 | return false; | 50 | return false; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | + //过滤url参数 清除全部参数 | ||
| 54 | + if($project['id'] == 1442 && !empty($data['data']['url'])){ | ||
| 55 | + $query = parse_url($data['data']['url'], PHP_URL_QUERY); | ||
| 56 | + if($query){ | ||
| 57 | + $data['data']['url'] = str_replace('?'.$query, '', $data['data']['url']); | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + | ||
| 53 | if(!ProjectServer::useProject($project['id'])){ | 62 | if(!ProjectServer::useProject($project['id'])){ |
| 54 | return false; | 63 | return false; |
| 55 | } | 64 | } |
| @@ -262,7 +262,8 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -262,7 +262,8 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 262 | Route::any('/saveType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'saveType'])->name('product_saveType'); | 262 | Route::any('/saveType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'saveType'])->name('product_saveType'); |
| 263 | Route::any('/delProductType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delProductType'])->name('product_delProductType'); | 263 | Route::any('/delProductType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delProductType'])->name('product_delProductType'); |
| 264 | Route::any('/getButton', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getButton'])->name('product_getButton'); | 264 | Route::any('/getButton', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getButton'])->name('product_getButton'); |
| 265 | - //产品分类 | 265 | + Route::any('/batchSetKeyword', [\App\Http\Controllers\Bside\Product\ProductController::class, 'batchSetKeyword'])->name('product_batchSetKeyword'); |
| 266 | + //产品分类batchSetKeyword | ||
| 266 | Route::get('category', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'index'])->name('product_category'); | 267 | Route::get('category', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'index'])->name('product_category'); |
| 267 | Route::get('category/info', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'info'])->name('product_category_info'); | 268 | Route::get('category/info', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'info'])->name('product_category_info'); |
| 268 | Route::any('category/categoryTopList', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'categoryTopList'])->name('product_category_categoryTopList'); | 269 | Route::any('category/categoryTopList', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'categoryTopList'])->name('product_category_categoryTopList'); |
| @@ -506,6 +507,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -506,6 +507,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 506 | //优化关键词,检索关键词 | 507 | //优化关键词,检索关键词 |
| 507 | Route::prefix('project_keyword')->group(function () { | 508 | Route::prefix('project_keyword')->group(function () { |
| 508 | Route::any('/', [\App\Http\Controllers\Bside\Keyword\ProjectKeywordController::class, 'searchKeywords'])->name('searchKeywords'); | 509 | Route::any('/', [\App\Http\Controllers\Bside\Keyword\ProjectKeywordController::class, 'searchKeywords'])->name('searchKeywords'); |
| 510 | + Route::any('/minorKeyword', [\App\Http\Controllers\Bside\Keyword\ProjectKeywordController::class, 'minorKeyword'])->name('searchKeywords'); | ||
| 509 | }); | 511 | }); |
| 510 | //自定义模板 | 512 | //自定义模板 |
| 511 | Route::prefix('custom_module')->group(function () { | 513 | Route::prefix('custom_module')->group(function () { |
-
请 注册 或 登录 后发表评论