post()->goCheck('addGroup'); $result = GroupLogic::addGroup($params); if ($result === false) { return $this->fail(GroupLogic::getError()); } return $this->success('', $result, 1, 1); } /** * @return \think\response\Json * 编辑团购套餐 */ public function editGroup(){ $params = (new GroupValidate())->post()->goCheck('editGroup'); $result = GroupLogic::editGroup($params); if ($result === false) { return $this->fail(GroupLogic::getError()); } return $this->success('', $result, 1, 1); } /** * @return \think\response\Json * 套餐列表 */ public function groupLists(){ $params = (new GroupValidate())->post()->goCheck('groupLists'); $result = GroupLogic::groupLists($params); if ($result === false) { return $this->fail(GroupLogic::getError()); } return $this->success('', $result, 1, 1); } /** * @return \think\response\Json * 删除套餐 */ public function delGroup(){ $params = (new GroupValidate())->post()->goCheck('delGroup'); $result = GroupLogic::delGroup($params); if ($result === false) { return $this->fail(GroupLogic::getError()); } return $this->success('', $result, 1, 1); } /** * @return \think\response\Json * 上下架套餐 */ public function operateGroup(){ $params = (new GroupValidate())->post()->goCheck('operateGroup'); $result = GroupLogic::operateGroup($params); if ($result === false) { return $this->fail(GroupLogic::getError()); } return $this->success('', $result, 1, 1); } /** * @return \think\response\Json * 套餐详情页 */ public function groupDetails(){ $params = (new GroupValidate())->post()->goCheck('groupDetails'); $result = GroupLogic::groupDetails($params); if ($result === false) { return $this->fail(GroupLogic::getError()); } return $this->success('', $result, 1, 1); } /** * @return \think\response\Json * 门店核销券码 */ public function cancelCode(){ $params = (new GroupValidate())->post()->goCheck('cancelCode'); $params['user_id'] = $this->userId; $result = GroupLogic::cancelCode($params); if ($result === false) { return $this->fail(GroupLogic::getError()); } return $this->success('', $result, 1, 1); } }