|
|
@@ -192,8 +192,8 @@ class ProductController extends BaseController
|
|
|
$pyName = strtolower($py);
|
|
|
$where['py'] = $pyName;
|
|
|
}
|
|
|
- //改价和全部库存列表
|
|
|
- if ($requestType == 'hasStock') {
|
|
|
+ //改价和全部有库存花材列表
|
|
|
+ if ($requestType == 'changePrice' || $requestType == 'hasStockList') {
|
|
|
$where['stock>'] = 0;
|
|
|
}
|
|
|
if (!empty($status)) {
|
|
|
@@ -218,12 +218,17 @@ class ProductController extends BaseController
|
|
|
->select($field)->asArray()->all();
|
|
|
} else {
|
|
|
if ($requestType == 'common') {
|
|
|
- //通用
|
|
|
+ //通用花材列表
|
|
|
+ $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
+ $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
+ $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|
|
|
+ } elseif ($requestType == 'hasStockList') {
|
|
|
+ //有库存的花材列表
|
|
|
$field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|
|
|
- } elseif ($requestType == 'hasStock') {
|
|
|
- //修改价格和有库存的花材列表
|
|
|
+ } elseif ($requestType == 'changePrice') {
|
|
|
+ //修改价格列表
|
|
|
$field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|