|
@@ -54,6 +54,33 @@ class WebController extends O2oBaseController {
|
|
|
$list->push($user_id);
|
|
|
}
|
|
|
$userId = (string)$userAr->_id;
|
|
|
+ //start双十一三天登陆发送优惠券 用后删除
|
|
|
+ //三批
|
|
|
+ /* $coupons = array(
|
|
|
+ array(),
|
|
|
+ array(),
|
|
|
+ array()
|
|
|
+ );
|
|
|
+
|
|
|
+ $coupon_id = "5816a413a84ea0023f8b46ba";
|
|
|
+ $coupon_id = new MongoId($coupon_id);
|
|
|
+ $start_time = date_create("2016-11-11")->format('U'); //发放优惠券可用开始时间 2016.11.11
|
|
|
+ $end_time = $start_time + 86400 * 30; //发放优惠券过期时间 一个月
|
|
|
+ $cursor = RUser::model()->findAll();
|
|
|
+
|
|
|
+ $rows = CommonFn::getRowsFromCursor($cursor);
|
|
|
+ $flag = 0;
|
|
|
+ foreach ($rows as $value) {
|
|
|
+ if (CommonFn::isMongoId($value['_id'])) {
|
|
|
+ $userId = $value['_id'];
|
|
|
+ Service::factory('CouponService')->giveCoupon($userId, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
+ $flag += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+*/
|
|
|
+
|
|
|
+
|
|
|
+ //end
|
|
|
}else{
|
|
|
var_dump($userAr);exit;
|
|
|
}
|