Browse Source

feat: UN-71: 奖金管理-封期管理:结算按钮规则调整.

kevin 1 year ago
parent
commit
45231aa5b5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      common/components/ActiveRecord.php

+ 2 - 1
common/components/ActiveRecord.php

@@ -281,6 +281,7 @@ class ActiveRecord extends \yii\db\ActiveRecord {
      * @return array
      */
     public static function lists($condition = '', $params = [], $argv = []) {
+        $limit = $argv['limit'] ?? 0;
         self::prepare($condition, $params, $argv, true);
         unset($condition, $params, $argv);
         $countQuery = clone self::$query;
@@ -291,7 +292,7 @@ class ActiveRecord extends \yii\db\ActiveRecord {
         if(self::$argv['page'] !== null){
             $pagination->setPage(self::$argv['page']);
         }
-        self::$query->offset($pagination->offset)->limit($pagination->limit);
+        self::$query->offset($pagination->offset)->limit($limit ?: $pagination->limit);
         if(self::$argv['asArray']){
             self::$query->asArray();
         }