Browse Source

车房奖调整

kevin_zhangl 3 years ago
parent
commit
806520c826

+ 82 - 49
common/helpers/bonus/BonusCalc.php

@@ -297,12 +297,12 @@ class BonusCalc extends BaseObject {
             echo('计算蓝星奖'.($this->_sysConfig['openGL']['VALUE']?'完成':'关闭').',耗时:' . round($t20 - $t19, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
             $this->_updatePercent(67);
 
-            $this->calcBonusTourism($this->_sysConfig['openTourism']);
+//            $this->calcBonusTourism($this->_sysConfig['openTourism']);
             $t21 = microtime(true);
-            echo('计算旅游奖' . ($this->_sysConfig['openTourism']['VALUE'] ? '完成' : '关闭') . ',耗时:' . round($t21 - $t20, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-            $this->_updatePercent(68);
+//            echo('计算旅游奖' . ($this->_sysConfig['openTourism']['VALUE'] ? '完成' : '关闭') . ',耗时:' . round($t21 - $t20, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
+//            $this->_updatePercent(68);
 
-            $this->calcBonusGarage($this->_sysConfig['openGarage']);
+            $this->calcBonusGarage();
             $t22 = microtime(true);
             echo('计算车房奖' . ($this->_sysConfig['openGarage']['VALUE'] ? '完成' : '关闭').',耗时:' . round($t22 - $t21, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL . PHP_EOL);
             $this->_updatePercent(69);
@@ -1644,12 +1644,13 @@ class BonusCalc extends BaseObject {
     }
 
     // 执行旅游奖的计算
-    public function calcBonusTourism(array $bonusConfig) {
+    public function calcBonusTourism() {
         // 月结,如果不是月结点,则直接退出
         if (!$this->_isCalcMonth) {
             return true;
         }
 
+        $bonusConfig = $this->_sysConfig['openTourism'];
         // 达标条件:聘级、级别、奖项比例
         $config = json_decode($bonusConfig['OPTIONS'], true);
         // 奖金总比例
@@ -1665,44 +1666,60 @@ class BonusCalc extends BaseObject {
             ->where('CALC_MONTH=:CALC_MONTH', [':CALC_MONTH' => $this->_calcYearMonth])
             ->sum('PV_PCS');
 
-        if ($monthTotalPV <= 0) {
-            return true;
-        }
-
-        // 基于蓝星奖结果计算符合获奖条件的会员
-        $userBonusData = CalcBonusBS::find()
+        // 基于蓝星奖结果计算符合获奖条件的会员StarDirector
+        $userStarDirector = CalcBonusBS::find()
             ->yearMonth($this->_calcYearMonth)
             ->where('CALC_MONTH=:CALC_MONTH', [':CALC_MONTH' => $this->_calcYearMonth])
             ->select('USER_ID,LEVEL_ID,LAST_DEC_LV,LAST_EMP_LV,LAST_STATUS')
             ->groupBy('USER_ID')
             ->asArray()
             ->all();
+        $userStarDirectorObj = array_column($userStarDirector, NULL, 'USER_ID');
+
+        // 基于团队奖/绩效奖结果计算会员的StarCrown
+        $userStarCrown = CalcBonusQY::find()
+            ->yearMonth($this->_calcYearMonth)
+            ->where('CALC_MONTH=:CALC_MONTH', [':CALC_MONTH' => $this->_calcYearMonth])
+            ->select('USER_ID,LAST_STAR_LV')
+            ->groupBy('USER_ID')
+            ->asArray()
+            ->all();
+        $userStarCrownObj = array_column($userStarCrown, NULL, 'USER_ID');
+
+        // 合并用户ID,去重
+        $bonusUsers = array_unique(array_merge(array_keys($userStarDirectorObj), array_keys($userStarCrownObj)));
 
         $insertBonusData = [];
-        foreach($userBonusData as $userBonus) {
-            // TODO:基于绩效奖,获取会员starCrown级别,计算奖金
-            $startCrownPoint = (mt_rand(10, 75) / 10) / 100;
-            $amount = Tool::formatPrice(($monthTotalPV * $mate) * $startCrownPoint);
+        foreach($bonusUsers as $userId) {
+            // 计算奖金:取starDirectorPoint和startCrownPoint的大个值
+            $starDirectorPoint = $this->_empLevelConfig[$userStarDirectorObj[$userId]['LEVEL_ID']]['TOURISM_PERCENT'] ?? 0;
+            $startCrownPoint = $this->_starCrownLevelConfig[$userStarCrownObj[$userId]['LAST_STAR_LV']]['TOURISM_PERCENT'] ?? 0;
+            // 奖金比例:
+            $bonusPoint = max($starDirectorPoint, $startCrownPoint);
+            // 计算奖金
+            $amount = Tool::formatPrice(($monthTotalPV * $mate * $bonusPoint) / 100);
             if ($amount <= 0) {
                 continue;
             }
 
             // 会员级别+聘级都达到要求才会发放奖金
-            if (in_array($userBonus['LAST_DEC_LV'], $minDecLevel) && in_array($userBonus['LEVEL_ID'], $minEmpLevel)) {
+            if (in_array($userStarDirectorObj[$userId]['LAST_DEC_LV'], $minDecLevel) && in_array($userStarDirectorObj[$userId]['LEVEL_ID'], $minEmpLevel)) {
                 // 放入缓存
-                CalcCache::tourismBonus($userBonus['USER_ID'], $this->_periodNum, $amount);
+                CalcCache::tourismBonus($userId, $this->_periodNum, $amount);
                 // 加入月奖的会员
-                CalcCache::addHasMonthBonusUsers($userBonus['USER_ID'], $this->_periodNum);
+                CalcCache::addHasMonthBonusUsers($userId, $this->_periodNum);
             }
 
             $insertBonusData[] = [
                 'ID' => SnowFake::instance()->generateId(),
-                'USER_ID' => $userBonus['USER_ID'],
-                'LEVEL_ID' => $userBonus['LEVEL_ID'],
-                'LAST_DEC_LV' => $userBonus['LAST_DEC_LV'],
-                'LAST_EMP_LV' => $userBonus['LAST_EMP_LV'],
-                'LAST_STATUS' => $userBonus['LAST_STATUS'],
-                'AMOUNT' => $amount,
+                'USER_ID' => $userId,
+                'LEVEL_ID' => $userStarDirectorObj[$userId]['LEVEL_ID'],
+                'LAST_DEC_LV' => $userStarDirectorObj[$userId]['LAST_DEC_LV'],
+                'LAST_EMP_LV' => $userStarDirectorObj[$userId]['LAST_EMP_LV'],
+                'LAST_STATUS' => $userStarDirectorObj[$userId]['LAST_STATUS'],
+                'LAST_STAR_LV' => $userStarCrownObj[$userId]['LAST_STAR_LV'],
+                'AMOUNT_STANDARD' => $amount,
+                'POINT' => $bonusPoint,
                 'PERIOD_NUM' => $this->_periodNum,
                 'CALC_YEAR' => $this->_calcYear,
                 'CALC_MONTH' => $this->_calcYearMonth,
@@ -1720,12 +1737,13 @@ class BonusCalc extends BaseObject {
     }
 
     // 执行车房奖的计算
-    public function calcBonusGarage($bonusConfig) {
+    public function calcBonusGarage() {
         // 月结,如果不是月结点,则直接退出
         if (!$this->_isCalcMonth) {
             return true;
         }
 
+        $bonusConfig = $this->_sysConfig['openGarage'];
         // 达标条件:聘级、级别、奖项比例
         $config = json_decode($bonusConfig['OPTIONS'], true);
         // 奖金总比例
@@ -1743,47 +1761,62 @@ class BonusCalc extends BaseObject {
             ->where('CALC_MONTH=:CALC_MONTH', [':CALC_MONTH' => $this->_calcYearMonth])
             ->sum('PV_PCS');
 
-        if ($monthTotalPV <= 0) {
-            return true;
-        }
+        // 基于蓝星奖结果计算符合获奖条件的会员StarDirector
+        $userStarDirector = CalcBonusBS::find()
+            ->yearMonth($this->_calcYearMonth)
+            ->where('CALC_MONTH = :CALC_MONTH', [':CALC_MONTH' => $this->_calcYearMonth])
+            ->select('USER_ID,LEVEL_ID,LAST_DEC_LV,LAST_EMP_LV,LAST_STATUS')
+            ->groupBy('USER_ID')
+            ->asArray()
+            ->all();
+        $userStarDirectorObj = array_column($userStarDirector, NULL, 'USER_ID');
 
-        // 基于蓝星奖结果计算符合获奖条件的会员
-        $userBonusData = CalcBonusBS::find()
+        // 基于团队奖/绩效奖结果计算会员的StarCrown
+        $userStarCrown = CalcBonusQY::find()
             ->yearMonth($this->_calcYearMonth)
-            ->where('CALC_MONTH=:CALC_MONTH', [':CALC_MONTH' => $this->_calcYearMonth])
-            ->select('USER_ID,LEVEL_ID,LAST_DEC_LV,LAST_EMP_LV,LAST_STATUS,RECONSUME_POINTS')
+            ->where('CALC_MONTH = :CALC_MONTH AND PERIOD_NUM = :PERIOD_NUM', [':CALC_MONTH' => $this->_calcYearMonth, ':PERIOD_NUM' => $this->_periodNum])
+            ->select('USER_ID,LAST_DEC_LV,LAST_EMP_LV,LAST_STAR_LV,LAST_STATUS')
             ->groupBy('USER_ID')
             ->asArray()
             ->all();
+        $userStarCrownObj = array_column($userStarCrown, NULL, 'USER_ID');
+
+        // 合并用户ID,去重
+        $bonusUsers = array_unique(array_merge(array_keys($userStarDirectorObj), array_keys($userStarCrownObj)));
 
         $insertBonusData = [];
-        foreach($userBonusData as $userBonus) {
-            // TODO:基于绩效奖,获取会员starCrown级别,计算奖金
-            $startCrownPoint = mt_rand(1, 10) / 100;
-            $amount = Tool::formatPrice(($monthTotalPV * $mate) * $startCrownPoint);
+        foreach($bonusUsers as $userId) {
+            // 计算奖金:取starDirectorPoint和startCrownPoint的大个值
+            $starDirectorPoint = !isset($userStarDirectorObj[$userId]['LEVEL_ID']) ? 0 : ($this->_empLevelConfig[$userStarDirectorObj[$userId]['LEVEL_ID']]['GARAGE_PERCENT'] ?? 0);
+            $startCrownPoint = !isset($userStarCrownObj[$userId]['LAST_STAR_LV']) ? 0: ($this->_starCrownLevelConfig[$userStarCrownObj[$userId]['LAST_STAR_LV']]['GARAGE_PERCENT'] ?? 0);
+            // 奖金比例:
+            $bonusPoint = max($starDirectorPoint, $startCrownPoint);
+            // 计算奖金
+            $amount = Tool::formatPrice(($monthTotalPV * $mate * $bonusPoint) / 100);
             if ($amount <= 0) {
                 continue;
             }
-
             // 奖金数不能大于封顶值
             $amount = ($amount > $capBonus) ? $capBonus : $amount;
 
             // 会员级别+聘级都达到要求才会发放奖金
-            if (in_array($userBonus['LAST_DEC_LV'], $minDecLevel) && in_array($userBonus['LEVEL_ID'], $minEmpLevel)) {
+            if (in_array($userStarDirectorObj[$userId]['LAST_DEC_LV'], $minDecLevel) && in_array($userStarDirectorObj[$userId]['LEVEL_ID'], $minEmpLevel)) {
                 // 放入缓存
-                CalcCache::garageBonus($userBonus['USER_ID'], $this->_periodNum, $amount);
+                CalcCache::garageBonus($userId, $this->_periodNum, $amount);
                 // 加入月奖的会员
-                CalcCache::addHasMonthBonusUsers($userBonus['USER_ID'], $this->_periodNum);
+                CalcCache::addHasMonthBonusUsers($userId, $this->_periodNum);
             }
 
             $insertBonusData[] = [
                 'ID' => SnowFake::instance()->generateId(),
-                'USER_ID' => $userBonus['USER_ID'],
-                'LEVEL_ID' => $userBonus['LEVEL_ID'],
-                'LAST_DEC_LV' => $userBonus['LAST_DEC_LV'],
-                'LAST_EMP_LV' => $userBonus['LAST_EMP_LV'],
-                'LAST_STATUS' => $userBonus['LAST_STATUS'],
+                'USER_ID' => $userId,
+                'LEVEL_ID' => $userStarDirectorObj[$userId]['LEVEL_ID'] ?? '',
+                'LAST_DEC_LV' => $userStarDirectorObj[$userId]['LAST_DEC_LV'] ?? ($userStarCrownObj[$userId]['LAST_DEC_LV'] ?? ''),
+                'LAST_EMP_LV' => $userStarDirectorObj[$userId]['LAST_EMP_LV'] ?? ($userStarCrownObj[$userId]['LAST_EMP_LV'] ?? ''),
+                'LAST_STATUS' => $userStarDirectorObj[$userId]['LAST_STATUS'] ?? ($userStarCrownObj[$userId]['LAST_STATUS'] ?? 1),
+                'LAST_STAR_LV' => $userStarCrownObj[$userId]['LAST_STAR_LV'] ?? '',
                 'AMOUNT' => $amount,
+                'POINT' => $bonusPoint,
                 'PERIOD_NUM' => $this->_periodNum,
                 'CALC_YEAR' => $this->_calcYear,
                 'CALC_MONTH' => $this->_calcYearMonth,
@@ -1832,12 +1865,12 @@ class BonusCalc extends BaseObject {
                 $point = $deductData['reConsumePoints'] + $user['RECONSUME_POINTS'];// 复消积分
 
                 // 管理奖钻卡发放
-                if (in_array($user['LAST_DEC_LV'], $minDecLevel)) {
+//                if (in_array($user['LAST_DEC_LV'], $minDecLevel)) {
                     // 把对碰后的奖金存入缓存中
                     CalcCache::bonus($user['USER_ID'], $this->_periodNum, 'BONUS_BS_MNT', $user['ORI_BONUS_MNT'], $deductData);
                     // 加入月奖的会员
                     CalcCache::addHasMonthBonusUsers($user['USER_ID'], $this->_periodNum);
-                }
+//                }
 
                 // 更新蓝星奖金存储过程的实发金额数据
                 CalcBonusBS::updateAll([
@@ -1885,12 +1918,12 @@ class BonusCalc extends BaseObject {
                 $point = $deductData['reConsumePoints'] + $user['RECONSUME_POINTS'];// 复消积分
 
                 // 业绩奖金卡、钻卡发放
-                if (in_array($user['LAST_DEC_LV'], $minDecLevel)) {
+//                if (in_array($user['LAST_DEC_LV'], $minDecLevel)) {
                     // 把对碰后的奖金存入缓存中
                     CalcCache::bonus($user['USER_ID'], $this->_periodNum, 'BONUS_BS_ABBR', $user['ORI_BONUS_ABBR'], $deductData);
                     // 加入月奖的会员
                     CalcCache::addHasMonthBonusUsers($user['USER_ID'], $this->_periodNum);
-                }
+//                }
 
                 // 更新蓝星业绩奖金存储过程的实发金额数据
                 CalcBonusBS::updateAll([

+ 2 - 2
common/helpers/bonus/BonusSend.php

@@ -361,7 +361,7 @@ class BonusSend extends BaseObject {
                             'CALC_ID' => $data['ID'],
                             'REMARK' => 'From ' . $periodNum . '期',
                             'PERIOD_NUM' => $periodNum,
-                            'TRAVEL' => $data['BONUS_TOURISM'],
+                            'TOURISM_POINTS' => $data['BONUS_TOURISM'],
                             'DEAL_TYPE_ID' => DealType::TOURISM_SEND,
                             'SORT' => $key * 10,
                             'BONUS_ISSUE' => true,
@@ -373,7 +373,7 @@ class BonusSend extends BaseObject {
                             'CALC_ID' => $data['ID'],
                             'REMARK' => 'From ' . $periodNum . '期',
                             'PERIOD_NUM' => $periodNum,
-                            'HOUSE' => $data['BONUS_GARAGE'],
+                            'GARAGE_POINTS' => $data['BONUS_GARAGE'],
                             'DEAL_TYPE_ID' => DealType::GARAGE_SEND,
                             'SORT' => $key * 10,
                             'BONUS_ISSUE' => true,

+ 4 - 2
common/helpers/user/Balance.php

@@ -572,7 +572,7 @@ class Balance {
                 'TRANSFER_SN' => $params['TRANSFER_SN'] ?? '',
                 'SORT' => $params['SORT'] ?? 0,
             ];
-            unset($userInfo, $oneUserBonus);
+
             if (strtolower($type) == 'reconsume_points' || strtolower($type) == 'cf' || strtolower($type) == 'lx' 
                 || strtolower($type) == 'exchange_points'
             ) {
@@ -603,12 +603,14 @@ class Balance {
             } elseif (strtolower($type) == 'lx') {
                 FlowLX::insertOne($flowInsertData);
             } elseif (strtolower($type) == 'tourism_points') {
+                $flowInsertData['LAST_STAR_LV'] = $userInfo['LAST_STAR_LV'];
                 FlowTourismPoints::insertOne($flowInsertData);
             } elseif (strtolower($type) == 'garage_points') {
+                $flowInsertData['LAST_STAR_LV'] = $userInfo['LAST_STAR_LV'];
                 FlowGaragePoints::insertOne($flowInsertData);
             }
 
-            unset($flowInsertData);
+            unset($flowInsertData, $userInfo, $oneUserBonus);
             RedisLock::instance()->unlock($lockKey);
         } else {
             throw new Exception('流水产生错误');

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

@@ -552,7 +552,7 @@ class Info {
      * @return array|null
      */
     public static function getLastInfo($userId){
-        $data = User::findOneAsArray('ID=:ID', [':ID' => $userId], 'LAST_DEC_LV AS DEC_LV,EMP_LV,STATUS');
+        $data = User::findOneAsArray('ID=:ID', [':ID' => $userId], 'LAST_DEC_LV AS DEC_LV,EMP_LV,STATUS,STAR_LV AS LAST_STAR_LV');
         return $data;
     }
 

+ 6 - 2
common/models/CalcBonusGarage.php

@@ -11,8 +11,10 @@ use Yii;
  * @property string $USER_ID 会员ID
  * @property string $LAST_DEC_LV 结算时会员级别
  * @property string $LAST_EMP_LV 结算时会员聘级
+ * @property string $LAST_STAR_LV 结算时会员星级
  * @property int $LAST_STATUS 结算时状态
  * @property string $AMOUNT 奖金金额
+ * @property string $POINT 奖金比例
  * @property int $PERIOD_NUM 结算期数
  * @property int $CALC_YEAR 所在结算年
  * @property int $CALC_MONTH 所在结算月
@@ -37,9 +39,9 @@ class CalcBonusGarage extends \common\components\ActiveRecord
     {
         return [
             [['USER_ID', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT'], 'number'],
+            [['AMOUNT', 'POINT'], 'number'],
             [['LAST_STATUS', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'BONUS_TYPE'], 'string', 'max' => 32],
+            [['ID', 'USER_ID', 'LAST_DEC_LV', 'BONUS_TYPE', 'LAST_STAR_LV'], 'string', 'max' => 32],
             [['P_CALC_MONTH'], 'safe'],
             [['LOGS'], 'string', 'max' => 2000],
             [['ID'], 'unique'],
@@ -56,8 +58,10 @@ class CalcBonusGarage extends \common\components\ActiveRecord
             'USER_ID' => '会员ID',
             'LAST_DEC_LV' => '结算时会员级别',
             'LAST_EMP_LV' => '结算时会员聘级',
+            'LAST_STAR_LV' => '结算时会员星级',
             'LAST_STATUS' => '结算时状态',
             'AMOUNT' => '奖金金额',
+            'POINT' => '奖金比例',
             'PERIOD_NUM' => '结算期数',
             'CALC_YEAR' => '所在结算年',
             'CALC_MONTH' => '所在结算月',

+ 6 - 2
common/models/CalcBonusTourism.php

@@ -11,8 +11,10 @@ use Yii;
  * @property string $USER_ID 会员ID
  * @property string $LAST_DEC_LV 结算时会员级别
  * @property string $LAST_EMP_LV 结算时会员聘级
+ * @property string $LAST_STAR_LV 结算时会员星级
  * @property int $LAST_STATUS 结算时状态
  * @property string $AMOUNT 奖金金额
+ * @property string $POINT 奖金比例
  * @property int $PERIOD_NUM 结算期数
  * @property int $CALC_YEAR 所在结算年
  * @property int $CALC_MONTH 所在结算月
@@ -37,9 +39,9 @@ class CalcBonusTourism extends \common\components\ActiveRecord
     {
         return [
             [['USER_ID', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT'], 'number'],
+            [['AMOUNT', 'POINT'], 'number'],
             [['LAST_STATUS', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'BONUS_TYPE'], 'string', 'max' => 32],
+            [['ID', 'USER_ID', 'LAST_DEC_LV', 'BONUS_TYPE', 'LAST_STAR_LV'], 'string', 'max' => 32],
             [['P_CALC_MONTH'], 'safe'],
             [['LOGS'], 'string', 'max' => 2000],
             [['ID'], 'unique'],
@@ -56,8 +58,10 @@ class CalcBonusTourism extends \common\components\ActiveRecord
             'USER_ID' => '会员ID',
             'LAST_DEC_LV' => '结算时会员级别',
             'LAST_EMP_LV' => '结算时会员聘级',
+            'LAST_STAR_LV' => '结算时会员星级',
             'LAST_STATUS' => '结算时状态',
             'AMOUNT' => '奖金金额',
+            'POINT' => '奖金比例',
             'PERIOD_NUM' => '结算期数',
             'CALC_YEAR' => '所在结算年',
             'CALC_MONTH' => '所在结算月',

+ 1 - 1
common/models/FlowGaragePoints.php

@@ -48,7 +48,7 @@ class FlowGaragePoints extends \common\components\ActiveRecord
             [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
             [['AMOUNT', 'TOTAL'], 'number'],
             [['IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'DELETED', 'DELETED_AT', 'SORT'], 'integer'],
-            [['ID', 'USER_ID', 'CALC_ID', 'ADMIN_NAME', 'TRANSFER_SN'], 'string', 'max' => 32],
+            [['ID', 'USER_ID', 'CALC_ID', 'ADMIN_NAME', 'TRANSFER_SN', 'LAST_STAR_LV'], 'string', 'max' => 32],
             [['REMARK'], 'string', 'max' => 255],
             [['ID'], 'unique'],
         ];

+ 1 - 1
common/models/FlowTourismPoints.php

@@ -48,7 +48,7 @@ class FlowTourismPoints extends \common\components\ActiveRecord
             [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
             [['AMOUNT', 'TOTAL'], 'number'],
             [['IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'DELETED', 'DELETED_AT', 'SORT'], 'integer'],
-            [['ID', 'USER_ID', 'CALC_ID', 'ADMIN_NAME', 'TRANSFER_SN'], 'string', 'max' => 32],
+            [['ID', 'USER_ID', 'CALC_ID', 'ADMIN_NAME', 'TRANSFER_SN', 'LAST_STAR_LV'], 'string', 'max' => 32],
             [['REMARK'], 'string', 'max' => 255],
             [['ID'], 'unique'],
         ];