post()->goCheck('getMobileByMnp'); $params['user_id'] = $this->userId; $result = UserLogic::getMobileByMnp($params); if ($result === false) { return $this->fail(UserLogic::getError()); } $data = UserLogic::info($this->userId); return $this->success('绑定成功', $data, 1, 1); } #[ ApiDoc\Title('用户个人信息'), ApiDoc\url('/api/user/user/info'), ApiDoc\Method('POST'), ApiDoc\Param(), ApiDoc\NotHeaders(), ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), ApiDoc\ResponseSuccess("data", type: "array"), ] public function info() { return $this->success('success', UserLogic::info($this->userId)); } #[ ApiDoc\Title('小程序充值'), ApiDoc\url('/api/user/user/recharge'), ApiDoc\Method('POST'), ApiDoc\Param(name: "price", type: "string", require: true, desc: "金额"), ApiDoc\NotHeaders(), ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), ApiDoc\ResponseSuccess("data", type: "array"), ] public function recharge() { $params = (new UserValidate())->post()->goCheck('rechargeMoney'); $params['uid'] = $this->userId; $params['channel_type'] = $this->userInfo['terminal']; $order = UserLogic::recharge($params); $redirectUrl = $params['redirect'] ?? '/pages/payment/payment'; $result = PaymentLogic::pay(PayEnum::WECHAT_PAY, 'StoreOrder', $order, $this->userInfo['terminal'], $redirectUrl); if (PaymentLogic::hasError()) { return $this->fail(PaymentLogic::getError(), $params); } return $this->success('', $result); } }