作者 lyh

gx小语种监控

@@ -32,6 +32,7 @@ class ManagerLogController extends BaseController @@ -32,6 +32,7 @@ class ManagerLogController extends BaseController
32 if(isset($this->map['name']) && !empty($this->map['name'])){ 32 if(isset($this->map['name']) && !empty($this->map['name'])){
33 $ids = $managerModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray(); 33 $ids = $managerModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray();
34 $this->map['manage_id'] = ['in',$ids]; 34 $this->map['manage_id'] = ['in',$ids];
  35 + unset($this->map['name']);
35 } 36 }
36 if(isset($this->map['url']) && !empty($this->map['url'])){ 37 if(isset($this->map['url']) && !empty($this->map['url'])){
37 $this->map['url'] = ['like','%'.$this->map['url'].'%']; 38 $this->map['url'] = ['like','%'.$this->map['url'].'%'];
@@ -61,6 +62,7 @@ class ManagerLogController extends BaseController @@ -61,6 +62,7 @@ class ManagerLogController extends BaseController
61 if(isset($this->map['name']) && !empty($this->map['name'])){ 62 if(isset($this->map['name']) && !empty($this->map['name'])){
62 $ids = $userModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray(); 63 $ids = $userModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray();
63 $this->map['operator_id'] = ['in',$ids]; 64 $this->map['operator_id'] = ['in',$ids];
  65 + unset($this->map['name']);
64 } 66 }
65 if(isset($this->map['model']) && !empty($this->map['model'])){ 67 if(isset($this->map['model']) && !empty($this->map['model'])){
66 $this->map['model'] = ['like','%'.$this->map['model'].'%']; 68 $this->map['model'] = ['like','%'.$this->map['model'].'%'];
@@ -279,4 +279,16 @@ class KeywordController extends BaseController @@ -279,4 +279,16 @@ class KeywordController extends BaseController
279 $logic->delRelated($this->param['keyword_id'],$this->param['product_id']); 279 $logic->delRelated($this->param['keyword_id'],$this->param['product_id']);
280 $this->response('success'); 280 $this->response('success');
281 } 281 }
  282 +
  283 + /**
  284 + * @remark :清除当前项目所有关键字
  285 + * @name :delAllKeyword
  286 + * @author :lyh
  287 + * @method :post
  288 + * @time :2024/12/5 16:34
  289 + */
  290 + public function delAllKeyword(KeywordLogic $logic){
  291 + $logic->delAllKeyword();
  292 + $this->response('success');
  293 + }
282 } 294 }
@@ -336,4 +336,31 @@ class KeywordLogic extends BaseLogic @@ -336,4 +336,31 @@ class KeywordLogic extends BaseLogic
336 return $this->success(); 336 return $this->success();
337 } 337 }
338 338
  339 + /**
  340 + * @remark :删除所有的关键字
  341 + * @name :delAllKeyword
  342 + * @author :lyh
  343 + * @method :post
  344 + * @time :2024/12/5 15:37
  345 + */
  346 + public function delAllKeyword(){
  347 + DB::beginTransaction();
  348 + try {
  349 + //截断关联表
  350 + KeywordRelated::truncate();
  351 + //截断关键词表
  352 + Keyword::truncate();
  353 + //清空产品表的keyword_id字段
  354 + $routeMapModel = new RouteMap();
  355 + $routeMapModel->del(['source'=>'product_keyword']);
  356 + $productModel = new Product();
  357 + $productModel->edit(['keyword_id'=>''],['id'=>['>',0]]);
  358 + DB::commit();
  359 + }catch (\Exception $e){
  360 + DB::rollBack();
  361 + $this->fail('操作失败,请联系管理员');
  362 + }
  363 + return $this->success();
  364 + }
  365 +
339 } 366 }
@@ -282,6 +282,7 @@ Route::middleware(['bloginauth'])->group(function () { @@ -282,6 +282,7 @@ Route::middleware(['bloginauth'])->group(function () {
282 Route::post('keyword/batchDel', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchDel'])->name('product_keyword_batchDel'); 282 Route::post('keyword/batchDel', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchDel'])->name('product_keyword_batchDel');
283 Route::any('keyword/delete', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delete'])->name('product_keyword_delete'); 283 Route::any('keyword/delete', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delete'])->name('product_keyword_delete');
284 Route::any('keyword/delRelated', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelated'])->name('product_keyword_delRelated'); 284 Route::any('keyword/delRelated', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelated'])->name('product_keyword_delRelated');
  285 + Route::any('keyword/delAllKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delAllKeyword'])->name('product_keyword_delAllKeyword');
285 Route::any('keyword/batchUpdateKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchUpdateKeyword'])->name('product_keyword_batchUpdateKeyword'); 286 Route::any('keyword/batchUpdateKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchUpdateKeyword'])->name('product_keyword_batchUpdateKeyword');
286 Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo'); 287 Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo');
287 Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled'); 288 Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled');