OSDN Git Service

Изменён тип хранения информации о проинвентаризированных, учтённых, и непроверенных...
[invent/invent.git] / models / ItemsSearch.php
index 91a3a23..b3dbe9a 100644 (file)
@@ -68,7 +68,7 @@ class ItemsSearch extends Items
                 Status::tableName() .     '.name AS statusName ')
             ->joinWith([ 'types', 'moving', 'status', 'locations', 'regions', 'models', ])
             ->where([ 'in', Moving::tableName() . '.id', $query ])
-            ->andWhere([ 'checked' => false ]);
+            ->andWhere([ 'checked' => 0 ]);
 
         $dataProvider = new ActiveDataProvider([
             'query' => $query,
@@ -164,6 +164,9 @@ class ItemsSearch extends Items
 
         $dataProvider = new ActiveDataProvider([
             'query' => $query,
+            'pagination' => [
+                'pageSize' => \Yii::$app->session['pageSize'] ?? 20,
+            ],
         ]);
 
         $dataProvider->setSort([
@@ -186,9 +189,11 @@ class ItemsSearch extends Items
             'id'   => $this->id,
         ])->andFilterWhere([
             'ilike', Status::tableName() .    '.name', $this->statusName
-        ])->andFilterWhere([
+        ])->andFilterWhere([ 'OR', [
             'ilike', Models::tableName() .    '.name', $this->modelName
-        ])->andFilterWhere([
+        ], [
+            'ilike', Items::tableName() .     '.name', $this->modelName
+        ]])->andFilterWhere([
             'ilike', Types::tableName() .     '.name', $this->typeName
         ])->andFilterWhere([ 'OR', [
             'ilike', Locations::tableName() . '.name', $this->regionName