瀏覽代碼

显示顺序

root 3 年之前
父節點
當前提交
830664ddca
共有 3 個文件被更改,包括 45 次插入25 次删除
  1. 4 4
      common/helpers/bonus/CalcServeBonusCalc.php
  2. 2 2
      common/helpers/bonus/CalcServePerfCalc.php
  3. 39 19
      common/models/ServeLog.php

+ 4 - 4
common/helpers/bonus/CalcServeBonusCalc.php

@@ -149,7 +149,7 @@ class CalcServeBonusCalc extends BaseObject {
                 Period::updateCalcProcess(4, $this->_periodNum);
             }
             // 日志----记录开始
-            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '开始奖金计算');
+            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '开始奖金计算', 3000);
             // 设置结算状态
             $this->setCalcStatus('start');
             // 清空所有本期结算用到的缓存
@@ -219,7 +219,7 @@ class CalcServeBonusCalc extends BaseObject {
             // 日志----团队奖数据
             ServeLog::bonusQYData($this->_periodNum, $this->_calcYearMonth);
             // 日志----团队奖计算会更新期业绩结余业绩字段
-            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '更新期业绩表市场结余业绩完成AR_PERF_PERIOD');
+            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '更新期业绩表市场结余业绩完成AR_PERF_PERIOD', 3700);
             $t8 = microtime(true);
             echo('计算团队奖'.($this->_sysConfig['openQY']['VALUE']?'完成':'关闭').',耗时:' . round($t8 - $t7, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
             $this->_updatePercent(35);
@@ -267,7 +267,7 @@ class CalcServeBonusCalc extends BaseObject {
             $this->_updatePercent(75);
             $t30 = microtime(true);
             // 日志----奖金写库
-            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '写入奖金汇总表并计算管理费和复消积分');
+            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '写入奖金汇总表并计算管理费和复消积分', 4100);
             // 日志----写库数据统计
             ServeLog::bonusData($this->_periodNum, $this->_calcYearMonth);
             echo('奖金写库操作完成,耗时:' . round($t30 - $t25, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
@@ -276,7 +276,7 @@ class CalcServeBonusCalc extends BaseObject {
             $this->_updatePercent(100);
             $t35 = microtime(true);
             // 日志----计算完成
-            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '奖金计算完成');
+            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '奖金计算完成', 4300);
             echo('结算全部完成,共耗时:' . round($t35 - $t1, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
         } catch (\Exception $e) {
             $this->errorCalcTask();

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

@@ -118,7 +118,7 @@ class CalcServePerfCalc {
             
             //七、 添加缓存中用户数据
             // 日志----开始缓存用户
-            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '缓存用户信息-开始');
+            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '缓存用户信息-开始', 400);
             CalcCache::addUsers($this->_periodNum);
             // 日志----缓存用户结束
             ServeLog::cacheUserTotal($this->_periodNum, $this->_calcYearMonth);
@@ -164,7 +164,7 @@ class CalcServePerfCalc {
             //日志----记录期业绩表活跃多少人
             ServeLog::perfPeriodActive($this->_periodNum, $this->_calcYearMonth);
             echo(date('Y-m-d H:i:s',time()).'计算业绩业绩结算全部完成,共耗时:' . round($t9 - $t1, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '业绩计算完毕');
+            ServeLog::noParamsLog($this->_periodNum, $this->_calcYearMonth, '业绩计算完毕', 900);
         } catch (\Exception $e) {
             $this->errorCalcTask();
             var_dump($e->getMessage());

+ 39 - 19
common/models/ServeLog.php

@@ -55,13 +55,16 @@ class ServeLog extends \common\components\ActiveRecord
      * 无逻辑日志,直接传文案
      * @param int $periodNum
      * @param int $calcMonth 业绩期
+     * @param string $desc 文案
+     * @param int $sort 展示顺序,太快用时间戳判断不出来
      */
-    public static function noParamsLog($periodNum, $calcMonth, $desc) {
+    public static function noParamsLog($periodNum, $calcMonth, $desc, $sort) {
         $logData[] = [
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => $sort
         ];
 
         ServeLog::batchInsert($logData);
@@ -79,7 +82,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => "期数:$periodNum,结算年月:$calcMonth,开始计算业绩",
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 100
         ];
 
         ServeLog::batchInsert($logData);
@@ -111,7 +115,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 200
         ];
 
         ServeLog::batchInsert($logData);
@@ -135,7 +140,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 300
         ];
 
         ServeLog::batchInsert($logData);
@@ -166,7 +172,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 500
         ];
 
         ServeLog::batchInsert($logData);
@@ -191,7 +198,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 600
         ];
 
         ServeLog::batchInsert($logData);
@@ -216,7 +224,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 700
         ];
 
         ServeLog::batchInsert($logData);
@@ -240,7 +249,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 800
         ];
 
         ServeLog::batchInsert($logData);
@@ -276,7 +286,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 3100
         ];
 
         ServeLog::batchInsert($logData);
@@ -309,7 +320,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 3200
         ];
 
         ServeLog::batchInsert($logData);
@@ -334,7 +346,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 3300
         ];
 
         ServeLog::batchInsert($logData);
@@ -359,7 +372,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 3400
         ];
 
         ServeLog::batchInsert($logData);
@@ -384,7 +398,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 3500
         ];
 
         ServeLog::batchInsert($logData);
@@ -453,7 +468,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 3600
         ];
 
         ServeLog::batchInsert($logData);
@@ -488,7 +504,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 3800
         ];
 
         ServeLog::batchInsert($logData);
@@ -523,7 +540,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 3900
         ];
 
         ServeLog::batchInsert($logData);
@@ -558,7 +576,8 @@ class ServeLog extends \common\components\ActiveRecord
         //     'PERIOD_NUM' => $periodNum,
         //     'CALC_MONTH' => $calcMonth,
         //     'LOG_DESCRIBE' => $desc,
-        //     'CREATE_AT' => time()
+        //     'CREATE_AT' => time(),
+        //     'RECORD_SORT' => 4000
         // ];
 
         // ServeLog::batchInsert($logData);
@@ -603,7 +622,8 @@ class ServeLog extends \common\components\ActiveRecord
             'PERIOD_NUM' => $periodNum,
             'CALC_MONTH' => $calcMonth,
             'LOG_DESCRIBE' => $desc,
-            'CREATE_AT' => time()
+            'CREATE_AT' => time(),
+            'RECORD_SORT' => 4200
         ];
 
         ServeLog::batchInsert($logData);