|
@@ -233,6 +233,22 @@ class OrderController extends O2oBaseController{
|
|
|
$order->pay_channel = 'balance';
|
|
|
}
|
|
|
$order->status = 1;
|
|
|
+ if($order->status == 1 ) {
|
|
|
+ if($order->products[0]['product'] == '5835423fa84ea0ac7a8b4568') {
|
|
|
+ $u_id = new MongoId($user_id);
|
|
|
+ $start_time = date_create("2016-11-24")->format('U');//发放优惠券可用开始时间 2016.11.14
|
|
|
+ $end_time = date_create("2016-12-15")->format('U'); //发放优惠券过期时间 17天
|
|
|
+ if ($order->products[0]['product']['extra']['type'] == "6张兑换券"){
|
|
|
+ for( $i=0;$i<6;$i++) {
|
|
|
+ Service::factory('CouponService')->giveCoupon($u_id, new MongoId("5835527fa84ea02e758b45b7"), $start_time, $end_time);//发放代金券
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for( $i=0;$i<3;$i++) {
|
|
|
+ Service::factory('CouponService')->giveCoupon($u_id, new MongoId("5835527fa84ea02e758b45b7"), $start_time, $end_time);//发放代金券
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//修改订单状态
|
|
|
CommonFn::sendOrderSms($order,(string)$order->_id);
|
|
|
}else{
|
|
@@ -331,7 +347,6 @@ class OrderController extends O2oBaseController{
|
|
|
$str = isset($str)&&$str?$str:'上门';
|
|
|
$amount = ceil($order->pay_price*1000)/10;
|
|
|
|
|
|
- CommonFn::requestAjax(false,'支付遇到点问题了1,请稍候再试');
|
|
|
$result = Service::factory('PayService')->Pay($pay_channel,$amount,(string)$order->_id,$str,$str,$user_obj->wx_pub_openid);
|
|
|
if($result === false){
|
|
|
CommonFn::requestAjax(false,'支付遇到点问题了,请稍候再试');
|