request->params([ ['label_name', ''], ]); return success((new MemberLabelService())->getPage($data)); } /** * 会员标签详情 * @param int $id * @return Response */ public function info(int $id) { return success((new MemberLabelService())->getInfo($id)); } /** * 添加会员标签 * @return Response */ public function add() { $data = $this->request->params([ ['label_name', ''], ['memo', ''], ['sort', 0], ]); $this->validate($data, 'app\validate\member\MemberLabel.add'); $id = (new MemberLabelService())->add($data); return success('ADD_SUCCESS', ['label_id' => $id]); } /** * 菜单或接口更新 */ public function edit($id) { $data = $this->request->params([ ['label_name', ''], ['memo', ''], ['sort', 0], ]); $this->validate($data, 'app\validate\member\MemberLabel.edit'); (new MemberLabelService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 会员标签删除 * @param int $id * @return Response */ public function del(int $id) { (new MemberLabelService())->del($id); return success('DELETE_SUCCESS'); } /** * 获取标签 * @return Response * @throws DataNotFoundException * @throws DbException * @throws ModelNotFoundException */ public function getAll() { return success((new MemberLabelService())->getAll()); } }