diff --git a/app/libs/daos/Mall/MallSDao.php b/app/libs/daos/Mall/MallSDao.php index cb251e4..269086f 100644 --- a/app/libs/daos/Mall/MallSDao.php +++ b/app/libs/daos/Mall/MallSDao.php @@ -64,8 +64,8 @@ class MallSDao extends AbstractDao { if (empty($mallIds)) { return []; } - $mallNameList = $this->query("SELECT mall_id, mall_name FROM %b WHERE mall_id IN %li", $this->getTable(), array_unique($mallIds)); - return ZcArrayHelper::changeKeyRow($mallNameList, 'mallId'); + $rows = $this->query("SELECT mall_id, mall_name FROM %b WHERE mall_id IN %li", $this->getTable(), array_unique($mallIds)); + return array_column($rows, 'mallName', 'mallId'); } public function updateMallRole($mallId, $mallRole){ diff --git a/app/libs/daos/OrderPrint/OpPageSettingDao.php b/app/libs/daos/OrderPrint/OpPageSettingDao.php index 350e38f..6b5a064 100644 --- a/app/libs/daos/OrderPrint/OpPageSettingDao.php +++ b/app/libs/daos/OrderPrint/OpPageSettingDao.php @@ -48,4 +48,8 @@ class OpPageSettingDao extends AbstractDao { $affRow = $this->insertUpdate($data); return $affRow > 0 ? true : false; } + + public function getByMallIdAndSubAccountId($mallId, $subAccountId) { + return $this->queryFirstRow('select * from %b where mall_id = %s and mall_sub_account_id = %s', $mallId, $subAccountId); + } } diff --git a/app/libs/services/Mall/MallAuthService.php b/app/libs/services/Mall/MallAuthService.php index 5e9b970..317586f 100644 --- a/app/libs/services/Mall/MallAuthService.php +++ b/app/libs/services/Mall/MallAuthService.php @@ -1224,4 +1224,29 @@ class MallAuthService extends AbstractService { $row = $this->mallAuthDao->getListByMallId($mallId); return $row ? true : false; } + + /* public function getAuthMallMap($venderId, $shopName, $preVenderIdList) { + list($multiShopOptions, $groupIdAndGroupNameMap) = $this->getVenderAuthGroupMultiShopOptions($venderId, $shopName, $preVenderIdList); + $venderIds = array_keys($multiShopOptions); + $selectedAuthVenderIds = ((count($multiShopOptions) > 1) && $venderAuthConfig['selectedAuthVenderIds']) ? explode(',', $venderAuthConfig['selectedAuthVenderIds']) : array_keys($multiShopOptions); + $selectedAuthVenderIds = array_map(function ($selectedAuthVenderId) { + return (string)$selectedAuthVenderId; + }, $selectedAuthVenderIds); + $selectedAuthGroupIds = ((count($groupIdAndGroupNameMap) > 1) && $venderAuthConfig['selectedAuthGroupIds']) ? explode(',', $venderAuthConfig['selectedAuthGroupIds']) : array_keys($groupIdAndGroupNameMap); + $selectedAuthGroupIds = array_map(function ($selectedAuthGroupId) { + return (string)$selectedAuthGroupId; + }, $selectedAuthGroupIds); + + $authVenderInfoList = $this->getVenderAppByVenderIds($venderIds, Zc::C('appName')); + $venderIdAndShopNameMap = []; + $expiredVenderIdAndShopNameMap = []; + foreach ($multiShopOptions as $venderId => $shopName) { + if ($authVenderInfoList[$venderId]['accessTokenIsInvalid'] || strtotime($authVenderInfoList[$venderId]['gmtExpire']) < time()) { + $expiredVenderIdAndShopNameMap[$venderId] = $shopName; + } else { + $venderIdAndShopNameMap[$venderId] = $shopName; + } + } + return compact('venderIdAndShopNameMap', 'expiredVenderIdAndShopNameMap', 'selectedAuthVenderIds', 'selectedAuthGroupIds', 'groupIdAndGroupNameMap', 'selectedAuthType'); + } */ } \ No newline at end of file