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