支付宝接口
This commit is contained in:
71
app/order/controller/Admin.php
Normal file
71
app/order/controller/Admin.php
Normal 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user