shish 5 lat temu
rodzic
commit
a538e429df
1 zmienionych plików z 1 dodań i 1 usunięć
  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([]);