1.提交缺失的东西
This commit is contained in:
@ -40,7 +40,7 @@ class PaymentController extends BaseApiController
|
|||||||
{
|
{
|
||||||
|
|
||||||
public array $notNeedLogin = ['aliNotify', 'notifyMnp', 'notifyOa', 'notifyApp'];
|
public array $notNeedLogin = ['aliNotify', 'notifyMnp', 'notifyOa', 'notifyApp'];
|
||||||
|
private $client;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -201,7 +201,7 @@ class PaymentController extends BaseApiController
|
|||||||
{
|
{
|
||||||
$params = $this->request->get();
|
$params = $this->request->get();
|
||||||
if(!isset($params['from']) || !isset($params['order_id'])) {
|
if(!isset($params['from']) || !isset($params['order_id'])) {
|
||||||
return $this->_error('参数缺失');
|
return $this->fail('参数缺失');
|
||||||
}
|
}
|
||||||
if($params['from'] == 'order') {
|
if($params['from'] == 'order') {
|
||||||
$order = Db::name('order')->where('id', $params['order_id'])->find();
|
$order = Db::name('order')->where('id', $params['order_id'])->find();
|
||||||
@ -209,24 +209,24 @@ class PaymentController extends BaseApiController
|
|||||||
$order = Db::name('recharge_order')->where('id', $params['order_id'])->find();
|
$order = Db::name('recharge_order')->where('id', $params['order_id'])->find();
|
||||||
}
|
}
|
||||||
|
|
||||||
$payModel = new Pay();
|
$payModel = new pay\Pay();
|
||||||
$pay = $payModel->where(['status' => 1])->order('sort')->hidden(['config'])->select()->toArray();
|
$pay = $payModel->where(['status' => 1])->order('sort')->hidden(['config'])->select()->toArray();
|
||||||
|
|
||||||
foreach ($pay as $k => &$item) {
|
foreach ($pay as $k => &$item) {
|
||||||
if ($item['code'] == 'wechat') {
|
if ($item['code'] == 'wechat') {
|
||||||
$item['extra'] = '微信快捷支付';
|
$item['extra'] = '微信快捷支付';
|
||||||
$item['pay_way'] = Pay::WECHAT_PAY;
|
$item['pay_way'] = pay\Pay::WECHAT_PAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item['code'] == 'balance') {
|
if ($item['code'] == 'balance') {
|
||||||
$user_money = Db::name('user')->where(['id' => $this->user_id])->value('user_money');
|
$user_money = Db::name('user')->where(['id' => $this->userId])->value('user_money');
|
||||||
$item['extra'] = '可用余额:'.$user_money;
|
$item['extra'] = '可用余额:'.$user_money;
|
||||||
$item['pay_way'] = Pay::BALANCE_PAY;
|
$item['pay_way'] = pay\Pay::BALANCE_PAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item['code'] == 'alipay') {
|
if ($item['code'] == 'alipay') {
|
||||||
$item['extra'] = '';
|
$item['extra'] = '';
|
||||||
$item['pay_way'] = Pay::ALI_PAY;
|
$item['pay_way'] = pay\Pay::ALI_PAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($this->client, [Client_::mnp, Client_::oa]) && $item['code'] == 'alipay') {
|
if (in_array($this->client, [Client_::mnp, Client_::oa]) && $item['code'] == 'alipay') {
|
||||||
@ -251,7 +251,7 @@ class PaymentController extends BaseApiController
|
|||||||
'order_amount' => $order['order_amount'],
|
'order_amount' => $order['order_amount'],
|
||||||
'cancel_time' => $cancelTime,
|
'cancel_time' => $cancelTime,
|
||||||
];
|
];
|
||||||
$this->_success('', $data);
|
return $this->success('', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user