Browse Source

修改扣减 包月类型判断

xiaohai 2 days ago
parent
commit
f2377fcb01
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      app/api/logic/ShopContentLogic.php

+ 10
- 2
app/api/logic/ShopContentLogic.php View File

@@ -861,7 +861,7 @@ class ShopContentLogic extends Logic
861 861
             return false;
862 862
         }
863 863
 
864
-        return ['count' => $shop->hksy_count, 'expire_time' => $shop->expire_time];
864
+        return ['count' => $shop->hksy_count, 'hksy_type' => $shop->hksy_type, 'expire_time' => $shop->expire_time];
865 865
     }
866 866
 
867 867
     /**
@@ -924,8 +924,16 @@ class ShopContentLogic extends Logic
924 924
 
925 925
         //判断类型
926 926
         if((int)$shop->hksy_type === 0){
927
+            $expire_time = $shop->expire_time;
928
+            $expire_time = strtotime($expire_time);
929
+            if (time() < $expire_time) {
930
+                self::$errCode = 0;
931
+                //未过期
932
+                return true;
933
+            }
934
+
927 935
             self::$errCode = 10;
928
-            self::$error = "商家类型是包月,不允许使用次数!";
936
+            self::$error = "包月商家,时间过期!";
929 937
             return false;
930 938
         }
931 939
 

Loading…
Cancel
Save