dataLists(new GoodsLists()); } /** * @notes 添加商品列表 * @return \think\response\Json * @author likeadmin * @date 2024/04/23 11:28 */ public function add() { $params = (new GoodsValidate())->post()->goCheck('add'); $result = GoodsLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(GoodsLogic::getError()); } /** * @notes 编辑商品列表 * @return \think\response\Json * @author likeadmin * @date 2024/04/23 11:28 */ public function edit() { $params = (new GoodsValidate())->post()->goCheck('edit'); $result = GoodsLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(GoodsLogic::getError()); } /** * @notes 删除商品列表 * @return \think\response\Json * @author likeadmin * @date 2024/04/23 11:28 */ public function delete() { $params = (new GoodsValidate())->post()->goCheck('delete'); GoodsLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取商品列表详情 * @return \think\response\Json * @author likeadmin * @date 2024/04/23 11:28 */ public function detail() { $params = (new GoodsValidate())->goCheck('detail'); $result = GoodsLogic::detail($params); return $this->data($result); } public function setLabel(){ $params=$this->request->post(); $result = GoodsLogic::setLabel($params); if (true === $result) { return $this->success('设置成功', [], 1, 1); } return $this->fail(GoodsLogic::getError()); } }