|
|
@@ -493,6 +493,18 @@ class ItemController extends BaseController
|
|
|
} elseif ($requestType == 'part') {
|
|
|
$where['delStatus'] = 0;
|
|
|
$where['status'] = 1;
|
|
|
+ } elseif ($requestType == 'warning') {
|
|
|
+ $where['delStatus'] = 0;
|
|
|
+ unset($where['status']);
|
|
|
+ if ($lookStock == 1) {
|
|
|
+ $where['stock>'] = 0;
|
|
|
+ }
|
|
|
+ if ($lookStock == 2) {
|
|
|
+ $where['stock'] = 0;
|
|
|
+ }
|
|
|
+ if ($onStock == 1) {
|
|
|
+ $where['onStock>'] = 0;
|
|
|
+ }
|
|
|
} else {
|
|
|
util::fail('没有定义的请求方式');
|
|
|
}
|
|
|
@@ -558,7 +570,11 @@ class ItemController extends BaseController
|
|
|
}
|
|
|
|
|
|
$field = '*';
|
|
|
- $result = ProductClass::getList($field, $where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC]);
|
|
|
+ if ($requestType == 'warning') {
|
|
|
+ $result = ProductClass::warningList($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC]);
|
|
|
+ } else {
|
|
|
+ $result = ProductClass::getList($field, $where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC]);
|
|
|
+ }
|
|
|
$list = $result['list'] ?? [];
|
|
|
if ($requestType == 'hasStockList') {
|
|
|
util::fail('无效方式');
|
|
|
@@ -589,12 +605,7 @@ class ItemController extends BaseController
|
|
|
} elseif ($requestType == 'cg') {
|
|
|
$list = ProductClass::cgItemGroup($list, $level);
|
|
|
} elseif ($requestType == 'warning') {
|
|
|
- util::fail('无效方式');
|
|
|
-// $itemInfoData = Product::find()->where("mainId={$this->mainId}")
|
|
|
-// ->andWhere('`stock`+`onStock`<`stockWarning`')
|
|
|
-// ->andWhere("delStatus=0")
|
|
|
-// ->select($field)->asArray()->all();
|
|
|
-// $itemInfoData = ProductClass::warningGroup($itemInfoData, $level);
|
|
|
+ $list = ProductClass::itemListGroup($list, $level);
|
|
|
} else {
|
|
|
util::fail('没有数据');
|
|
|
}
|