lqmac 1 year ago
parent 0a04a930e8
commit 42754f079f
  1. 21
      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");
}

Loading…
Cancel
Save