You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< ? php
use Exception\BizException ;
use Service\Mall\MultiMallService ;
class PermissionTool {
/**
* @param array $data 支持包含MallId的数组或列表, 或者直接是MallIds
* @param array $operatorInfo
* @return array
*/
public static function checkMultiShopValid ( $mallId , $data ) {
$authMallIds = [];
if ( $data [ 'mallId' ]) {
$authMallIds [] = $data [ 'mallId' ];
} else {
$data = array_values ( $data );
if ( is_array ( $data [ 0 ])) {
$authMallIds = ArrayTool :: filterUnique ( array_column ( $data , 'mallId' ));
} elseif ( $data [ 0 ][ 'mallId' ]) {
$authMallIds = array_unique ( $data );
}
}
if ( empty ( $authMallIds )) {
throw new BizException ( '数据缺少mallId' );
}
$multiMallService = MultiMallService :: instance ();
$authMallIds = CommonTool :: convertValToArray ( $authMallIds );
return $multiMallService -> checkMultiShopValid ( $mallId , $authMallIds );
}
}