GhsProductController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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\admin\classes\AdminClass;
  9. use bizGhs\item\classes\ItemClass;
  10. use bizGhs\item\classes\ItemClassClass;
  11. use bizGhs\product\classes\ProductClass;
  12. use bizGhs\product\services\ProductService;
  13. use bizGhs\item\services\ItemService;
  14. use common\components\util;
  15. use Yii;
  16. class GhsProductController extends BaseController
  17. {
  18. //零售进店采购
  19. public function actionIndex()
  20. {
  21. $get = Yii::$app->request->get();
  22. $shopId = $get['shopId']??0;
  23. $sjId = $get['sjId']??0;
  24. //获取所有当前供货商的分类 (全部、常用)
  25. //根据分类组装分类下的花材信息
  26. //中央ID
  27. $classIds = ItemClassClass::getGhsItemClassAll($this->mainId);
  28. // $where['sjId'] = $sjId;
  29. // $where['shopId'] = $shopId;
  30. $where['mainId'] = $this->mainId;
  31. $where['delStatus'] = 0;
  32. $itemInfoData = ProductClass::getAllByCondition($where,['actualSold'=>SORT_DESC,'inTurn'=>SORT_DESC],"*");
  33. $itemInfoData = ProductClass::groupProductInfo($itemInfoData);
  34. $data = ProductService::assembleData($classIds, $itemInfoData, true);
  35. ShopService::totalViewPlus($shopId);
  36. util::success($data);
  37. }
  38. }