|
@@ -87,6 +87,7 @@ class WebController extends O2oBaseController {
|
|
|
// 1 => array('58240b23a84ea02e3e8b4668'),
|
|
|
// 2 => array('58240b2aa84ea02c438b4574'),
|
|
|
);
|
|
|
+ $u_id = new MongoId($userId);
|
|
|
foreach ($coupons as $key => $coupon) {
|
|
|
switch ($key) {
|
|
|
//第一批
|
|
@@ -95,7 +96,7 @@ class WebController extends O2oBaseController {
|
|
|
$end_time = date_create("2016-11-30")->format('U'); //发放优惠券过期时间 17天
|
|
|
foreach ($coupon as $c) {
|
|
|
$coupon_id = new MongoId($c);
|
|
|
- Service::factory('CouponService')->giveCoupon($userId, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
+ Service::factory('CouponService')->giveCoupon($u_id, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
}
|
|
|
break;
|
|
|
//第二批
|
|
@@ -104,7 +105,7 @@ class WebController extends O2oBaseController {
|
|
|
$end_time = date_create("2016-12-15")->format('U'); //发放优惠券过期时间 15天
|
|
|
foreach ($coupon as $c) {
|
|
|
$coupon_id = new MongoId($c);
|
|
|
- Service::factory('CouponService')->giveCoupon($userId, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
+ Service::factory('CouponService')->giveCoupon($u_id, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
}
|
|
|
break;
|
|
|
//第三批
|
|
@@ -114,7 +115,7 @@ class WebController extends O2oBaseController {
|
|
|
$end_time = date_create("2016-12-31")->format('U');; //发放优惠券过期时间 15天
|
|
|
foreach ($coupon as $c) {
|
|
|
$coupon_id = new MongoId($c);
|
|
|
- Service::factory('CouponService')->giveCoupon($userId, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
+ Service::factory('CouponService')->giveCoupon($u_id, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
}
|
|
|
break;
|
|
|
|