30 lines
788 B
PHP
30 lines
788 B
PHP
<?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,]);
|
|
}
|
|
}
|
|
|
|
}
|