@ -21,6 +21,7 @@ use Dao\Mall\MallSDao;
use Dao\Mall\MallSmsSendLogDao;
use Dao\Mall\MallSubAccountAuthMallDao;
use Dao\Mall\MoveAuthMallDao;
use Dao\OrderPrint\OpPageSettingDao;
use DbTool;
use DdcRequestClient;
use Exception;
@ -58,8 +59,7 @@ class MallAuthService extends AbstractService {
private $mallBizTraceDtDao;
private $moveAuthMallDao;
private $mallSmsSendLogDao;
private $mallLoginLogDao;
private $mallLoginIpDao;
private $opPageSettingDao;
/**
* @var DdcRequestClient
@ -97,8 +97,7 @@ class MallAuthService extends AbstractService {
$this->moveAuthMallDao = MoveAuthMallDao::instance();
$this->mallSmsSendLogDao = MallSmsSendLogDao::instance();
$this->mallSubAccountAuthMallDao = MallSubAccountAuthMallDao::instance();
$this->mallLoginLogDao = MallLoginLogDao::instance();
$this->mallLoginIpDao = MallLoginIpDao::instance();
$this->opPageSettingDao = OpPageSettingDao::instance();
$this->ddcRequestClient = \Zc::singleton(DdcRequestClient::class);
$this->appGateRequestClient = \Zc::singleton(AppGateRequestClient::class);
@ -1154,11 +1153,11 @@ class MallAuthService extends AbstractService {
$authGroupIds = array_keys($authGroupMap);
if (empty($authGroupIds)) {
return array() ;
return [] ;
}
$memberList = $this->mallAuthGroupMemberDao->getListByAuthGroupIds($authGroupIds, $skipExpire);
$memberMap = array() ;
$memberMap = [] ;
foreach ($memberList as $member) {
if (($member['mallId'] == $mallId) & & $skipCurrentMallId) {
continue;
@ -1225,28 +1224,34 @@ class MallAuthService extends AbstractService {
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;
public function getAuthMallMap($operatorInfo) {
$mallId = $operatorInfo['mallId'];
$shopName = $operatorInfo['mallName'];
$mallSubAccountId = $operatorInfo['mallSubAccountId'];
$preMallIdList = $operatorInfo['preMallIdList'];
$multiShopOptions = $this->mallRepository->getMultiShopOptions($mallId, $shopName, $mallSubAccountId);
$mallAuthGroupMap = $this->getMallAuthGroupMapWithMembers($mallId, $preMallIdList);
$groupIdAndGroupNameMap = [];
foreach ($mallAuthGroupMap as $groupInfo) {
$groupIdAndGroupNameMap[$groupInfo['mallAuthGroupId']] = $groupInfo['groupName'];
}
$mallIds = array_keys($multiShopOptions);
$selectedAuthMallIds = $this->opPageSettingDao->getSelectedAuthMallIds($mallId, $mallSubAccountId);
$selectedAuthMallIds = (count($multiShopOptions) > 1) & & $selectedAuthMallIds ? $selectedAuthMallIds : array_keys($multiShopOptions);
$selectedAuthMallIds = array_map(function ($selectedAuthMallId) {
return (string)$selectedAuthMallId;
}, $selectedAuthMallIds);
$authMallInfoMap = $this->mallSDao->getMapByMallIds($mallIds);
$mallIdAndShopNameMap = [];
$expiredMallIdAndShopNameMap = [];
foreach ($multiShopOptions as $mallId => $shopName) {
if (strtotime($authMallInfoMap[$mallId]['gmtAccessTokenExpire']) < time ( ) | | strtotime ( $ authMallInfoMap [ $ mallId ] [ ' gmtExpire ' ] ) < time ( ) ) {
$expiredMallIdAndShopNameMap[$mallId] = $shopName;
} else {
$venderIdAndShopNameMap[$venderId] = $shopName;
$mallIdAndShopNameMap[$mall Id] = $shopName;
}
}
return compact('venderIdAndShopNameMap', 'expiredVenderIdAndShopNameMap', 'selectedAuthVenderIds', 'selectedAuthGroupIds', 'groupIdAndGroupNameMap', 'selectedAuthType');
} */
return compact('mallIdAndShopNameMap', 'expiredMallIdAndShopNameMap', 'selectedAuthMallIds', 'groupIdAndGroupNameMap ');
}
}