浏览代码

feat: NG-71: 会员奖金计算调整

kevin 1 年之前
父节点
当前提交
79ae1919b4
共有 3 个文件被更改,包括 6 次插入7 次删除
  1. 3 3
      common/models/DealType.php
  2. 1 4
      common/models/UserPerformance.php
  3. 2 0
      common/models/UserPerformanceLogs.php

+ 3 - 3
common/models/DealType.php

@@ -37,9 +37,9 @@ class DealType extends \common\components\ActiveRecord
     CONST DEDUCT_LOGOUT = 'A1F1E76F34EE4981AB3BF4F8D20BB53E';//注销扣除
     CONST RECONSUME_POINTS_EXCHANGE = 'YA627DTHN81OBO7NIQ1OP8N3PGZX5C66';//复消积分兑换
     CONST EXCHANGE_POINTS_EXCHANGE = '316872011148300288';//兑换积分兑换
-    CONST USER_PERFORMANCE_SEND = 'User Performance grant';// 绩效奖金发放
-    CONST USER_PERFORMANCE_EXCHANGE = 'User Performance exchange';// 绩效奖金兑换
-    CONST USER_PERFORMANCE_EXPIRED = 'User Performance expired';// 绩效奖金过期
+    CONST USER_PERFORMANCE_SEND = 'ABN9H5ZW3GEIJTFM';// 绩效奖金发放
+    CONST USER_PERFORMANCE_EXCHANGE = '7XPS0UZ89V2B5DRE';// 绩效奖金兑换
+    CONST USER_PERFORMANCE_EXPIRED = 'SN60AKUHDW8Q91F3';// 绩效奖金过期
 
     /**
      * {@inheritdoc}

+ 1 - 4
common/models/UserPerformance.php

@@ -209,9 +209,6 @@ class UserPerformance extends \common\components\ActiveRecord
         try {
             // 奖金发放
             $id = Tool::generateId();
-
-            LoggerTool::info(['sentUserPerformance', $periodNum, DealType::getDealTypeIdByTag('User Performance grant'), $userId, $amount, $bountyPeriodNum, $id]);
-
             self::insertOne([
                 'ID' => $id,
                 'USER_ID' => $userId,
@@ -221,7 +218,7 @@ class UserPerformance extends \common\components\ActiveRecord
                 'EXPIRED_AT' => date('Y-m-d', strtotime('+1 year', time())),
                 'CREATED_AT' => date('Y-m-d', time()),
                 'UPDATED_AT' => date('Y-m-d', time()),
-                'REMARK' => DealType::getDealTypeIdByTag('User Performance grant'),
+                'REMARK' => DealType::USER_PERFORMANCE_SEND,
                 'BOUNTY_PERIOD_NUM' => $bountyPeriodNum,
                 'PAID_PERIOD_NUM' => $periodNum,
             ]);

+ 2 - 0
common/models/UserPerformanceLogs.php

@@ -14,6 +14,7 @@ use Exception;
  * @property double AMOUNTS
  * @property integer PERIOD_NUM
  * @property integer CREATED_AT
+ * @property integer UPDATED_AT
  * @property string REMARK
  */
 class UserPerformanceLogs extends \common\components\ActiveRecord
@@ -65,6 +66,7 @@ class UserPerformanceLogs extends \common\components\ActiveRecord
         $model->AMOUNTS = $amount;
         $model->PERIOD_NUM = $periodNum;
         $model->CREATED_AT = time();
+        $model->UPDATED_AT = time();
         if(!$model->save()){
             throw new Exception($model->getErrors());
         }