|
@@ -369,14 +369,23 @@ 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 ($order->products[0]['extra']['type'] == "6张兑换券"){
|
|
|
- for( $i=0;$i<6;$i++) {
|
|
|
+ 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 {
|
|
|
+ } 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{
|
|
|
+
|
|
|
+ for( $i=0;$i<6;$i++) {
|
|
|
+ Service::factory('CouponService')->giveCoupon($u_id, new MongoId("5835527fa84ea02e758b45b7"), $start_time, $end_time);//发放代金券
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 长期定end
|