GhsProductController.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * User: admin
  4. * Date Time: 2021/3/2 14:33
  5. */
  6. namespace hd\controllers;
  7. use biz\shop\services\ShopService;
  8. use bizGhs\item\classes\ItemClassClass;
  9. use bizGhs\product\classes\ProductClass;
  10. use bizGhs\product\services\ProductService;
  11. use common\components\util;
  12. use Yii;
  13. class GhsProductController extends BaseController
  14. {
  15. //零售进店采购
  16. public function actionIndex()
  17. {
  18. $get = Yii::$app->request->get();
  19. $shopId = $get['shopId']??0;
  20. $classIds = ItemClassClass::getGhsItemClassAll($this->mainId);
  21. $where['mainId'] = $this->mainId;
  22. $where['delStatus'] = 0;
  23. $itemInfoData = ProductClass::getAllByCondition($where,['actualSold'=>SORT_DESC,'inTurn'=>SORT_DESC],"*");
  24. $itemInfoData = ProductClass::groupProductInfo($itemInfoData);
  25. $respond = ProductService::assembleData($classIds, $itemInfoData, true);
  26. $classItem = $respond['classItem'] ?? [];
  27. ShopService::totalViewPlus($shopId);
  28. util::success($classItem);
  29. }
  30. }