Browse Source

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

kevin 1 year ago
parent
commit
c86e82b788

+ 3 - 3
backendApi/modules/v1/controllers/CalcController.php

@@ -343,12 +343,12 @@ class CalcController extends BaseController
      */
     public function actionRecordList()
     {
-        $filter    = $this->filterCondition([
-            'periodNum' => 'PERIOD_NUM',
+        $filter = $this->filterCondition([
+            'CALC_ID' => 'PERIOD_NUM',
         ]);
         $condition = $filter['condition'];
         $params    = $filter['params'];
-        $data      = CalcRecord::lists($condition, $params, ['orderBy' => 'CREATED_AT DESC , ID DESC']);
+        $data      = CalcRecord::lists($condition, $params, ['orderBy' => 'CREATEd_TIME DESC']);
         return static::notice($data);
     }
 

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

@@ -346,6 +346,7 @@ class BonusSend extends BaseObject {
                     }
 
                     // 把记录标记为已发放状态
+                    Period::updateAll(['IS_SENT' => 1, 'SENT_AT' => Date::nowTime()], 'PERIOD_NUM=:PERIOD_NUM', [':PERIOD_NUM' => $data['PERIOD_NUM']]);
                     CalcBonus::updateAll(['IS_SENT' => 1, 'SENT_AT' => Date::nowTime()], 'ID=:ID', [':ID' => $data['ID']]);
 
                     unset($periodAmount, $key, $data);

+ 2 - 2
common/models/CalcRecord.php

@@ -5,7 +5,7 @@ namespace common\models;
 use Yii;
 
 /**
- * This is the model class for table "{{%CALC_RECORD}}".
+ * This is the model class for table "{{%CALC_BE_LOG}}".
  *
  * @property string $ID
  * @property string $PERIOD_NUM 周期
@@ -19,7 +19,7 @@ class CalcRecord extends \common\components\ActiveRecord
      */
     public static function tableName()
     {
-        return '{{%CALC_RECORD}}';
+        return '{{%CALC_BE_LOG}}';
     }
 
     /**