فهرست منبع

feat: NC-50: 点服务奖业绩单和奖金计算优化.

zhangl 1 سال پیش
والد
کامیت
bccc65fbc3
2فایلهای تغییر یافته به همراه18 افزوده شده و 2 حذف شده
  1. 6 2
      common/helpers/bonus/BonusCalc.php
  2. 12 0
      common/helpers/bonus/PerfCalc.php

+ 6 - 2
common/helpers/bonus/BonusCalc.php

@@ -859,7 +859,11 @@ class BonusCalc extends BaseObject {
             return false;
         }
         echo sprintf("时间:[%s]店服务奖金计算--紧缩方式,当前offset为:【%s】" . PHP_EOL, date('Y-m-d H:i:s', time()) , $offset);
-        $allData = CalcCache::getHasPerfUsers($this->_periodNum, $offset, $this->_limit);
+//        $allData = CalcCache::getHasPerfUsers($this->_periodNum, $offset, $this->_limit);
+        $allData = StorePerfLog::find()
+            ->where('PERIOD_NUM=:PERIOD_NUM AND CALC_MONTH=:CALC_MONTH', [':PERIOD_NUM' => $this->_periodNum, ':CALC_MONTH' => $this->_calcYearMonth])
+            ->column('USER_ID');
+
         if ($allData) {
             $insertBonusData = [];
             foreach ($allData as $userId) {
@@ -929,7 +933,7 @@ class BonusCalc extends BaseObject {
             }
             CalcBonusST::batchInsert($insertBonusData);
             unset($allData, $insertBonusData);
-            return $this->calcStoreBonusReduce($offset + $this->_limit);
+//            return $this->calcStoreBonusReduce($offset + $this->_limit);
         }
     
         unset($allData);

+ 12 - 0
common/helpers/bonus/PerfCalc.php

@@ -1282,6 +1282,17 @@ class PerfCalc {
         if(!$this->_isCalcMonth){
             return true;
         }
+
+        echo sprintf("时间:[%s]店服务奖业绩计算. " . PHP_EOL, date('Y-m-d H:i:s', time()));
+
+        // 调用店服务奖业绩存储过程
+        $result = \Yii::$app->db->createCommand("CALL CalcBlue(:periodNum)")
+            ->bindValue(':periodNum' , $this->_periodNum )
+            ->execute();
+
+        return $result;
+
+        /**
         echo sprintf("时间:[%s]店服务奖业绩计算,当前offset为:【%s】" . PHP_EOL, date('Y-m-d H:i:s', time()) , $offset);
 
         $allData = PerfOrder::findUseDbCalc()
@@ -1363,6 +1374,7 @@ class PerfCalc {
 
         unset($allData);
         return true;
+        */
     }