Browse Source

修改奖金相关用户聘级

kevin_zhangl 3 years ago
parent
commit
12503e8f7e

+ 7 - 7
common/helpers/bonus/BonusCalc.php

@@ -3346,13 +3346,13 @@ class BonusCalc extends BaseObject {
                         ':PERIOD_NUM' => $this->_periodNum
                     ]
                 );
-                // 奖金流水
-                FlowBonus::updateAll(['LAST_EMP_LV' => $nowBsEmpLv], 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
-                    [
-                        ':USER_ID' => $data['USER_ID'],
-                        ':PERIOD_NUM' => $this->_periodNum
-                    ]
-                );
+//                // 奖金流水
+//                FlowBonus::updateAll(['LAST_EMP_LV' => $nowBsEmpLv], 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM',
+//                    [
+//                        ':USER_ID' => $data['USER_ID'],
+//                        ':PERIOD_NUM' => $this->_periodNum
+//                    ]
+//                );
                 // 共享奖流水
                 CalcBonusGX::updateAll(['LAST_EMP_LV' => $nowBsEmpLv], 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
                     [

+ 9 - 0
common/helpers/bonus/BonusSend.php

@@ -581,6 +581,15 @@ class BonusSend extends BaseObject {
                 unset($transaction, $allData, $defaultEmpLv);
                 return $this->updateEmpLevel($offset + $this->_limit);
             }
+
+            // 刷新会员EmpLv为0
+            User::updateAll([
+                'LAST_EMP_LV' => '',
+                'LAST_EMP_LV_UPDATED_AT' => time(),
+                'LAST_EMP_LV_UPDATED_PERIOD' => $this->_periodNum,
+            ], 'LAST_EMP_LV_UPDATED_PERIOD < :PERIOD_NUM AND LAST_EMP_LV <> ""', [':PERIOD_NUM' => $this->_periodNum]);
+            User::deleteAllBaseInfoFromRedis();
+
             unset($allData);
         }
 

+ 1 - 1
common/helpers/user/Balance.php

@@ -458,7 +458,7 @@ class Balance {
             $flowInsertData = [
                 'USER_ID' => $userId,
                 'LAST_DEC_LV' => $userInfo['DEC_LV'],
-                'LAST_EMP_LV' => $userInfo['EMP_LV'],
+                'LAST_EMP_LV' => $userInfo['LAST_EMP_LV'],
                 'LAST_STATUS' => $userInfo['STATUS'],
                 'CALC_ID' => $params['CALC_ID'] ?? null,
                 'AMOUNT' => $amount,

+ 4 - 4
frontendEle/src/views/dashboard/index.vue

@@ -132,11 +132,11 @@
       }
     },
     methods: {
-      getEmpIco(type) {
-        if (type > 0) return require('@/assets/emp-ico-' + type + '.png')
+      getEmpIco (type) {
+        if (type) return require('@/assets/emp-ico-' + type + '.png')
       },
-      getEmpBg(type) {
-        if (type > 0) return 'backgroundImage:url(' + require('@/assets/emp-bg-' + type + '.png') + ')'
+      getEmpBg (type) {
+        if (type !== 0) return 'backgroundImage:url(' + require('@/assets/emp-bg-' + type + '.png') + ')'
       },
       sub_str(str, len = 15) {
         if (str) return str.slice(0, len)