shish 5 лет назад
Родитель
Сommit
a538e429df
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      app-ghs/controllers/ProductController.php

+ 1 - 1
app-ghs/controllers/ProductController.php

@@ -123,7 +123,7 @@ class ProductController extends BaseController
         $showPage = Yii::$app->request->get('showPage', 0);
         if ($showPage) {
             if ($type == 'waring') {
-                $pro = Product::find()->where("shopId={$shopId}")->andWhere('`stock`<`stockWarning`')->select('id')->asArray()->all();
+                $pro = Product::find()->where("shopId={$shopId}")->andWhere('`stock`<`stockWarning`')->select('id')->orderBy('actualSold desc')->asArray()->all();
                 $lackIds = array_column($pro, 'id');
                 if (empty($lackIds)) {
                     util::success([]);