request->get(); $id = $get['id'] ?? 0; $hd = HdClass::getById($id, true); if (empty($hd)) { util::fail('没有花店信息'); } if ($hd['userId'] != $this->userId) { util::fail('不是你的店'); } $hd->delStatus = 0; $hd->save(); util::complete('已恢复'); } public function actionDel() { $get = Yii::$app->request->get(); $id = $get['id'] ?? 0; $hd = HdClass::getById($id, true); if (empty($hd)) { util::fail('没有花店信息'); } if ($hd['userId'] != $this->userId) { util::fail('不是你的店'); } $hd->delStatus = 1; $hd->save(); util::complete('删除成功'); } //花店详情 ssh 20250627 public function actionDetail() { $get = Yii::$app->request->get(); $id = $get['id'] ?? 0; $hd = HdClass::getById($id); if (empty($hd)) { util::fail('没有花店信息'); } if ($hd['userId'] != $this->userId) { util::fail('不是你的店'); } $shortAvatar = !empty($val['avatar']) ? $val['avatar'] : 'hhb_small.png'; $smallAvatar = imgUtil::groupImg($shortAvatar) . "?x-oss-process=image/resize,m_fill,h_130,w_130"; $bigAvatar = imgUtil::groupImg($shortAvatar) . "?x-oss-process=image/resize,m_fill,h_700,w_700"; $hd['shortAvatar'] = $shortAvatar; $hd['smallAvatar'] = $smallAvatar; $hd['bigAvatar'] = $bigAvatar; util::success($hd); } //花店信息 ssh 20230111 public function actionInfo() { $get = Yii::$app->request->get(); $id = $get['id'] ?? 0; $user = $this->user; $shop = $this->shop; if (empty($user)) { $hd = []; if (!empty($shop)) { $sjName = $shop->merchantName ?? ''; $name = $shop->shopName == '首店' ? $sjName : $sjName . ' ' . $shop->shopName; $hd = ['name' => $name]; } $custom = []; util::success(['hd' => $hd, 'custom' => $custom]); } else { if (empty($id)) { $respond = CustomClass::buildRelation($shop, $user); $hd = $respond['hd']; $custom = $respond['custom']; } else { $hd = HdClass::getById($id, true); $customId = $hd->customId; $custom = \bizMall\custom\classes\CustomClass::getById($customId, true); } $itemType = ''; $itemList = []; // 根据 xhShop 中的 `rechargeWeal`来选择返回快捷充值选项 if ($shop->rechargeWeal == 1) { $itemType = 'money'; //送钱 $weal = RechargeSqClass::getAllByCondition(['mainId' => $shop->mainId], 'recharge asc', '*', null, true); if (!empty($weal)) { foreach ($weal as $key => $val) { $recharge = floatval($val->recharge); $give = floatval($val->give); $itemList[] = ['recharge' => $recharge, 'give' => $give]; } } } else if ($shop->rechargeWeal == 2 || $shop->rechargeWeal == 3) { $itemType = 'hb'; //送红包 $itemList = RechargeShbClass::getList('*', ['shopId' => $shop->id]); } util::success(['hd' => $hd, 'custom' => $custom, 'itemType' => $itemType, 'itemList' => $itemList]); } } public function actionList() { $get = Yii::$app->request->get(); $delStatus = $get['delStatus'] ?? 0; $userId = $this->userId; $respond = ['list' => [],'moreData'=>0,'totalNum'=>0,'totalPage'=>0]; if ($userId > 0) { $mallUpgrading = getenv('MALL_UPGRADING') == false ? 0 : getenv('MALL_UPGRADING'); if ($mallUpgrading == 1) { $allowShopAdminIdsStr = getenv('MALL_UPGRADE_ALLOW_USER_IDS') ?: ''; $allowShopAdminIds = !empty($allowShopAdminIdsStr) ? explode(',', $allowShopAdminIdsStr) : []; if (!in_array($userId, $allowShopAdminIds)) { util::fail('系统升级中,稍后再试,编号:' . $userId); } } $where = []; $where['userId'] = $userId; $where['delStatus'] = $delStatus; $respond = HdClass::getHdList($where); } util::success($respond); } }