修改alipay地址
This commit is contained in:
57
app/order/controller/CashOutIndex.php
Normal file
57
app/order/controller/CashOutIndex.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2020-10-10 13:58:14
|
||||
* @LastEditTime: 2020-10-13 19:48:51
|
||||
* @LastEditors: kangkang
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: /phptest/app/order/controller/Index.php
|
||||
*/
|
||||
|
||||
namespace app\order\controller;
|
||||
|
||||
use app\order\model\CashOut as CashMoedl;
|
||||
use fastphp\base\Controller;
|
||||
|
||||
class CashOutIndex 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,]);
|
||||
}
|
||||
}
|
||||
|
||||
//获取记录
|
||||
public function getData()
|
||||
{
|
||||
$cash = new CashMoedl;
|
||||
$list = $cash->getListPage([],'username,money,apply_reason,alipay_account,status,create_time');
|
||||
//提现状态
|
||||
$status = ['待处理', '提现成功', '提现未成功'];
|
||||
foreach ($list as &$v) {
|
||||
$v['status'] = $status[$v['status']];
|
||||
$v['alipay_account'] = substr($v['alipay_account'], 0, 3) . '***' . substr($v['alipay_account'], -5);
|
||||
}
|
||||
$count = $cash->getCount();
|
||||
$data = [
|
||||
'Code' => 10000,
|
||||
'count' => $count['count'],
|
||||
'data' => $list,
|
||||
];
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user