Jelajahi Sumber

季度奖,推送相关

theo 3 tahun lalu
induk
melakukan
48b4545c05

+ 1 - 1
common/helpers/bonus/Calc/PushBaseDataToCalc.php

@@ -482,7 +482,7 @@ class PushBaseDataToCalc extends BaseBusiness
         $currentPeriod = Period::getInfoByPeriodNum($periodNum);
         //判断是否月节点
         if ($currentPeriod['IS_MONTH']) {
-            if (in_array($periodNum, [3,6,9,12])){ // 如果是季度尾
+            if (in_array($currentPeriod['CALC_MONTH'], [3,6,9,12])){ // 如果是季度尾
                 $periodNum = Period::getCurrentQuarterPeriodByPeriodNum($periodNum);
             }else{
                 $periodNum = Period::getCurrentMonthPeriodByPeriodNum($periodNum);

+ 2 - 2
common/models/Period.php

@@ -859,8 +859,8 @@ class Period extends \common\components\ActiveRecord
         $currentYear = $currentPeriod['CALC_YEAR'];
         $currentMonth = $currentPeriod['CALC_MONTH'];
         $periodsArray = self::find()->select("*")
-            ->where(['CALC_YEAR'=>$currentYear,'CALC_MONTH'=>$currentMonth])
-            ->where(['in', 'CALC_MONTH', [$currentMonth-2, $currentMonth-1, $currentMonth]])
+            ->where(['CALC_YEAR'=>$currentYear])
+            ->andWhere(['in', 'CALC_MONTH', [$currentMonth-2, $currentMonth-1, $currentMonth]])
             ->asArray()->all();
         $periods = [];
         foreach ($periodsArray as $p){