PoolTalent.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. namespace app\data\controller\api\auth;
  3. use app\data\controller\api\Auth;
  4. use app\data\controller\api\Data;
  5. use app\data\model\DataCollectionLog;
  6. use app\data\model\DataPoolTalent;
  7. use app\data\model\DataRecruitment;
  8. use app\data\model\DataTeachingKnowledge;
  9. use app\data\model\DataUserApplyJobInfo;
  10. use app\data\model\DataUserApplyJobInfoChild;
  11. use app\data\service\MessageService;
  12. use think\admin\Storage;
  13. use think\db\Query;
  14. use think\exception\HttpResponseException;
  15. use think\admin\Controller;
  16. use hg\apidoc\annotation\Title;
  17. use hg\apidoc\annotation\Method;
  18. use hg\apidoc\annotation\Param;
  19. use hg\apidoc\annotation\Header;
  20. use hg\apidoc\annotation\Returned;
  21. use think\facade\Validate;
  22. /**
  23. * @Title("人才库")
  24. */
  25. class PoolTalent extends Auth
  26. {
  27. protected $noNeedLogin=['polllist','polltel'];
  28. /**
  29. * @Title("人才列表")
  30. * @Method("post")
  31. * @Header("api-name",type="string",require=1,default="",desc="访问类型")
  32. * @Header("api-token",type="string",require=1,default="",desc="token")
  33. * @Param("keyword",type="string",require=0,default="",desc="关键词搜索")
  34. * @Param("zc_id",type="string",require=0,default="",desc="职称ID,多个以逗号隔开")
  35. * @Param("city",type="string",require=1,default="",desc="城市")
  36. */
  37. public function polllist()
  38. {
  39. $data = $this->_vali([
  40. 'keyword.default'=>'',
  41. 'zc_id.default'=>'',
  42. 'city.default'=>''
  43. ]);
  44. $keyword = $data['keyword'];
  45. $zc_id = $data['zc_id'];
  46. $city = $data['city'];
  47. $list = DataPoolTalent::mk()
  48. ->where('audit',2)
  49. ->when($keyword,function ($query) use ($keyword){
  50. $query->whereLike('name|jg|phone|email|xl|tc|jn|pxjl','%'.$keyword.'%');
  51. })
  52. ->when($zc_id,function ($query) use ($zc_id){
  53. $query->whereIn('zc_id',$zc_id);
  54. })
  55. ->when($city,function ($query) use ($city){
  56. $query->where('city',$city);
  57. })
  58. ->with(['zc','gzll','user'=>function($query){
  59. $query->field('id,headimg');
  60. }])
  61. ->paginate();
  62. if(count($list) < 1){
  63. $this->error('未匹配到结果',$list);
  64. }
  65. $this->success('成功',$list);
  66. }
  67. /**
  68. * @Title("人才详情")
  69. * @Method("post")
  70. * @Header("api-name",type="string",require=1,default="",desc="访问类型")
  71. * @Header("api-token",type="string",require=1,default="",desc="token")
  72. * @Param("id",type="string",require=1,default="",desc="id主键")
  73. */
  74. public function polldetail()
  75. {
  76. $data = $this->_vali([
  77. 'id.default'=>'id必须',
  78. ]);
  79. $info = DataPoolTalent::mk()
  80. ->where('id',$data['id'])
  81. ->where('audit',2)
  82. ->with(['zc','gzll','user'=>function($query){
  83. $query->field('id,headimg');
  84. }])
  85. ->findOrEmpty();
  86. $this->success('成功',$info);
  87. }
  88. /**
  89. * @Title("人才列表底部电话")
  90. * @Method("post")
  91. * @Header("api-name",type="string",require=1,default="",desc="访问类型")
  92. * @Header("api-token",type="string",require=1,default="",desc="token")
  93. */
  94. public function polltel()
  95. {
  96. $tel = sysconf('config_pool_talent.tel');
  97. $this->success('成功',$tel);
  98. }
  99. }