支付优化

feat/task1-c-wallet
devil_gong 2019-05-29 11:51:25 +08:00
parent 4c497f7acd
commit 0e087acaa0
4 changed files with 4 additions and 29 deletions

View File

@ -237,7 +237,7 @@ class Order extends Common
// 是否自定义状态 // 是否自定义状态
if(isset($params['appoint_status'])) if(isset($params['appoint_status']))
{ {
$ret = ($params['appoint_status'] == 1) ? DataReturn('支付成功', 0) : DataReturn('支付失败', -100); $ret = ($params['appoint_status'] == 0) ? DataReturn('支付成功', 0) : DataReturn('支付失败', -100);
// 获取支付回调数据 // 获取支付回调数据
} else { } else {

View File

@ -49,30 +49,5 @@ class Pay extends Controller
return $this->fetch('public/tips_error'); return $this->fetch('public/tips_error');
} }
} }
/**
* 支付提示
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-05-25T20:15:23+0800
* @param [array] $params [输入参数]
*/
public function Tips($params = [])
{
// 自定义链接
$this->assign('to_url', MyUrl('index/order/index'));
$this->assign('to_title', '我的订单');
// 状态
if(isset($params['status']) && $params['status'] == 0)
{
$this->assign('msg', '支付成功');
return $this->fetch('public/tips_success');
} else {
$this->assign('msg', '支付失败');
return $this->fetch('public/tips_error');
}
}
} }
?> ?>

View File

@ -99,7 +99,7 @@ class OrderService
]); ]);
if($pay_result['code'] == 0) if($pay_result['code'] == 0)
{ {
return DataReturn('支付成功', 0, ['data'=>MyUrl('index/order/respond', ['appoint_status'=>1])]); return DataReturn('支付成功', 0, ['data'=>MyUrl('index/order/respond', ['appoint_status'=>0])]);
} }
return $pay_result; return $pay_result;
} }

View File

@ -253,8 +253,8 @@ class Weixin
private function PayHtml($pay_data, $redirect_url) private function PayHtml($pay_data, $redirect_url)
{ {
// 支付跳转地址 // 支付跳转地址
$success_url = PluginsHomeUrl('weixinwebauthorization', 'pay', 'tips', ['status'=>0]); $success_url = MyUrl('index/order/respond', ['appoint_status'=>0]);
$error_url = PluginsHomeUrl('weixinwebauthorization', 'pay', 'tips', ['status'=>-1]); $error_url = MyUrl('index/order/respond', ['appoint_status'=>-1]);
// 支付代码 // 支付代码
exit('<html> exit('<html>