shish 5 tahun lalu
induk
melakukan
a538e429df
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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);
         $showPage = Yii::$app->request->get('showPage', 0);
         if ($showPage) {
         if ($showPage) {
             if ($type == 'waring') {
             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');
                 $lackIds = array_column($pro, 'id');
                 if (empty($lackIds)) {
                 if (empty($lackIds)) {
                     util::success([]);
                     util::success([]);