Selaa lähdekoodia

activityController

DengTao 8 vuotta sitten
vanhempi
sitoutus
1e982c93b4

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

@@ -90,8 +90,11 @@ class ActivityController extends O2oBaseController  {
         $start_time = time();                 //发放优惠券可用开始时间
         $end_time = $start_time + 86400*30;   //发放优惠券过期时间
         var_dump($userId);
-        if (CommonFn::isMongoId($coupon_id) && !$coupon_id) {
-            if (CommonFn::isMongoId($userId) && !$userId) {
+        if (!CommonFn::isMongoId($userId)) {
+            $userId = new MongoId($userId);
+        }
+        if ($coupon_id) {
+            if ($userId) {
                 Service::factory('CouponService')->giveCoupon($userId, $coupon_id, $start_time, $end_time);//发放代金券
                 $home_page = 1;
             }