支付宝接口

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,71 @@
<?php
namespace app\order\controller;
use app\order\model\CashOut as CashMoedl;
use fastphp\base\Controller;
use alipay\Alipay;
class Admin extends Controller
{
//获取记录
public function getData()
{
$cash = new CashMoedl;
$list = $cash->getListPage();
//提现状态
$status = ['待处理', '同意', '拒绝'];
foreach ($list as &$v) {
$v['status'] = $status[$v['status']];
$v['alipay_account'] = substr($v['alipay_account'], 0, 3) . '***' . substr($v['alipay_account'], -3);
}
$count = $cash->getCount();
$data = [
'Code' => 10000,
'count' => $count['count'],
'data' => $list,
];
echo json_encode($data);
}
//获取指定页码数据
public function pageList()
{
if (!$_GET) {
die;
}
$page = ($_GET['page'] - 1) * 50;
$cash = new CashMoedl;
$list = $cash->getListPage('*', 'id desc', "$page,50");
$data = [
'Code' => 10000,
'data' => $list,
];
echo json_encode($data);
}
//处理提现申请
public function handle()
{
$data = json_decode(file_get_contents("php://input"),true)['info'];
$id = $data['id'];
unset($data['update_time']);
unset($data['create_time']);
unset($data['id']);
$user = $this->userinfo;
$data['op_user'] = $user['LoginName'];
$status = ['0', '1', '2'];
if(!in_array($data['status'],$status)){
unset($data['status']);
}
$cash = new CashMoedl;
$up_status = $cash->where(['id'=>$id])->update($data);
$return_info = [
'Code' => 10000,
];
echo json_encode($return_info);
}
}