作者 lyh

gx小语种监控

... ... @@ -32,6 +32,7 @@ class ManagerLogController extends BaseController
if(isset($this->map['name']) && !empty($this->map['name'])){
$ids = $managerModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray();
$this->map['manage_id'] = ['in',$ids];
unset($this->map['name']);
}
if(isset($this->map['url']) && !empty($this->map['url'])){
$this->map['url'] = ['like','%'.$this->map['url'].'%'];
... ... @@ -61,6 +62,7 @@ class ManagerLogController extends BaseController
if(isset($this->map['name']) && !empty($this->map['name'])){
$ids = $userModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray();
$this->map['operator_id'] = ['in',$ids];
unset($this->map['name']);
}
if(isset($this->map['model']) && !empty($this->map['model'])){
$this->map['model'] = ['like','%'.$this->map['model'].'%'];
... ...
... ... @@ -279,4 +279,16 @@ class KeywordController extends BaseController
$logic->delRelated($this->param['keyword_id'],$this->param['product_id']);
$this->response('success');
}
/**
* @remark :清除当前项目所有关键字
* @name :delAllKeyword
* @author :lyh
* @method :post
* @time :2024/12/5 16:34
*/
public function delAllKeyword(KeywordLogic $logic){
$logic->delAllKeyword();
$this->response('success');
}
}
... ...
... ... @@ -336,4 +336,31 @@ class KeywordLogic extends BaseLogic
return $this->success();
}
/**
* @remark :删除所有的关键字
* @name :delAllKeyword
* @author :lyh
* @method :post
* @time :2024/12/5 15:37
*/
public function delAllKeyword(){
DB::beginTransaction();
try {
//截断关联表
KeywordRelated::truncate();
//截断关键词表
Keyword::truncate();
//清空产品表的keyword_id字段
$routeMapModel = new RouteMap();
$routeMapModel->del(['source'=>'product_keyword']);
$productModel = new Product();
$productModel->edit(['keyword_id'=>''],['id'=>['>',0]]);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('操作失败,请联系管理员');
}
return $this->success();
}
}
... ...
... ... @@ -282,6 +282,7 @@ Route::middleware(['bloginauth'])->group(function () {
Route::post('keyword/batchDel', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchDel'])->name('product_keyword_batchDel');
Route::any('keyword/delete', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delete'])->name('product_keyword_delete');
Route::any('keyword/delRelated', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelated'])->name('product_keyword_delRelated');
Route::any('keyword/delAllKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delAllKeyword'])->name('product_keyword_delAllKeyword');
Route::any('keyword/batchUpdateKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchUpdateKeyword'])->name('product_keyword_batchUpdateKeyword');
Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo');
Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled');
... ...