dataLists(new RechargeTemplateLists()); } /** * @notes 充值 * @return \think\response\Json * @author Tab * @date 2021/8/11 10:44 */ public function recharge() { $params = $this->request->post(); $params['user_id'] = $this->userId; $params['terminal'] = $this->userInfo['terminal']; $result = RechargeLogic::recharge($params); if($result) { return $this->data($result); } return $this->fail(RechargeLogic::getError()); } /** * @notes 查看充值记录列表 * @return \think\response\Json * @author Tab * @date 2021/8/11 14:58 */ public function lists() { return $this->dataLists(); } public function giftCardExchange(){ if($this->request->isPost()) { $params = (new GiftCardValidate())->post()->goCheck('exchange'); $params['user_id'] = $this->userId; $result = (new RechargeLogic())->exchange($params); if($result == 'true'){ return $this->success('礼品卡兑换成功'); }else{ return $this->fail(RechargeLogic::getError()); } }else{ return $this->fail('请求方式错误'); } } }