|
@@ -18,7 +18,6 @@ class ActivityController extends O2oBaseController {
|
|
|
$coupon_id = Yii::app()->request->getParam('coupon_id','');//获取代金券id
|
|
|
$code = Yii::app()->getRequest()->getParam("code");
|
|
|
$state = Yii::app()->getRequest()->getParam("state");
|
|
|
- $home_page = Yii::app()->getRequest()->getParam("home_page",'');
|
|
|
$userId = Yii::app()->request->getParam('userId','');
|
|
|
$appToken = '';
|
|
|
if($code && $state){
|
|
@@ -86,15 +85,16 @@ class ActivityController extends O2oBaseController {
|
|
|
$coupon_id =new MongoId($coupon_id);
|
|
|
$start_time = time(); //发放优惠券可用开始时间
|
|
|
$end_time = $start_time + 86400*30; //发放优惠券过期时间
|
|
|
+ $flag = 0;
|
|
|
if ($userId != ""){
|
|
|
if (!CommonFn::isMongoId($userId)) {
|
|
|
$userId = new MongoId($userId);
|
|
|
}
|
|
|
Service::factory('CouponService')->giveCoupon($userId, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
-
|
|
|
+ $flag = 1;
|
|
|
}
|
|
|
|
|
|
- if($home_page){
|
|
|
+ if($flag){
|
|
|
$this->renderpartial('index');
|
|
|
}else{
|
|
|
$this->renderpartial('getCoupon', array(
|