作者 lyh

重写demo脚本

@@ -625,4 +625,21 @@ class ProductController extends BaseController @@ -625,4 +625,21 @@ class ProductController extends BaseController
625 $data = $logic->getSearchCategoryList(); 625 $data = $logic->getSearchCategoryList();
626 $this->response('success',Code::SUCCESS,$data); 626 $this->response('success',Code::SUCCESS,$data);
627 } 627 }
  628 +
  629 + /**
  630 + * @remark :清空所有的产品+关键词关联
  631 + * @name :delProductKeyword
  632 + * @author :lyh
  633 + * @method :post
  634 + * @time :2024/8/5 15:47
  635 + */
  636 + public function delProductKeyword(ProductLogic $logic){
  637 + $this->request->validate([
  638 + 'id'=>'required',
  639 + ],[
  640 + 'id.required' => 'id不为空',
  641 + ]);
  642 + $logic->delProductKeyword();
  643 + $this->response('success');
  644 + }
628 } 645 }
@@ -921,4 +921,16 @@ class ProductLogic extends BaseLogic @@ -921,4 +921,16 @@ class ProductLogic extends BaseLogic
921 } 921 }
922 return $this->success($data); 922 return $this->success($data);
923 } 923 }
  924 +
  925 + /**
  926 + * @remark :删除数据
  927 + * @name :delProductKeyword
  928 + * @author :lyh
  929 + * @method :post
  930 + * @time :2024/8/5 15:49
  931 + */
  932 + public function delProductKeyword(){
  933 + $this->model->edit(['keyword_id'=>null],['id'=>$this->param['id']]);
  934 + return $this->success(['id'=>$this->param['id']]);
  935 + }
924 } 936 }