Browse Source

activityController

DengTao 8 years ago
parent
commit
2117549a66
1 changed files with 4 additions and 2 deletions
  1. 4 2
      www/protected/modules/common/controllers/ActivityController.php

+ 4 - 2
www/protected/modules/common/controllers/ActivityController.php

@@ -90,8 +90,10 @@ class ActivityController extends O2oBaseController  {
         $start_time = time();                 //发放优惠券可用开始时间
         $end_time = $start_time + 86400*30;   //发放优惠券过期时间
         var_dump($userId);
-        if (!CommonFn::isMongoId($userId)) {
-            $userId = new MongoId($userId);
+        if ($userId){
+            if (!CommonFn::isMongoId($userId)) {
+                $userId = new MongoId($userId);
+            }
         }
         if ($coupon_id) {
             if ($userId) {