mainId; $classId = Yii::$app->request->get('classId', 0); if (!empty($classId)) { $where['classId'] = $classId; } $status = Yii::$app->request->get('status', 0); if (!empty($status)) { $where['status'] = $status; } $delStatus = Yii::$app->request->get('delStatus', 0); if ($delStatus != 2) { $where['delStatus'] = $delStatus; } //输出标准会员价,即批发价,默认显示的是批发价 $level = 0; $data = ProductClass::getAllByCondition($where, ['actualSold' => SORT_DESC, 'inTurn' => SORT_DESC], "*"); $data = ProductClass::groupProductInfo($data, $level); util::success(['list' => $data]); } //散客查看花材详情 ssh 20230109 public function actionGetMallItemInfo() { $get = Yii::$app->request->get(); $id = $get['id'] ?? 0; $item = ItemClass::getById($id); $discountPrice = $item['discountPrice'] ?? 0; if ($discountPrice > 0) { $skDiscountPrice = $item['skDiscountPrice'] ?? 0; $item['skPrice'] = $skDiscountPrice; } $presell = $item['presell'] ?? 0; if ($presell == 1) { $preSellDate = $item['presellDate'] ?? ''; $preSellDateShow = []; if (!empty($preSellDate)) { $dateArr = explode(',', trim($preSellDate)); if (!empty($dateArr)) { foreach ($dateArr as $sellTime) { $showDate = date("n月j日", $sellTime); $preSellDateShow[] = $showDate; } } } $item['presellDateShow'] = $preSellDateShow; } $shortCover = $item['cover'] ?? ''; $cover = imgUtil::groupImg($shortCover); $item['shortCover'] = $shortCover; $item['bigCover'] = $cover . "?x-oss-process=image/resize,m_fill,h_700,w_700"; $item['cover'] = $cover . "?x-oss-process=image/resize,m_fill,h_100,w_100"; util::success(['info' => $item]); } //扫码看价格 ssh 20221008 public function actionShowInfo() { $get = Yii::$app->request->get(); $id = $get['id'] ?? 0; $item = ItemClass::getById($id, true); if (empty($item)) { util::stop(''); } if (isset($item->skDiscountPrice) && $item->skDiscountPrice > 0) { $skPrice = $item->skDiscountPrice; } else { $skPrice = $item->skPrice ?? 0; } $skPrice = floatval($skPrice); $name = $item->name ?? ''; $classId = $item->classId ?? 0; $class = ItemClassClass::getById($classId, true); $className = $class->name ?? ''; echo '
' . $name . '
'; echo '
' . $skPrice . '元
'; echo '
' . $className . '
'; } public function actionIndex() { $py = Yii::$app->request->get('py', ''); //默认显示上架商品 $status = Yii::$app->request->get('status', 1); //默认显示未删除商品 $delStatus = Yii::$app->request->get('delStatus', 0); $shop = $this->shop; if (isset($shop->ptStyle) == false || $shop->ptStyle != 1) { util::fail('访问门店出错了'); } //普莲花艺、叶上花、丰行、小武鲜花、九江云朵、源花汇不能在花卉宝下单,多处要同步修改,关键词ls_mall_not_open $mainId = $this->mainId; if (getenv('YII_ENV') == 'production') { if (in_array($mainId, [40057, 7779, 42940, 26374,10536])) { util::fail('暂时无法访问'); } } else { if (in_array($mainId, [0, 1])) { util::fail('暂时无法访问'); } } //获取所有当前供货商的分类 (全部、常用) //根据分类组装分类下的花材信息 //中央ID $classIds = ItemClassClass::getGhsItemClassAll($this->mainId); $where['mainId'] = $this->mainId; if ($py) { $pyName = strtolower($py); $where['py'] = $pyName; } if (!empty($status)) { $where['status'] = $status; } $where['delStatus'] = $delStatus; $where['frontHide'] = 0; $level = 0; $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], "*"); $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level); $respond = ProductService::assembleData($classIds, $itemInfoData, true); $data = $respond['classItem'] ?? []; CustomClass::buildRelation($this->shop, $this->user); util::success($data); } }