shopId; $respond = GhsClass::getGhsList($where); util::success($respond); } //详情 shish 2021.4.11 public function actionDetail() { $id = Yii::$app->request->get('id'); $info = GhsClass::getGhsInfo($id); $giveLevel = $info['giveLevel'] ?? 0; $levelMap = CustomClass::$levelMap; $giveLevelName = $levelMap[$giveLevel] ?? '普通'; $info['giveLevelName'] = $giveLevelName; GhsClass::valid($info, $this->shopId); //是否有充值送红包活动 $ghsShopId = $info['shopId'] ?? 0; $ghsShop = ShopClass::getById($ghsShopId, true); $info['hasRechargeHb'] = $ghsShop->recharge ?? 0; $hb = RechargeHbClass::getByCondition(['shopId' => $ghsShopId, 'delStatus' => 0], true, 'totalHb DESC'); $info['hasRechargeHbAmount'] = $hb->totalHb ?? 0; util::success($info); } //根据门店获取供应商信息 shish 2021.4.14 public function actionInfo() { $shopId = Yii::$app->request->get('shopId'); if (isset($this->shopId) && !empty($this->shopId)) { $ghs = GhsClass::build($shopId, $this->shopId); //是否有充值送红包活动 $ghsShopId = $ghs['shopId'] ?? 0; $ghsShop = ShopClass::getById($ghsShopId, true); $ghs['hasRechargeHb'] = $ghsShop->recharge ?? 0; $hb = RechargeHbClass::getByCondition(['shopId' => $ghsShopId, 'delStatus' => 0], true, 'totalHb DESC'); $ghs['hasRechargeHbAmount'] = $hb->totalHb ?? 0; $map = CustomClass::$levelMap; $giveLevel = $ghs['giveLevel'] ?? 0; $ghs['giveLevelName'] = $map[$giveLevel] ?? ''; } else { //没有开店也给显示供应商信息 $shop = ShopClass::getShopInfo($shopId); $shopName = $shop['shopName'] ?? ''; $sjName = $shop['merchantName'] ?? ''; $default = $shop['default'] ?? 0; $name = $default == 1 ? $sjName : $sjName . ' ' . $shopName; $ghs = [ 'id' => 0, 'name' => $name, 'debtAmount' => 0.00, 'expendAmount' => 0.00, 'giveLevel' => 0, 'giveLevelName' => '普通', ]; } util::success($ghs); } }