CommonConst.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. /**
  24. * 晋江市优秀人才津补贴审核单位
  25. */
  26. public static function JBTLIST() {
  27. return [
  28. self::RSJ, self::SBJ, self::SWJ
  29. ];
  30. }
  31. /**
  32. * 集成电路优秀人才津补贴审核单位
  33. */
  34. public static function JBTICLIST() {
  35. return [
  36. self::IC, self::SBJ, self::SWJ
  37. ];
  38. }
  39. /**
  40. * 晋江市优秀人才购房补贴审核单位
  41. */
  42. public static function HOUSELIST() {
  43. return [
  44. self::ZJJ, self::MZJ, self::ZRZYJ, self::RSJ
  45. ];
  46. }
  47. /**
  48. * 通过层次得到层次基础积分
  49. * @param type $level
  50. * @return int
  51. */
  52. public static function getLayerPointsByLayer($level) {
  53. $level = $level ?: 8;
  54. $levelAndPoints = [
  55. 1 => 6000,
  56. 2 => 4000,
  57. 3 => 2000,
  58. 4 => 1000,
  59. 5 => 500,
  60. 6 => 200,
  61. 7 => 100,
  62. 8 => 0
  63. ];
  64. return $levelAndPoints[$level];
  65. }
  66. /**
  67. * 通过层次得到层次名
  68. * @param type $level
  69. * @return string
  70. */
  71. public static function getLayerNameByLayer($level) {
  72. $level = $level ?: 8;
  73. $levelAndNames = [
  74. 1 => "第一层次",
  75. 2 => "第二层次",
  76. 3 => "第三层次",
  77. 4 => "第四层次",
  78. 5 => "第五层次",
  79. 6 => "第六层次",
  80. 7 => "第七层次",
  81. 8 => "非优秀人才"
  82. ];
  83. return $levelAndNames[$level];
  84. }
  85. /**
  86. * 通过积分得到层次
  87. * @param type $points
  88. * @return int
  89. */
  90. public static function getLayerByPoints($points) {
  91. $level = 1;
  92. while ($levelPoints = CommonConst::getLayerPointsByLayer($level)) {
  93. if ($points >= $levelPoints) {
  94. break;
  95. }
  96. $level++;
  97. }
  98. return $level;
  99. }
  100. }