DengTao 8 years ago
parent
commit
f2b641a42c
1 changed files with 11 additions and 4 deletions
  1. 11 4
      www/protected/modules/o2o/controllers/OrderController.php

+ 11 - 4
www/protected/modules/o2o/controllers/OrderController.php

@@ -237,14 +237,21 @@ class  OrderController extends O2oBaseController{
                     $start_time = date_create("2016-11-11")->format('U');//发放优惠券可用开始时间 2016.11.14
                     $end_time = date_create("2016-12-15")->format('U');   //发放优惠券过期时间 17天
 
-                    if ($extra[0]['type'] == "6张兑换券"){
-
+                    if ($extra[0]['type'] == "3张(2小时/人)"){
+                        for( $i=0;$i<3;$i++) {
+                            Service::factory('CouponService')->giveCoupon($u_id, new MongoId("5835527fa84ea02e758b45b7"), $start_time, $end_time);//发放代金券
+                        }
+                    } else if ($extra[0]['type'] == "3张(3小时/人)"){
+                        for( $i=0;$i<3;$i++) {
+                            Service::factory('CouponService')->giveCoupon($u_id, new MongoId("5835527fa84ea02e758b45b7"), $start_time, $end_time);//发放代金券
+                        }
+                    } elseif ($extra[0]['type'] == "6张(2小时/人)"){
                         for( $i=0;$i<6;$i++) {
                             Service::factory('CouponService')->giveCoupon($u_id, new MongoId("5835527fa84ea02e758b45b7"), $start_time, $end_time);//发放代金券
                         }
-                    } else {
+                    } else{
 
-                        for( $i=0;$i<3;$i++) {
+                        for( $i=0;$i<6;$i++) {
                             Service::factory('CouponService')->giveCoupon($u_id, new MongoId("5835527fa84ea02e758b45b7"), $start_time, $end_time);//发放代金券
                         }
                     }