Authored by cailing

h5订单取消时增加间隔检查

@@ -443,5 +443,23 @@ class CartData @@ -443,5 +443,23 @@ class CartData
443 443
444 return Yohobuy::get(Yohobuy::API_URL, $param); 444 return Yohobuy::get(Yohobuy::API_URL, $param);
445 } 445 }
  446 +
  447 + /**
  448 + * 选择支付,校验时间间隔,插入数据
  449 + * @param string $uid
  450 + * @param string $orderCode
  451 + * @param int $payment 14:银联手机支付 15:支付宝手机 18:支付宝wap(wap) 19:微信支付 22:微信wap(wap) 26:QQ钱包手机支付
  452 + * @return type
  453 + */
  454 + public static function savePrePayInfo($uid, $orderCode, $payment)
  455 + {
  456 + $param = Yohobuy::param();
  457 + $param['method'] = 'app.order.savePrePayInfo';
  458 + $param['uid'] = $uid;
  459 + $param['orderCode'] = $orderCode;
  460 + $param['payment'] = $payment;
  461 +
  462 + return Yohobuy::get(SearchData::getUrl('search'), $param);
  463 + }
446 464
447 } 465 }
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 use Plugin\Helpers; 4 use Plugin\Helpers;
5 use LibModels\Wap\Home\OrderData; 5 use LibModels\Wap\Home\OrderData;
  6 +use LibModels\Wap\Home\CartData;
6 use Plugin\Pay\weixin\JsApiPay; 7 use Plugin\Pay\weixin\JsApiPay;
7 use Plugin\Pay\weixin\lib\WxPayUnifiedOrder; 8 use Plugin\Pay\weixin\lib\WxPayUnifiedOrder;
8 use Plugin\Pay\weixin\lib\WxPayApi; 9 use Plugin\Pay\weixin\lib\WxPayApi;
@@ -131,5 +132,33 @@ class PayController extends AbstractAction @@ -131,5 +132,33 @@ class PayController extends AbstractAction
131 } while (false); 132 } while (false);
132 } 133 }
133 134
  135 + /**
  136 + * 选择支付时,时间间隔校验插入
  137 + */
  138 + public function addPaymentIntervalAction()
  139 + {
  140 + $data = array('code'=>400,'message'=>'','data'=>'');
  141 +
  142 + do {
  143 + if (!$this->isAjax()) {
  144 + break;
  145 + }
  146 +
  147 + $uid = $this->getUid(TRUE);
  148 + $orderCode = $this->get('orderCode','');
  149 + $payment = $this->get('payment',0);
  150 +
  151 + if (!$uid || !$orderCode || !$payment) {
  152 + break;
  153 + }
  154 +
  155 + $res = CartData::savePrePayInfo($uid, $orderCode, $payment);
  156 + $data = array('code'=>$res['code'],'message'=>$res['message'],'data'=>$res['data']);
  157 +
  158 + } while (false);
  159 +
  160 + $this->echoJson($data);
  161 + }
  162 +
134 163
135 } 164 }