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

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

@@ -123,14 +123,14 @@ 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')->orderBy('actualSold desc')->asArray()->all();
+                $pro = Product::find()->where("shopId={$shopId}")->andWhere('`stock`<`stockWarning`')->select('id')->asArray()->all();
                 $lackIds = array_column($pro, 'id');
                 if (empty($lackIds)) {
                     util::success([]);
                 }
                 $lackIds = array_filter(array_unique($lackIds));
                 $where['id'] = ['in', $lackIds];
-                $respond = ProductClass::getList("*", $where, "stock asc");
+                $respond = ProductClass::getList("*", $where, "actualSold asc");
             } else {
                 $respond = ProductClass::getList("*", $where, "inTurn desc");
             }