request->get(); $params['user_id'] = $this->userId; $result = MallLogic::index($params); return $this->data($result); } /** * @notes 兑换 * @return \think\response\Json * @author BD * @date 2024/02/22 10:54 */ public function buy() { $params = (new MallValidate())->post()->goCheck('buy', [ 'user_id' => $this->userId, ]); $result = MallLogic::buy($params); if (false === $result) { return $this->fail(MallLogic::getError()); } return $this->data($result); } /** * @notes 抽奖数据 * @return Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author BD * @date 2024/02/22 10:54 */ public function drawIndex() { $params = $this->request->get(); $params['user_id'] = $this->userId; $result = MallLogic::drawIndex($params); return $this->data($result); } /** * @notes 抽奖 * @return \think\response\Json * @author BD * @date 2024/02/22 10:54 */ public function draw() { $params = (new MallValidate())->post()->goCheck('draw', [ 'user_id' => $this->userId, ]); $result = MallLogic::draw($params); if (false === $result) { return $this->fail(MallLogic::getError()); } return $this->data($result); } /** * @notes 抽奖记录 * @return \think\response\Json * @author BD * @date 2024/02/22 10:54 */ public function drawLists() { return $this->dataLists(new MallGoodsRecordLists()); } }