作者 anyv
1 个管道 的构建 通过 耗费 0 秒

54

... ... @@ -157,6 +157,20 @@ class OrderpageController extends WeChatBaseController{
}
/**
* 取消支付时
*/
public function cancel_pay(){
$indent_id = $this -> request -> param();
$data = Db::name('indent') -> where('id',$indent_id['id']) -> find();
$money_ratio = Db::name('money_ratio') -> where('id',1) -> find();
if($data['indent_type'] == 2 && $data['is_courier'] == 2){
Db::name('indent') -> where('id',$indent_id['id']) -> setDec('money',$money_ratio['courier']);
}
$this -> redirect('index/index');
}
... ...
... ... @@ -66,6 +66,7 @@ class PayController extends HomeBaseController
$this->assign('name','北京煊坤博文图书有限公司');
$this->assign('price',$data['money']);
$this->assign('order_number',$data['order_number']);
$this->assign('indent_id',$data['id']);
$this->assign('jsApiParameters',json_encode($jsApiParameters));
return $this->fetch();
}else{
... ... @@ -241,11 +242,6 @@ class PayController extends HomeBaseController
}
}else{
cache('a','33333');
if($order['indent_type'] == 2 && $order['is_courier'] == 2){
cache('a','33333');
}
}
return true; // 返回处理完成
... ...
... ... @@ -17,6 +17,7 @@
alert(res.err_code+res.err_desc+res.err_msg);
if (res.err_msg=='get_brand_wcpay_request:cancel'){
//支付取消逻辑
window.location.href = "{:url('Orderpage/cancel_pay',array('id'=>$indent_id))}";
}else if (res.err_msg=='get_brand_wcpay_request:ok'){
//支付成功逻辑
window.location.href = "{:url('index/index')}";
... ...