|
@@ -76,12 +76,12 @@ class WebController extends O2oBaseController {
|
|
|
$criteria->coupon('==',new MongoId('57fe0aaa9f5160b1048b456c'));
|
|
|
$criteria->user('==', new MongoId($userId));
|
|
|
$user_coupon = UserCoupon::model()->find($criteria);
|
|
|
- if (empty($user_coupon) && time() >= intval(date_create("2016-11-10")->format('U')) && time() <= intval(date_create("2016-11-17")->format('U'))) {
|
|
|
+ if (empty($user_coupon) && time() >= intval(date_create("2016-11-11")->format('U')) && time() <= intval(date_create("2016-11-17")->format('U'))) {
|
|
|
|
|
|
$coupons = array(
|
|
|
- 0 => array('57fe0aaa9f5160b1048b456c'),
|
|
|
- 1 => array('57fe09fa9f5160d1048b456e'),
|
|
|
- 2 => array('57fe0a779f5160aa048b456a')
|
|
|
+ 0 => array('5822c17f9f5160bc048b4f98','5822eaa39f5160ca048b50e6','5822eaf59f5160b2048b4ed3','5822eb6a9f5160d3048b4eab','5822ebfa9f5160a9048b4f43','5822ec399f5160c2048b5158','5822ec709f5160bc048b5006'),
|
|
|
+ 1 => array('5822ec869f5160be048b50f1','5822ec479f5160c3048b4fa8','5822ec159f5160aa048b51ec','5822eb809f5160c0048b50a0','5822eb0e9f5160d4048b5111','5822eab99f5160b5048b50d6','5822ea719f5160b7048b4fb9'),
|
|
|
+ 2 => array('5822ec949f5160a3048b4f6d','5822ec599f5160cc048b4f79','5822ec229f5160ca048b50e7','5822eb969f5160a6048b4e85', '5822eb1d9f5160c4048b4edb','5822eace9f5160b8048b511b','5822ea869f5160ae048b521c')
|
|
|
);
|
|
|
foreach ($coupons as $key => $coupon) {
|
|
|
switch ($key) {
|
|
@@ -107,7 +107,7 @@ class WebController extends O2oBaseController {
|
|
|
case 2:
|
|
|
|
|
|
$start_time = date_create("2016-12-16")->format('U');//发放优惠券可用开始时间 2016.11.14
|
|
|
- $end_time = $start_time + 86400 * 16; //发放优惠券过期时间 15天
|
|
|
+ $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);//发放代金券
|