|
|
@@ -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");
|
|
|
}
|