|
|
@@ -236,26 +236,26 @@ class GhsController extends BaseController
|
|
|
public function actionDetail()
|
|
|
{
|
|
|
$id = Yii::$app->request->get('id');
|
|
|
- $info = GhsClass::getGhsInfo($id);
|
|
|
- $giveLevel = $info['giveLevel'] ?? 0;
|
|
|
+ $ghsInfo = GhsClass::getGhsInfo($id);
|
|
|
+ $giveLevel = $ghsInfo['giveLevel'] ?? 0;
|
|
|
$levelMap = CustomClass::$nickNameMap;
|
|
|
$giveLevelName = $levelMap[$giveLevel] ?? '散客';
|
|
|
- $info['giveLevelName'] = $giveLevelName;
|
|
|
- GhsClass::valid($info, $this->shopId);
|
|
|
+ $ghsInfo['giveLevelName'] = $giveLevelName;
|
|
|
+ GhsClass::valid($ghsInfo, $this->shopId);
|
|
|
|
|
|
//是否有充值送红包活动
|
|
|
- $ghsShopId = $info['shopId'] ?? 0;
|
|
|
+ $ghsShopId = $ghsInfo['shopId'] ?? 0;
|
|
|
$ghsShop = ShopClass::getById($ghsShopId, true);
|
|
|
- $info['hasRechargeHb'] = $ghsShop->recharge ?? 0;
|
|
|
+ $ghsInfo['hasRechargeHb'] = $ghsShop->recharge ?? 0;
|
|
|
$hb = RechargeHbClass::getByCondition(['shopId' => $ghsShopId, 'delStatus' => 0], true, 'totalHb DESC');
|
|
|
- $info['hasRechargeHbAmount'] = $hb->totalHb ?? 0;
|
|
|
- $info['xrFl'] = $ghsShop->xrFl ?? 0;
|
|
|
- $info['xrFlAmount'] = $ghsShop->xrFlAmount ?? 0;
|
|
|
- $info['tjFl'] = $ghsShop->tjFl ?? 0;
|
|
|
- $info['tjFlAmount'] = $ghsShop->tjFlAmount ?? 0;
|
|
|
- $info['packCost'] = $ghsShop->packCost ? floatval($ghsShop->packCost) : 0;
|
|
|
+ $ghsInfo['hasRechargeHbAmount'] = $hb->totalHb ?? 0;
|
|
|
+ $ghsInfo['xrFl'] = $ghsShop->xrFl ?? 0;
|
|
|
+ $ghsInfo['xrFlAmount'] = $ghsShop->xrFlAmount ?? 0;
|
|
|
+ $ghsInfo['tjFl'] = $ghsShop->tjFl ?? 0;
|
|
|
+ $ghsInfo['tjFlAmount'] = $ghsShop->tjFlAmount ?? 0;
|
|
|
+ $ghsInfo['packCost'] = $ghsShop->packCost ? floatval($ghsShop->packCost) : 0;
|
|
|
$lackExpend = $ghsShop->lackExpend ? floatval($ghsShop->lackExpend) : 0;
|
|
|
- $customId = $info['customId'] ?? 0;
|
|
|
+ $customId = $ghsInfo['customId'] ?? 0;
|
|
|
$needAdd = \bizHd\shop\classes\ShopClass::needAddPackCost($ghsShop, $customId);
|
|
|
//昆明批发,需要算打包费和运费
|
|
|
$needAddPackFreight = 1;
|
|
|
@@ -264,63 +264,64 @@ class GhsController extends BaseController
|
|
|
//昆明批发,不需要算打包费和运费
|
|
|
$needAddPackFreight = 0;
|
|
|
}
|
|
|
- $info['needAddPackFreight'] = $needAddPackFreight;
|
|
|
- $info['lackExpend'] = $lackExpend;
|
|
|
- $info['showSold'] = $ghsShop->showSold ?? 0;
|
|
|
- $info['lsShopId'] = $ghsShop->lsShopId ?? 0;
|
|
|
+ $ghsInfo['needAddPackFreight'] = $needAddPackFreight;
|
|
|
+ $ghsInfo['lackExpend'] = $lackExpend;
|
|
|
+ $ghsInfo['showSold'] = $ghsShop->showSold ?? 0;
|
|
|
+ $ghsInfo['lsShopId'] = $ghsShop->lsShopId ?? 0;
|
|
|
//预订单的最低公斤数和每公斤服务费
|
|
|
- $info['kiloFee'] = $ghsShop->kiloFee ?? 0;
|
|
|
- $info['miniKilo'] = $ghsShop->miniKilo ?? 0;
|
|
|
+ $ghsInfo['kiloFee'] = $ghsShop->kiloFee ?? 0;
|
|
|
+ $ghsInfo['miniKilo'] = $ghsShop->miniKilo ?? 0;
|
|
|
|
|
|
- $info['pfLevel'] = $ghsShop->pfLevel ?? 0;
|
|
|
- $info['afterSale'] = $ghsShop->afterSale ?? 1;
|
|
|
+ $ghsInfo['pfLevel'] = $ghsShop->pfLevel ?? 0;
|
|
|
+ $ghsInfo['afterSale'] = $ghsShop->afterSale ?? 1;
|
|
|
//联系电话
|
|
|
- $info['telephone'] = $ghsShop->telephone ?? '';
|
|
|
+ $ghsInfo['telephone'] = $ghsShop->telephone ?? '';
|
|
|
|
|
|
$shareLogo = imgUtil::groupImg('buy_logo.jpg');
|
|
|
if (!empty($ghsShop->shareLogo)) {
|
|
|
$shareLogo = imgUtil::groupImg($ghsShop->shareLogo);
|
|
|
}
|
|
|
- $info['shareLogo'] = $shareLogo;
|
|
|
- $info['superWx'] = '';
|
|
|
+ $ghsInfo['shareLogo'] = $shareLogo;
|
|
|
+ $ghsInfo['superWx'] = '';
|
|
|
if (!empty($ghsShop->superWx)) {
|
|
|
- $info['superWx'] = imgUtil::groupImg($ghsShop->superWx) . "?x-oss-process=image/resize,w_150";
|
|
|
+ $ghsInfo['superWx'] = imgUtil::groupImg($ghsShop->superWx) . "?x-oss-process=image/resize,w_150";
|
|
|
}
|
|
|
|
|
|
$ghsMainId = $ghsShop->mainId ?? 0;
|
|
|
$kmPackCost = PurchaseClass::getKmPackCost($ghsMainId);
|
|
|
- $info['kmPackCost'] = $kmPackCost;
|
|
|
+ $ghsInfo['kmPackCost'] = $kmPackCost;
|
|
|
|
|
|
- $info['transCost'] = dict::getDict('transCost', null, null, $ghsShop->mainId);
|
|
|
+ $ghsInfo['transCost'] = dict::getDict('transCost', null, null, $ghsShop->mainId);
|
|
|
|
|
|
//杭州斗南鲜花批发 免运费活动
|
|
|
- if (isset($info['shopId']) && $info['shopId'] == 4608) {
|
|
|
+ if (isset($ghsInfo['shopId']) && $ghsInfo['shopId'] == 4608) {
|
|
|
$current = time();
|
|
|
if ($current < strtotime('2023-4-8 00:00:00')) {
|
|
|
- $info['hasAct'] = 1;
|
|
|
+ $ghsInfo['hasAct'] = 1;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 弃用 buyNotice, 使用 xhShopExt 表里的 purchaseGuide
|
|
|
// $info['buyNotice'] = $ghsShop->buyNotice ?? 0;
|
|
|
$shopExt = ShopExtClass::getByCondition(['shopId' => $ghsShopId], false, false, 'purchaseGuide,hcFreeKm,hcMap');
|
|
|
- $info['buyNotice'] = $shopExt['purchaseGuide'] > 0 ? 1 : 0; //兼容原有设定:购买须知 0.没有 1.有
|
|
|
+ $ghsInfo['buyNotice'] = $shopExt['purchaseGuide'] > 0 ? 1 : 0; //兼容原有设定:购买须知 0.没有 1.有
|
|
|
|
|
|
//判断是否开启同城配送功能
|
|
|
$intraCityRet = ShopClass::hasIntraCity($ghsShop);
|
|
|
$openIntraCity = $intraCityRet['openIntraCity'] ?? 0;
|
|
|
- $info['openIntraCity'] = $openIntraCity;
|
|
|
+ $ghsInfo['openIntraCity'] = $openIntraCity;
|
|
|
+
|
|
|
//花材的免费配送设置
|
|
|
$hcFreeKm = $shopExt['hcFreeKm'] ?? 0;
|
|
|
- $info['hcFreeKm'] = $hcFreeKm;
|
|
|
+ $ghsInfo['hcFreeKm'] = $hcFreeKm;
|
|
|
$hcMapString = $shopExt['hcMap'] ?? '';
|
|
|
$hcMap = [];
|
|
|
if (!empty($hcMapString)) {
|
|
|
$hcMap = json_decode($hcMapString, true);
|
|
|
}
|
|
|
- $info['hcMap'] = $hcMap;
|
|
|
+ $ghsInfo['hcMap'] = $hcMap;
|
|
|
|
|
|
- util::success($info);
|
|
|
+ util::success($ghsInfo);
|
|
|
}
|
|
|
|
|
|
//根据门店获取供货商信息 ssh 2021.4.14
|