|
@@ -363,32 +363,6 @@ class OrderController extends O2oBaseController{
|
|
// 支付成功后用户有效订单数增加
|
|
// 支付成功后用户有效订单数增加
|
|
if (isset($user_obj->order_count)) {
|
|
if (isset($user_obj->order_count)) {
|
|
$user_obj->order_count += 1;
|
|
$user_obj->order_count += 1;
|
|
- //支付成功 判断是否是长期定 start
|
|
|
|
- if($order->products[0]['product'] == '5835423fa84ea0ac7a8b4568') {
|
|
|
|
- $u_id = new MongoId($user_id);
|
|
|
|
- $start_time = date_create("2016-11-11")->format('U');//发放优惠券可用开始时间 2016.11.14
|
|
|
|
- $end_time = date_create("2016-12-15")->format('U'); //发放优惠券过期时间 17天
|
|
|
|
-
|
|
|
|
- if ($order->products[0]['extra']['type']['type'] == "3张(2小时/人)"){
|
|
|
|
- for( $i=0;$i<3;$i++) {
|
|
|
|
- Service::factory('CouponService')->giveCoupon($u_id, new MongoId("5835527fa84ea02e758b45b7"), $start_time, $end_time);//发放代金券
|
|
|
|
- }
|
|
|
|
- } else if ($order->products[0]['extra']['type']['type'] == "3张(3小时/人)"){
|
|
|
|
- for( $i=0;$i<3;$i++) {
|
|
|
|
- Service::factory('CouponService')->giveCoupon($u_id, new MongoId("58356a2aa84ea03b018b46bb"), $start_time, $end_time);//发放代金券
|
|
|
|
- }
|
|
|
|
- } elseif ($order->products[0]['extra']['type']['type'] == "6张(2小时/人)"){
|
|
|
|
- for( $i=0;$i<6;$i++) {
|
|
|
|
- Service::factory('CouponService')->giveCoupon($u_id, new MongoId("5835527fa84ea02e758b45b7"), $start_time, $end_time);//发放代金券
|
|
|
|
- }
|
|
|
|
- } else{
|
|
|
|
-
|
|
|
|
- for( $i=0;$i<6;$i++) {
|
|
|
|
- Service::factory('CouponService')->giveCoupon($u_id, new MongoId("58356a2aa84ea03b018b46bb"), $start_time, $end_time);//发放代金券
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 长期定end
|
|
|
|
} else {
|
|
} else {
|
|
$user_obj->order_count = 1;
|
|
$user_obj->order_count = 1;
|
|
}
|
|
}
|