diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 407f67f..7c8afab 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -15,7 +15,7 @@ use app\admin\model\order\Detail; use app\admin\model\Warehouse; use EasyWeChat\Factory; use think\Db; - +use app\admin\model\user\Recharge; /** * 会员接口 @@ -681,8 +681,23 @@ class User extends Api Db::name('income_expend')->where("id", $id)->update(['status' => 2, "updatetime" => time()]); $this->success("succ"); } - - + /** + * 充值 + * [recharge description] + * @return [type] [description] + */ + public function recharge(){ + $user = $this->auth->getUserinfo(); + $method = $this->request->post("method", "wechat"); + $amount = $this->request->post("amount", 0); + $inData = [ + "user_id" => $user['id'], + "method" => $method, + "amount" => $amount, + ]; + Recharge::create($inData); + $this->success("succ"); + }