@@ -112,6 +112,11 @@ class ProductController extends BackendController | |||
if ($model->load(Yii::$app->request->post()) && $model->save()) { | |||
$lastProductOrder = Product::find()->orderBy('order DESC')->one() ; | |||
if($lastProductOrder) { | |||
$model->order = $lastProductOrder->order ++ ; | |||
} | |||
Upload::uploadFile($model, 'photo'); | |||
$model->save(); | |||
@@ -69,7 +69,7 @@ class ProductSearch extends Product | |||
'query' => $query, | |||
'sort' => ['attributes' => ['order', 'photo', 'name', 'description','active']], | |||
'pagination' => [ | |||
'pageSize' => 20, | |||
'pageSize' => 1000, | |||
], | |||
]); | |||