作者 lyh

重写demo脚本

... ... @@ -625,4 +625,21 @@ class ProductController extends BaseController
$data = $logic->getSearchCategoryList();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :清空所有的产品+关键词关联
* @name :delProductKeyword
* @author :lyh
* @method :post
* @time :2024/8/5 15:47
*/
public function delProductKeyword(ProductLogic $logic){
$this->request->validate([
'id'=>'required',
],[
'id.required' => 'id不为空',
]);
$logic->delProductKeyword();
$this->response('success');
}
}
... ...
... ... @@ -921,4 +921,16 @@ class ProductLogic extends BaseLogic
}
return $this->success($data);
}
/**
* @remark :删除数据
* @name :delProductKeyword
* @author :lyh
* @method :post
* @time :2024/8/5 15:49
*/
public function delProductKeyword(){
$this->model->edit(['keyword_id'=>null],['id'=>$this->param['id']]);
return $this->success(['id'=>$this->param['id']]);
}
}
... ...