|
|
@@ -109,36 +109,6 @@ class ProductController extends BaseController
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
- //取出今天有入库的花材 ssh 20221224
|
|
|
- public function actionGetStockIn()
|
|
|
- {
|
|
|
- $py = Yii::$app->request->get('py', '');
|
|
|
- $version = Yii::$app->request->get('version', 0);
|
|
|
- if ($version == 0) {
|
|
|
- util::fail('请先升级版本到1.0.70以上');
|
|
|
- }
|
|
|
- $classInfo = ItemClassClass::getGhsItemClassAll($this->mainId);
|
|
|
- $mainId = $this->mainId ?? 0;
|
|
|
- $where['mainId'] = $mainId;
|
|
|
- if ($py) {
|
|
|
- $pyName = strtolower($py);
|
|
|
- $where['py'] = $pyName;
|
|
|
- }
|
|
|
- $arr = StockInDayClass::getAllByCondition(['mainId' => $mainId], null, '*');
|
|
|
- if (empty($arr)) {
|
|
|
- util::fail('没有花材需要盘点');
|
|
|
- }
|
|
|
- $ids = array_column($arr, 'itemId');
|
|
|
- $ids = array_unique($ids);
|
|
|
- $where['id'] = ['in', $ids];
|
|
|
- $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';
|
|
|
- $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
- $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|
|
|
- $data = ProductService::assembleItemData($classInfo, $itemInfoData);
|
|
|
- util::success($data);
|
|
|
- }
|
|
|
-
|
|
|
//取出今天有入库的花材 ssh 20221024
|
|
|
public function actionStockIn()
|
|
|
{
|
|
|
@@ -221,6 +191,11 @@ class ProductController extends BaseController
|
|
|
$field = 'id,py,cover,name,cost,itemId,classId,skPrice,variety,price,stock,presell';
|
|
|
$itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
$itemInfoData = ProductClass::itemListGroup($itemInfoData, $level);
|
|
|
+ } elseif ($requestType == 'check') {
|
|
|
+ //采购花材
|
|
|
+ $field = 'id,py,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::checkItemGroup($itemInfoData, $level);
|
|
|
} elseif ($requestType == 'cg') {
|
|
|
//采购花材
|
|
|
$field = 'id,py,cover,name,itemId,classId,variety,price,stock,presell,ratioType,smallUnit,bigUnit,ratio';
|
|
|
@@ -244,6 +219,36 @@ class ProductController extends BaseController
|
|
|
util::success($data);
|
|
|
}
|
|
|
|
|
|
+ //取出今天有入库的花材 ssh 20221224
|
|
|
+ public function actionGetStockIn()
|
|
|
+ {
|
|
|
+ $py = Yii::$app->request->get('py', '');
|
|
|
+ $version = Yii::$app->request->get('version', 0);
|
|
|
+ if ($version == 0) {
|
|
|
+ util::fail('请先升级版本到1.0.70以上');
|
|
|
+ }
|
|
|
+ $classInfo = ItemClassClass::getGhsItemClassAll($this->mainId);
|
|
|
+ $mainId = $this->mainId ?? 0;
|
|
|
+ $where['mainId'] = $mainId;
|
|
|
+ if ($py) {
|
|
|
+ $pyName = strtolower($py);
|
|
|
+ $where['py'] = $pyName;
|
|
|
+ }
|
|
|
+ $arr = StockInDayClass::getAllByCondition(['mainId' => $mainId], null, '*');
|
|
|
+ if (empty($arr)) {
|
|
|
+ util::fail('没有花材需要盘点');
|
|
|
+ }
|
|
|
+ $ids = array_column($arr, 'itemId');
|
|
|
+ $ids = array_unique($ids);
|
|
|
+ $where['id'] = ['in', $ids];
|
|
|
+ $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';
|
|
|
+ $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
+ $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
|
|
|
+ $data = ProductService::assembleItemData($classInfo, $itemInfoData);
|
|
|
+ util::success($data);
|
|
|
+ }
|
|
|
+
|
|
|
//按分类列出所有花材
|
|
|
public function actionIndex()
|
|
|
{
|