Jelajahi Sumber

如果观察月是0 代表全站全额. 只有补差才判断业绩是否正确.因为必须全额购买

root 3 tahun lalu
induk
melakukan
1e91c27e75

+ 4 - 0
common/models/User.php

@@ -347,6 +347,10 @@ class User extends \common\components\ActiveRecord
      * @param $month 观察期月份限制 系统初始化为2个月
      */
     public static function checkIsObserve($addAt, $month) {
+        if (empty($month)) {
+            // 如果0 代表全站全额升级
+            return false;
+        }
         $appendMonth = date("Y-m", strtotime("first day of +$month month", $addAt)); // 指定月份
         $lastDay = date("t", strtotime($appendMonth));  // 获取指定月的最后一天
         $eTime = strtotime($appendMonth.'-'.$lastDay);

+ 2 - 2
frontendApi/modules/v1/controllers/UserController.php

@@ -241,12 +241,12 @@ class UserController extends BaseController {
         if (!$isMax) {
             $userDecPvSum = User::sumDevPvByUserId($userId); // 用户所有报单PV总和
             // 如果总和小于级别业绩
-            if ($userDecPvSum < $levelPerf) {
+            if ($isObserve && ($userDecPvSum < $levelPerf)) {
                 return static::notice('请联系客服人员核对业绩',400);
             }
             $nextLevelPerf = DeclarationLevel::getNextDecPref($levelPerf)['PERF'];
             // 如果总和超过了下一级业绩
-            if ($userDecPvSum >= $nextLevelPerf) {
+            if ($isObserve && ($userDecPvSum >= $nextLevelPerf)) {
                 return static::notice('请联系客服人员核对业绩',400);
             }
             $type = $isObserve ? 1 : 2;