Przeglądaj źródła

activityController

DengTao 8 lat temu
rodzic
commit
c60422b1e9

+ 3 - 3
www/protected/modules/common/controllers/ActivityController.php

@@ -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(

+ 1 - 1
www/protected/modules/common/views/activity/getCoupon.php

@@ -59,7 +59,7 @@
             }
             ?>
             location.href = '<?php echo Yii::app()->request->baseUrl . 'index.php?r=/common/activity/wxIndex&coupon_id='.$coupon_id; ?>';
-            
+
             document.write('<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"><\/script>');
         }
         if (location.hash == '#rd') {