| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- /**
- * User: admin
- * Date Time: 2021/3/2 14:33
- */
- namespace hd\controllers;
- use biz\shop\services\ShopService;
- use bizGhs\admin\classes\AdminClass;
- use bizGhs\item\classes\ItemClass;
- use bizGhs\item\classes\ItemClassClass;
- use bizGhs\product\classes\ProductClass;
- use bizGhs\product\services\ProductService;
- use bizGhs\item\services\ItemService;
- use common\components\util;
- use Yii;
- class GhsProductController extends BaseController
- {
- //零售进店采购
- public function actionIndex()
- {
- $get = Yii::$app->request->get();
- $shopId = $get['shopId']??0;
- $sjId = $get['sjId']??0;
- //获取所有当前供货商的分类 (全部、常用)
- //根据分类组装分类下的花材信息
- //中央ID
- $classIds = ItemClassClass::getGhsItemClassAll($this->mainId);
- // $where['sjId'] = $sjId;
- // $where['shopId'] = $shopId;
- $where['mainId'] = $this->mainId;
- $where['delStatus'] = 0;
- $itemInfoData = ProductClass::getAllByCondition($where,['actualSold'=>SORT_DESC,'inTurn'=>SORT_DESC],"*");
- $itemInfoData = ProductClass::groupProductInfo($itemInfoData);
- $data = ProductService::assembleData($classIds, $itemInfoData, true);
- ShopService::totalViewPlus($shopId);
- util::success($data);
- }
- }
|