123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <?php
- namespace app\common\library;
- class MobileConstant{
- public static $netProvider=[
- 1 => ['id'=>1,'name'=>'移动网络','search'=>[
- '移动网络','中国移动'
- ]],
- 2 => ['id'=>2,'name'=>'联通网络','search'=>[
- '联通网络','中国联通'
- ]],
- 3 => ['id'=>3,'name'=>'电信网络','search'=>[
- '电信网络','中国电信'
- ]],
- 4 => ['id'=>4,'name'=>'中国广电','search'=>[
- '中国广电'
- ]],
- ];
- public static $sortNetwork=[
- '中国移动','中国联通','中国电信','中国广电','移动网络','联通网络','电信网络'
- ];
- public static $networkColor=[
- '中国移动'=>'#3498db',
- '移动网络'=>'#3498db',
- '中国联通'=>'#e74c3c',
- '联通网络'=>'#e74c3c',
- '中国电信'=>'#01008a',
- '电信网络'=>'#01008a',
- '中国广电'=>'#006650',
- ];
- public static $no_type=[
- 1 => ['id'=>1,'name'=>'靓号'],
- 2 => ['id'=>2,'name'=>'流量卡'],
- ];
- public static $filters=[
- 'AAA'=>['middle'=>'filter_middle_3a','tail'=>'filter_tail_3a'],
- 'AAAA'=>['middle'=>'filter_middle_4a','tail'=>'filter_tail_4a'],
- 'AAAAA'=>['middle'=>'filter_middle_5a','tail'=>'filter_tail_5a'],
- '6A'=>['middle'=>'filter_middle_6a','tail'=>'filter_tail_6a'],
- '7A'=>['middle'=>'filter_middle_7a','tail'=>'filter_tail_7a'],
- '8A'=>['middle'=>'filter_middle_8a','tail'=>'filter_tail_8a'],
- 'ABC'=>['middle'=>'filter_middle_abc','tail'=>'filter_tail_abc'],
- 'ABCD'=>['middle'=>'filter_middle_abcd','tail'=>'filter_tail_abcd'],
- 'ABCDE'=>['middle'=>'filter_middle_abcde','tail'=>'filter_tail_abcde'],
- 'ABCDEF'=>['middle'=>'filter_middle_abcdef','tail'=>'filter_tail_abcdef'],
- 'ABCDEFG'=>['middle'=>'filter_middle_abcdefg','tail'=>'filter_tail_abcdefg'],
- 'ABCDEFGH'=>['middle'=>'filter_middle_abcdefgh','tail'=>'filter_tail_abcdefgh'],
- 'AAAB'=>['middle'=>'filter_middle_3ab','tail'=>'filter_tail_3ab'],
- 'AAAAB'=>['middle'=>'filter_middle_4ab','tail'=>'filter_tail_4ab'],
- 'AAAAAB'=>['middle'=>'filter_middle_5ab','tail'=>'filter_tail_5ab'],
- 'AAAAAAB'=>['middle'=>'filter_middle_6ab','tail'=>'filter_tail_6ab'],
- 'AABB'=>['middle'=>'filter_middle_aabb','tail'=>'filter_tail_aabb'],
- 'AABBCC'=>['middle'=>'filter_middle_aabbcc','tail'=>'filter_tail_aabbcc'],
- 'AABBCCDD'=>['middle'=>'filter_middle_aabbccdd','tail'=>'filter_tail_aabbccdd'],
- 'AAABB'=>['middle'=>'filter_middle_aaabb','tail'=>'filter_tail_aaabb'],
- 'ABBABB'=>['middle'=>'filter_middle_abbabb','tail'=>'filter_tail_abbabb'],
- 'AABAAB'=>['middle'=>'filter_middle_aabaab','tail'=>'filter_tail_aabaab'],
- 'ABCABC'=>['middle'=>'filter_middle_abcabc','tail'=>'filter_tail_abcabc'],
- 'ABBA'=>['middle'=>'filter_middle_abba','tail'=>'filter_tail_abba'],
- 'AAABBCC'=>['middle'=>'filter_middle_aaabbcc','tail'=>'filter_tail_aaabbcc'],
- 'ABABABAB'=>['middle'=>'filter_middle_abababab','tail'=>'filter_tail_abababab'],
- 'ABABABA'=>['middle'=>'filter_middle_abababa','tail'=>'filter_tail_abababa'],
- 'ABABAB'=>['middle'=>'filter_middle_ababab','tail'=>'filter_tail_ababab'],
- 'ABABA'=>['middle'=>'filter_middle_ababa','tail'=>'filter_tail_ababa'],
- 'ABAB'=>['middle'=>'filter_middle_abab','tail'=>'filter_tail_abab'],
- ];
- public static $filterss=[
- '8A'=>['middle'=>'filter_middle_8a','tail'=>'filter_tail_8a'],
- '7A'=>['middle'=>'filter_middle_7a','tail'=>'filter_tail_7a'],
- '6A'=>['middle'=>'filter_middle_6a','tail'=>'filter_tail_6a'],
- 'ABCDEFGH'=>['middle'=>'filter_middle_abcdefgh','tail'=>'filter_tail_abcdefgh'],
- 'ABCDEFG'=>['middle'=>'filter_middle_abcdefg','tail'=>'filter_tail_abcdefg'],
- 'ABCDEF'=>['middle'=>'filter_middle_abcdef','tail'=>'filter_tail_abcdef'],
- 'ABCDE'=>['middle'=>'filter_middle_abcde','tail'=>'filter_tail_abcde'],
- 'ABCD'=>['middle'=>'filter_middle_abcd','tail'=>'filter_tail_abcd'],
- 'ABCABC'=>['middle'=>'filter_middle_abcabc','tail'=>'filter_tail_abcabc'],
- 'ABC'=>['middle'=>'filter_middle_abc','tail'=>'filter_tail_abc'],
- 'AAAAAAB'=>['middle'=>'filter_middle_6ab','tail'=>'filter_tail_6ab'],
- 'AAAAA'=>['middle'=>'filter_middle_5a','tail'=>'filter_tail_5a'],
- 'AAAAAB'=>['middle'=>'filter_middle_5ab','tail'=>'filter_tail_5ab'],
- 'AAAAB'=>['middle'=>'filter_middle_4ab','tail'=>'filter_tail_4ab'],
- 'AAAA'=>['middle'=>'filter_middle_4a','tail'=>'filter_tail_4a'],
- 'AAABBCC'=>['middle'=>'filter_middle_aaabbcc','tail'=>'filter_tail_aaabbcc'],
- 'AAABB'=>['middle'=>'filter_middle_aaabb','tail'=>'filter_tail_aaabb'],
- 'AAAB'=>['middle'=>'filter_middle_3ab','tail'=>'filter_tail_3ab'],
- 'AAA'=>['middle'=>'filter_middle_3a','tail'=>'filter_tail_3a'],
- 'AABBCCDD'=>['middle'=>'filter_middle_aabbccdd','tail'=>'filter_tail_aabbccdd'],
- 'AABBCC'=>['middle'=>'filter_middle_aabbcc','tail'=>'filter_tail_aabbcc'],
- 'AABB'=>['middle'=>'filter_middle_aabb','tail'=>'filter_tail_aabb'],
- 'ABBA'=>['middle'=>'filter_middle_abba','tail'=>'filter_tail_abba'],
- 'ABABABAB'=>['middle'=>'filter_middle_abababab','tail'=>'filter_tail_abababab'],
- 'ABAB'=>['middle'=>'filter_middle_abab','tail'=>'filter_tail_abab'],
- 'ABABABA'=>['middle'=>'filter_middle_abababa','tail'=>'filter_tail_abababa'],
- 'ABABAB'=>['middle'=>'filter_middle_ababab','tail'=>'filter_tail_ababab'],
- 'ABABA'=>['middle'=>'filter_middle_ababa','tail'=>'filter_tail_ababa'],
- 'ABBABB'=>['middle'=>'filter_middle_abbabb','tail'=>'filter_tail_abbabb'],
- 'AABAAB'=>['middle'=>'filter_middle_aabaab','tail'=>'filter_tail_aabaab'],
- ];
- /**
- * @return string[]
- */
- public static function getNetworkColor(): array
- {
- return self::$networkColor;
- }
- public static $uniques=[
- [
- 'filter_middle_abab',
- 'filter_middle_ababa',
- 'filter_middle_ababab',
- 'filter_middle_abababa',
- 'filter_middle_abababab',
- ],
- [
- 'filter_middle_abba',
- 'filter_middle_abbabb',
- ],
- [
- 'filter_middle_3a',
- 'filter_middle_4a',
- 'filter_middle_5a',
- 'filter_middle_6a',
- 'filter_middle_7a',
- 'filter_middle_8a',
- ],
- [
- 'filter_middle_abc',
- 'filter_middle_abcd',
- 'filter_middle_abcde',
- 'filter_middle_abcdef',
- 'filter_middle_abcdefg',
- 'filter_middle_abcdefgh',
- ],
- [
- 'filter_middle_3ab',
- 'filter_middle_4ab',
- 'filter_middle_5ab',
- 'filter_middle_6ab',
- ],
- [
- 'filter_middle_aabb',
- 'filter_middle_aabbcc',
- 'filter_middle_aabbccdd',
- ],
- [
- 'filter_tail_abab',
- 'filter_tail_ababa',
- 'filter_tail_ababab',
- 'filter_tail_abababa',
- 'filter_tail_abababab',
- ],
- [
- 'filter_tail_abba',
- 'filter_tail_abbabb',
- ],
- [
- 'filter_tail_3a',
- 'filter_tail_4a',
- 'filter_tail_5a',
- 'filter_tail_6a',
- 'filter_tail_7a',
- 'filter_tail_8a',
- ],
- [
- 'filter_tail_abc',
- 'filter_tail_abcd',
- 'filter_tail_abcde',
- 'filter_tail_abcdef',
- 'filter_tail_abcdefg',
- 'filter_tail_abcdefgh',
- ],
- [
- 'filter_tail_3ab',
- 'filter_tail_4ab',
- 'filter_tail_5ab',
- 'filter_tail_6ab',
- ],
- [
- 'filter_tail_aabb',
- 'filter_tail_aabbcc',
- 'filter_tail_aabbccdd',
- ],
- ];
- public static function getNoType(){
- return self::$no_type;
- }
- public static function getNetwork(){
- return self::$netProvider;
- }
- public static function getNetworkString(){
- return self::$sortNetwork;
- $arr=self::getNetwork();
- $a=[];
- foreach ($arr as $item){
- $a[]=$item['name'];
- foreach ($item['search']??[] as $name) {
- if (!in_array($name,$a)){
- $a[]=$name;
- }
- }
- }
- return $a;
- }
- public static function getNetworkSelect(){
- $arr=self::getNetworkString();
- $a=[];
- foreach ($arr as $item){
- $a[$item]=$item;
- }
- return $a;
- }
- public static function getFilters(){
- return self::$filters;
- }
- public static function getFilterss(){
- return self::$filterss;
- }
- public static function getUnique(){
- return self::$uniques;
- }
- public static function getRuleKeys(){
- return array_keys(self::$filters);
- }
- public static function getFilterColumns(){
- static $all=[];
- if(empty($all)) {
- foreach (self::$filters as $name => $column) {
- foreach ($column as $col) {
- $all[$col]=$name;
- }
- }
- }
- return $all;
- }
- }
|