支付宝接口

This commit is contained in:
wanyongkang
2020-10-11 19:23:42 +08:00
parent ce067b91dc
commit 517b026891
1110 changed files with 139880 additions and 95 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace app\order\controller;
use app\order\model\CashOut as CashMoedl;
use fastphp\base\Controller;
class Index extends Controller
{
//接收提现请求
public function index()
{
$post = json_decode(file_get_contents("php://input"), true);
$data = [];
$data['userid'] = $this->userinfo['UserId'];
$data['username'] = $this->userinfo['LoginName'];
$data['money'] = $post['cash_out_money'];
$data['apply_reason'] = $post['reason'];
$data['alipay_account'] = $post['alipay_account'];
$cash = new CashMoedl;
$status = $cash->add($data);
if ($status) {
echo json_encode(['Code'=>10000,]);
} else {
echo json_encode(['Code'=>-10000,]);
}
}
}