CommonConst.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. namespace app\common\state;
  8. /**
  9. * Description of CommonConst
  10. * 公共常量
  11. * @author sgq
  12. */
  13. class CommonConst {
  14. const RSJ = "rsj"; //人社局code
  15. const SBJ = "sbj"; //社保局code
  16. const SWJ = "swj"; //税务局code
  17. const IC = "ic"; //集成电路code
  18. const ZJJ = "zjj"; //住建局
  19. const MZJ = "mzj"; //民政局
  20. const ZRZYJ = "zrzyj"; //自然资源局
  21. const visit = "visitGroup"; //走访核查小组
  22. const JYJ = "jyj"; //教育局
  23. const ENTERPRISE_NORMAL = 1; //通常企业
  24. const ENTERPRISE_JC = 2; //电路企业
  25. const ENTERPRISE_WJ = 5; //卫健医院
  26. const ENTERPRISE_GJ = 6; //高教学校
  27. /**
  28. * 晋江市优秀人才津补贴审核单位
  29. */
  30. public static function JBTLIST() {
  31. return [
  32. self::RSJ, self::SBJ, self::SWJ
  33. ];
  34. }
  35. /**
  36. * 集成电路优秀人才津补贴审核单位
  37. */
  38. public static function JBTICLIST() {
  39. return [
  40. self::IC, self::SBJ, self::SWJ
  41. ];
  42. }
  43. /**
  44. * 晋江市优秀人才购房补贴审核单位
  45. */
  46. public static function HOUSELIST() {
  47. return [
  48. self::ZJJ, self::MZJ, self::ZRZYJ, self::RSJ
  49. ];
  50. }
  51. /**
  52. * 通过层次得到层次基础积分
  53. * @param type $level
  54. * @return int
  55. */
  56. public static function getLayerPointsByLayer($level) {
  57. $level = $level ?: 8;
  58. $levelAndPoints = [
  59. 1 => 6000,
  60. 2 => 4000,
  61. 3 => 2000,
  62. 4 => 1000,
  63. 5 => 500,
  64. 6 => 200,
  65. 7 => 100,
  66. 8 => 0
  67. ];
  68. return $levelAndPoints[$level];
  69. }
  70. /**
  71. * 通过层次得到层次名
  72. * @param type $level
  73. * @return string
  74. */
  75. public static function getLayerNameByLayer($level) {
  76. $level = $level ?: 8;
  77. $levelAndNames = [
  78. 1 => "第一层次",
  79. 2 => "第二层次",
  80. 3 => "第三层次",
  81. 4 => "第四层次",
  82. 5 => "第五层次",
  83. 6 => "第六层次",
  84. 7 => "第七层次",
  85. 8 => "非优秀人才"
  86. ];
  87. return $levelAndNames[$level];
  88. }
  89. /**
  90. * 通过层次得到层次名
  91. * @param type $level
  92. * @return string
  93. */
  94. public static function getTypeName($type) {
  95. $typeAndNames = [
  96. 1 => "晋江市现代产业体系人才",
  97. 2 => "晋江市集成电路产业优秀人才",
  98. 5 => "晋江市医疗卫生人才",
  99. 6 => "晋江市高等教育人才"
  100. ];
  101. return $typeAndNames[$type];
  102. }
  103. /**
  104. * 通过积分得到层次
  105. * @param type $points
  106. * @return int
  107. */
  108. public static function getLayerByPoints($points) {
  109. $level = 1;
  110. while ($levelPoints = CommonConst::getLayerPointsByLayer($level)) {
  111. if ($points >= $levelPoints) {
  112. break;
  113. }
  114. $level++;
  115. }
  116. return $level;
  117. }
  118. }