MobileConstant.php 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <?php
  2. namespace app\common\library;
  3. class MobileConstant{
  4. public static $netProvider=[
  5. 1 => ['id'=>1,'name'=>'移动网络','search'=>[
  6. '移动网络','中国移动'
  7. ]],
  8. 2 => ['id'=>2,'name'=>'联通网络','search'=>[
  9. '联通网络','中国联通'
  10. ]],
  11. 3 => ['id'=>3,'name'=>'电信网络','search'=>[
  12. '电信网络','中国电信'
  13. ]],
  14. 4 => ['id'=>4,'name'=>'中国广电','search'=>[
  15. '中国广电'
  16. ]],
  17. ];
  18. public static $sortNetwork=[
  19. '中国移动','中国联通','中国电信','中国广电','移动网络','联通网络','电信网络'
  20. ];
  21. public static $networkColor=[
  22. '中国移动'=>'#3498db',
  23. '移动网络'=>'#3498db',
  24. '中国联通'=>'#e74c3c',
  25. '联通网络'=>'#e74c3c',
  26. '中国电信'=>'#01008a',
  27. '电信网络'=>'#01008a',
  28. '中国广电'=>'#006650',
  29. ];
  30. public static $no_type=[
  31. 1 => ['id'=>1,'name'=>'靓号'],
  32. 2 => ['id'=>2,'name'=>'流量卡'],
  33. ];
  34. public static $filters=[
  35. 'AAA'=>['middle'=>'filter_middle_3a','tail'=>'filter_tail_3a'],
  36. 'AAAA'=>['middle'=>'filter_middle_4a','tail'=>'filter_tail_4a'],
  37. 'AAAAA'=>['middle'=>'filter_middle_5a','tail'=>'filter_tail_5a'],
  38. '6A'=>['middle'=>'filter_middle_6a','tail'=>'filter_tail_6a'],
  39. '7A'=>['middle'=>'filter_middle_7a','tail'=>'filter_tail_7a'],
  40. '8A'=>['middle'=>'filter_middle_8a','tail'=>'filter_tail_8a'],
  41. 'ABC'=>['middle'=>'filter_middle_abc','tail'=>'filter_tail_abc'],
  42. 'ABCD'=>['middle'=>'filter_middle_abcd','tail'=>'filter_tail_abcd'],
  43. 'ABCDE'=>['middle'=>'filter_middle_abcde','tail'=>'filter_tail_abcde'],
  44. 'ABCDEF'=>['middle'=>'filter_middle_abcdef','tail'=>'filter_tail_abcdef'],
  45. 'ABCDEFG'=>['middle'=>'filter_middle_abcdefg','tail'=>'filter_tail_abcdefg'],
  46. 'ABCDEFGH'=>['middle'=>'filter_middle_abcdefgh','tail'=>'filter_tail_abcdefgh'],
  47. 'AAAB'=>['middle'=>'filter_middle_3ab','tail'=>'filter_tail_3ab'],
  48. 'AAAAB'=>['middle'=>'filter_middle_4ab','tail'=>'filter_tail_4ab'],
  49. 'AAAAAB'=>['middle'=>'filter_middle_5ab','tail'=>'filter_tail_5ab'],
  50. 'AAAAAAB'=>['middle'=>'filter_middle_6ab','tail'=>'filter_tail_6ab'],
  51. 'AABB'=>['middle'=>'filter_middle_aabb','tail'=>'filter_tail_aabb'],
  52. 'AABBCC'=>['middle'=>'filter_middle_aabbcc','tail'=>'filter_tail_aabbcc'],
  53. 'AABBCCDD'=>['middle'=>'filter_middle_aabbccdd','tail'=>'filter_tail_aabbccdd'],
  54. 'AAABB'=>['middle'=>'filter_middle_aaabb','tail'=>'filter_tail_aaabb'],
  55. 'ABBABB'=>['middle'=>'filter_middle_abbabb','tail'=>'filter_tail_abbabb'],
  56. 'AABAAB'=>['middle'=>'filter_middle_aabaab','tail'=>'filter_tail_aabaab'],
  57. 'ABCABC'=>['middle'=>'filter_middle_abcabc','tail'=>'filter_tail_abcabc'],
  58. 'ABBA'=>['middle'=>'filter_middle_abba','tail'=>'filter_tail_abba'],
  59. 'AAABBCC'=>['middle'=>'filter_middle_aaabbcc','tail'=>'filter_tail_aaabbcc'],
  60. 'ABABABAB'=>['middle'=>'filter_middle_abababab','tail'=>'filter_tail_abababab'],
  61. 'ABABABA'=>['middle'=>'filter_middle_abababa','tail'=>'filter_tail_abababa'],
  62. 'ABABAB'=>['middle'=>'filter_middle_ababab','tail'=>'filter_tail_ababab'],
  63. 'ABABA'=>['middle'=>'filter_middle_ababa','tail'=>'filter_tail_ababa'],
  64. 'ABAB'=>['middle'=>'filter_middle_abab','tail'=>'filter_tail_abab'],
  65. ];
  66. public static $filterss=[
  67. '8A'=>['middle'=>'filter_middle_8a','tail'=>'filter_tail_8a'],
  68. '7A'=>['middle'=>'filter_middle_7a','tail'=>'filter_tail_7a'],
  69. '6A'=>['middle'=>'filter_middle_6a','tail'=>'filter_tail_6a'],
  70. 'ABCDEFGH'=>['middle'=>'filter_middle_abcdefgh','tail'=>'filter_tail_abcdefgh'],
  71. 'ABCDEFG'=>['middle'=>'filter_middle_abcdefg','tail'=>'filter_tail_abcdefg'],
  72. 'ABCDEF'=>['middle'=>'filter_middle_abcdef','tail'=>'filter_tail_abcdef'],
  73. 'ABCDE'=>['middle'=>'filter_middle_abcde','tail'=>'filter_tail_abcde'],
  74. 'ABCD'=>['middle'=>'filter_middle_abcd','tail'=>'filter_tail_abcd'],
  75. 'ABCABC'=>['middle'=>'filter_middle_abcabc','tail'=>'filter_tail_abcabc'],
  76. 'ABC'=>['middle'=>'filter_middle_abc','tail'=>'filter_tail_abc'],
  77. 'AAAAAAB'=>['middle'=>'filter_middle_6ab','tail'=>'filter_tail_6ab'],
  78. 'AAAAA'=>['middle'=>'filter_middle_5a','tail'=>'filter_tail_5a'],
  79. 'AAAAAB'=>['middle'=>'filter_middle_5ab','tail'=>'filter_tail_5ab'],
  80. 'AAAAB'=>['middle'=>'filter_middle_4ab','tail'=>'filter_tail_4ab'],
  81. 'AAAA'=>['middle'=>'filter_middle_4a','tail'=>'filter_tail_4a'],
  82. 'AAABBCC'=>['middle'=>'filter_middle_aaabbcc','tail'=>'filter_tail_aaabbcc'],
  83. 'AAABB'=>['middle'=>'filter_middle_aaabb','tail'=>'filter_tail_aaabb'],
  84. 'AAAB'=>['middle'=>'filter_middle_3ab','tail'=>'filter_tail_3ab'],
  85. 'AAA'=>['middle'=>'filter_middle_3a','tail'=>'filter_tail_3a'],
  86. 'AABBCCDD'=>['middle'=>'filter_middle_aabbccdd','tail'=>'filter_tail_aabbccdd'],
  87. 'AABBCC'=>['middle'=>'filter_middle_aabbcc','tail'=>'filter_tail_aabbcc'],
  88. 'AABB'=>['middle'=>'filter_middle_aabb','tail'=>'filter_tail_aabb'],
  89. 'ABBA'=>['middle'=>'filter_middle_abba','tail'=>'filter_tail_abba'],
  90. 'ABABABAB'=>['middle'=>'filter_middle_abababab','tail'=>'filter_tail_abababab'],
  91. 'ABAB'=>['middle'=>'filter_middle_abab','tail'=>'filter_tail_abab'],
  92. 'ABABABA'=>['middle'=>'filter_middle_abababa','tail'=>'filter_tail_abababa'],
  93. 'ABABAB'=>['middle'=>'filter_middle_ababab','tail'=>'filter_tail_ababab'],
  94. 'ABABA'=>['middle'=>'filter_middle_ababa','tail'=>'filter_tail_ababa'],
  95. 'ABBABB'=>['middle'=>'filter_middle_abbabb','tail'=>'filter_tail_abbabb'],
  96. 'AABAAB'=>['middle'=>'filter_middle_aabaab','tail'=>'filter_tail_aabaab'],
  97. ];
  98. /**
  99. * @return string[]
  100. */
  101. public static function getNetworkColor(): array
  102. {
  103. return self::$networkColor;
  104. }
  105. public static $uniques=[
  106. [
  107. 'filter_middle_abab',
  108. 'filter_middle_ababa',
  109. 'filter_middle_ababab',
  110. 'filter_middle_abababa',
  111. 'filter_middle_abababab',
  112. ],
  113. [
  114. 'filter_middle_abba',
  115. 'filter_middle_abbabb',
  116. ],
  117. [
  118. 'filter_middle_3a',
  119. 'filter_middle_4a',
  120. 'filter_middle_5a',
  121. 'filter_middle_6a',
  122. 'filter_middle_7a',
  123. 'filter_middle_8a',
  124. ],
  125. [
  126. 'filter_middle_abc',
  127. 'filter_middle_abcd',
  128. 'filter_middle_abcde',
  129. 'filter_middle_abcdef',
  130. 'filter_middle_abcdefg',
  131. 'filter_middle_abcdefgh',
  132. ],
  133. [
  134. 'filter_middle_3ab',
  135. 'filter_middle_4ab',
  136. 'filter_middle_5ab',
  137. 'filter_middle_6ab',
  138. ],
  139. [
  140. 'filter_middle_aabb',
  141. 'filter_middle_aabbcc',
  142. 'filter_middle_aabbccdd',
  143. ],
  144. [
  145. 'filter_tail_abab',
  146. 'filter_tail_ababa',
  147. 'filter_tail_ababab',
  148. 'filter_tail_abababa',
  149. 'filter_tail_abababab',
  150. ],
  151. [
  152. 'filter_tail_abba',
  153. 'filter_tail_abbabb',
  154. ],
  155. [
  156. 'filter_tail_3a',
  157. 'filter_tail_4a',
  158. 'filter_tail_5a',
  159. 'filter_tail_6a',
  160. 'filter_tail_7a',
  161. 'filter_tail_8a',
  162. ],
  163. [
  164. 'filter_tail_abc',
  165. 'filter_tail_abcd',
  166. 'filter_tail_abcde',
  167. 'filter_tail_abcdef',
  168. 'filter_tail_abcdefg',
  169. 'filter_tail_abcdefgh',
  170. ],
  171. [
  172. 'filter_tail_3ab',
  173. 'filter_tail_4ab',
  174. 'filter_tail_5ab',
  175. 'filter_tail_6ab',
  176. ],
  177. [
  178. 'filter_tail_aabb',
  179. 'filter_tail_aabbcc',
  180. 'filter_tail_aabbccdd',
  181. ],
  182. ];
  183. public static function getNoType(){
  184. return self::$no_type;
  185. }
  186. public static function getNetwork(){
  187. return self::$netProvider;
  188. }
  189. public static function getNetworkString(){
  190. return self::$sortNetwork;
  191. $arr=self::getNetwork();
  192. $a=[];
  193. foreach ($arr as $item){
  194. $a[]=$item['name'];
  195. foreach ($item['search']??[] as $name) {
  196. if (!in_array($name,$a)){
  197. $a[]=$name;
  198. }
  199. }
  200. }
  201. return $a;
  202. }
  203. public static function getNetworkSelect(){
  204. $arr=self::getNetworkString();
  205. $a=[];
  206. foreach ($arr as $item){
  207. $a[$item]=$item;
  208. }
  209. return $a;
  210. }
  211. public static function getFilters(){
  212. return self::$filters;
  213. }
  214. public static function getFilterss(){
  215. return self::$filterss;
  216. }
  217. public static function getUnique(){
  218. return self::$uniques;
  219. }
  220. public static function getRuleKeys(){
  221. return array_keys(self::$filters);
  222. }
  223. public static function getFilterColumns(){
  224. static $all=[];
  225. if(empty($all)) {
  226. foreach (self::$filters as $name => $column) {
  227. foreach ($column as $col) {
  228. $all[$col]=$name;
  229. }
  230. }
  231. }
  232. return $all;
  233. }
  234. }