|
@@ -69,65 +69,6 @@ class WebController extends O2oBaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ($userId) {
|
|
|
- //start双十一三天登陆发送优惠券 用后删除
|
|
|
- //三批
|
|
|
- $criteria = new EMongoCriteria();
|
|
|
-
|
|
|
- $criteria->coupon('==',new MongoId('5822c17f9f5160bc048b4f98'));
|
|
|
- $criteria->user('==', new MongoId($userId));
|
|
|
- $user_coupon = UserCoupon::model()->find($criteria);
|
|
|
- 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('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')
|
|
|
- // 0 => array('58240b1ca84ea08d438b4567'),
|
|
|
- // 1 => array('58240b23a84ea02e3e8b4668'),
|
|
|
- // 2 => array('58240b2aa84ea02c438b4574'),
|
|
|
- );
|
|
|
- $u_id = new MongoId($userId);
|
|
|
- foreach ($coupons as $key => $coupon) {
|
|
|
- switch ($key) {
|
|
|
- //第一批
|
|
|
- case 0:
|
|
|
- $start_time = date_create("2016-11-14")->format('U');//发放优惠券可用开始时间 2016.11.14
|
|
|
- $end_time = date_create("2016-11-30")->format('U'); //发放优惠券过期时间 17天
|
|
|
- foreach ($coupon as $c) {
|
|
|
- $coupon_id = new MongoId($c);
|
|
|
- Service::factory('CouponService')->giveCoupon($u_id, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
- }
|
|
|
- break;
|
|
|
- //第二批
|
|
|
- case 1:
|
|
|
- $start_time = date_create("2016-12-01")->format('U');//发放优惠券可用开始时间 2016.11.14
|
|
|
- $end_time = date_create("2016-12-15")->format('U'); //发放优惠券过期时间 15天
|
|
|
- foreach ($coupon as $c) {
|
|
|
- $coupon_id = new MongoId($c);
|
|
|
- Service::factory('CouponService')->giveCoupon($u_id, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
- }
|
|
|
- break;
|
|
|
- //第三批
|
|
|
- case 2:
|
|
|
-
|
|
|
- $start_time = date_create("2016-12-16")->format('U');//发放优惠券可用开始时间 2016.11.14
|
|
|
- $end_time = date_create("2016-12-31")->format('U');; //发放优惠券过期时间 15天
|
|
|
- foreach ($coupon as $c) {
|
|
|
- $coupon_id = new MongoId($c);
|
|
|
- Service::factory('CouponService')->giveCoupon($u_id, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- //end
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
if($home_page){
|
|
|
$this->renderpartial($home_page.'Index', array(
|
|
|
'version' => '2015082505',
|