|
|
@@ -115,12 +115,23 @@ class ProductController extends BaseController
|
|
|
$type = Yii::$app->request->get('type', '');
|
|
|
$showPage = Yii::$app->request->get('showPage', 0);
|
|
|
if ($showPage) {
|
|
|
- $respond = ProductClass::getList("*", $where, "inTurn desc");
|
|
|
+ if($type=='waring'){
|
|
|
+ $respond = ProductClass::getList("*", $where, "stock asc");
|
|
|
+ }else{
|
|
|
+ $respond = ProductClass::getList("*", $where, "inTurn desc");
|
|
|
+ }
|
|
|
+
|
|
|
$respond['list'] = ProductClass::groupProductInfo($respond['list']);
|
|
|
$respond['list'] = ProductClass::groupClassName($this->sjId, $respond['list']);
|
|
|
util::success($respond);
|
|
|
}
|
|
|
- $data = ProductClass::getAllByCondition($where, ['actualSold' => SORT_DESC, 'inTurn' => SORT_DESC], "*");
|
|
|
+ if($type=='waring'){
|
|
|
+ //库存预警 按库存从小到大排序
|
|
|
+ $data = ProductClass::getAllByCondition($where, ['stock' => SORT_ASC, 'inTurn' => SORT_DESC], "*");
|
|
|
+ }else{
|
|
|
+ $data = ProductClass::getAllByCondition($where, ['actualSold' => SORT_DESC, 'inTurn' => SORT_DESC], "*");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
$data = ProductClass::groupProductInfo($data);
|
|
|
$data = ProductClass::groupClassName($this->sjId, $data);
|