|
@@ -132,7 +132,7 @@ class ProductController extends BaseController
|
|
|
$ids = array_unique($ids);
|
|
$ids = array_unique($ids);
|
|
|
$where['id'] = ['in', $ids];
|
|
$where['id'] = ['in', $ids];
|
|
|
$level = 1;
|
|
$level = 1;
|
|
|
- $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,presellDate,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,presellDate,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|
|
|
$data = ProductService::assembleData($classInfo, $itemInfoData, true);
|
|
$data = ProductService::assembleData($classInfo, $itemInfoData, true);
|
|
@@ -180,46 +180,46 @@ class ProductController extends BaseController
|
|
|
$itemInfoData = [];
|
|
$itemInfoData = [];
|
|
|
if ($requestType == 'hasStockList') {
|
|
if ($requestType == 'hasStockList') {
|
|
|
//有库存的花材列表
|
|
//有库存的花材列表
|
|
|
- $field = 'id,py,name,classId,itemId,price,skPrice,stock';
|
|
|
|
|
|
|
+ $field = 'id,name,classId,itemId,price,skPrice,stock';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
} elseif ($requestType == 'changePrice') {
|
|
} elseif ($requestType == 'changePrice') {
|
|
|
//修改价格列表
|
|
//修改价格列表
|
|
|
- $field = 'id,py,cover,name,cost,itemId,classId,addPrice,skPrice,discountPrice,skMore,variety,price,stock,presell';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,cost,itemId,classId,addPrice,skPrice,discountPrice,skMore,variety,price,stock,presell';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::changePriceGroup($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::changePriceGroup($itemInfoData, $level);
|
|
|
} elseif ($requestType == 'kd') {
|
|
} elseif ($requestType == 'kd') {
|
|
|
//开单的花材列表
|
|
//开单的花材列表
|
|
|
- $field = 'id,py,cover,name,cost,itemId,classId,skPrice,variety,price,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,cost,itemId,classId,skPrice,variety,price,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::kdItemGroup($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::kdItemGroup($itemInfoData, $level);
|
|
|
} elseif ($requestType == 'itemList') {
|
|
} elseif ($requestType == 'itemList') {
|
|
|
//花材列表
|
|
//花材列表
|
|
|
- $field = 'id,py,cover,name,cost,itemId,classId,skPrice,variety,price,stock,actualSold,stockWarning,presell';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,cost,itemId,classId,skPrice,variety,price,stock,actualSold,stockWarning,presell';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::itemListGroup($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::itemListGroup($itemInfoData, $level);
|
|
|
} elseif ($requestType == 'check') {
|
|
} elseif ($requestType == 'check') {
|
|
|
//盘点花材列表
|
|
//盘点花材列表
|
|
|
- $field = 'id,py,cover,name,itemId,classId,variety,price,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,itemId,classId,variety,price,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::checkItemGroup($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::checkItemGroup($itemInfoData, $level);
|
|
|
} elseif ($requestType == 'break') {
|
|
} elseif ($requestType == 'break') {
|
|
|
//报损花材
|
|
//报损花材
|
|
|
- $field = 'id,py,cover,name,itemId,classId,variety,price,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,itemId,classId,variety,price,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::breakItemGroup($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::breakItemGroup($itemInfoData, $level);
|
|
|
} elseif ($requestType == 'stockOut') {
|
|
} elseif ($requestType == 'stockOut') {
|
|
|
//出库花材
|
|
//出库花材
|
|
|
- $field = 'id,py,cover,name,itemId,classId,variety,price,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,itemId,classId,variety,price,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::stockOutGroup($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::stockOutGroup($itemInfoData, $level);
|
|
|
} elseif ($requestType == 'cg') {
|
|
} elseif ($requestType == 'cg') {
|
|
|
//采购花材
|
|
//采购花材
|
|
|
- $field = 'id,py,cover,name,itemId,classId,variety,price,stock,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,itemId,classId,variety,price,stock,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::cgItemGroup($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::cgItemGroup($itemInfoData, $level);
|
|
|
} elseif ($requestType == 'warning') {
|
|
} elseif ($requestType == 'warning') {
|
|
|
//库存预警
|
|
//库存预警
|
|
|
- $field = 'id,py,cover,name,cost,itemId,classId,skPrice,variety,price,stock,presell,stockWarning';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,cost,itemId,classId,skPrice,variety,price,stock,presell,stockWarning';
|
|
|
$itemInfoData = Product::find()->where("mainId={$this->mainId}")
|
|
$itemInfoData = Product::find()->where("mainId={$this->mainId}")
|
|
|
->andWhere('`stock`<`stockWarning`')
|
|
->andWhere('`stock`<`stockWarning`')
|
|
|
->andWhere("delStatus=0")
|
|
->andWhere("delStatus=0")
|
|
@@ -255,7 +255,7 @@ class ProductController extends BaseController
|
|
|
$ids = array_unique($ids);
|
|
$ids = array_unique($ids);
|
|
|
$where['id'] = ['in', $ids];
|
|
$where['id'] = ['in', $ids];
|
|
|
$level = 1;
|
|
$level = 1;
|
|
|
- $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,presellDate,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,itemId,classId,variety,price,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|
|
|
$data = ProductService::assembleItemData($classInfo, $itemInfoData);
|
|
$data = ProductService::assembleItemData($classInfo, $itemInfoData);
|
|
@@ -302,13 +302,13 @@ class ProductController extends BaseController
|
|
|
|
|
|
|
|
if ($warning == 1) {
|
|
if ($warning == 1) {
|
|
|
//库存预警
|
|
//库存预警
|
|
|
- $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,presellDate,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,presellDate,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
$itemInfoData = Product::find()->where("mainId={$this->mainId}")
|
|
$itemInfoData = Product::find()->where("mainId={$this->mainId}")
|
|
|
->andWhere('`stock`<`stockWarning`')
|
|
->andWhere('`stock`<`stockWarning`')
|
|
|
->andWhere("delStatus=0")
|
|
->andWhere("delStatus=0")
|
|
|
->select($field)->asArray()->all();
|
|
->select($field)->asArray()->all();
|
|
|
} else {
|
|
} else {
|
|
|
- $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,presellDate,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
|
|
|
|
+ $field = 'id,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,presellDate,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
}
|
|
}
|
|
|
$itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|
|
$itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|