Recruit.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\model\PlatformLike;
  4. use app\common\model\RecruitCate;
  5. use app\common\model\User;
  6. use app\common\model\UserCollect;
  7. use app\common\model\UserSearch;
  8. use app\common\model\UserTrack;
  9. use library\tools\Data;
  10. use think\Db;
  11. /**
  12. * @title 招聘
  13. * @controller Recruit
  14. * @group base
  15. */
  16. class Recruit extends Base
  17. {
  18. // 需要登录的
  19. protected $need_login = [
  20. 'activityTags',
  21. 'recruitCollect',
  22. 'recruitTransmit',
  23. 'getOwnRecruitList',
  24. 'getBrowseList',
  25. 'getRecruitCollect',
  26. ];
  27. public function initialize()
  28. {
  29. parent::initialize();
  30. parent::setUid();
  31. }
  32. /**
  33. * @title 招聘接口说明
  34. * @desc 招聘接口说明
  35. * @author qc
  36. * @url /api/Recruit/classIntro
  37. * @method GET
  38. * @return name:1 type:string default:-- desc:--
  39. */
  40. public function classIntro(){}
  41. /**
  42. * @title 获取招聘分类
  43. * @desc 两级分类
  44. * @author qc
  45. * @url /api/Recruit/getRecruitCate
  46. * @method GET
  47. * @header name:Authorization require:1 desc:Token
  48. * @return name:id type:int default:-- desc:分类id
  49. * @return name:title type:string default:0 desc:分类名称
  50. * @return name:children type:array default:0 desc:下级分类
  51. */
  52. public function getRecruitCate()
  53. {
  54. $list = RecruitCate::where(['is_deleted'=>0])->field('id,title,pid')->order('sort desc')->select()->toArray();
  55. $list = make_tree($list);
  56. $this->success('ok',['list'=>$list]);
  57. }
  58. /**
  59. * @title 联系我们【两个二维码】(招聘详情内部)
  60. * @desc 联系HR
  61. * @author qc
  62. * @method GET
  63. * @url /api/Recruit/getRecruitContact
  64. * @header name:Authorization require:1 desc:Token
  65. * @param name:id type:int default:-- desc:招聘记录id
  66. * @return name:phone type:string default:-- desc:招聘电话
  67. * @return name:email type:string default:-- desc:招聘email
  68. * @return name:hr_code type:int default:-- desc:招聘二维码
  69. * @return name:principal type:string default:-- desc:招聘联系人
  70. * @return name:qrcode type:string default:-- desc:平台二维码
  71. * @return name:contact_phone type:string default:-- desc:平台电话
  72. * @return name:contact_email type:string default:-- desc:平台邮箱
  73. */
  74. public function getRecruitContact()
  75. {
  76. $sel_where[] = ['id','=',input('get.id')];
  77. $detail = \app\common\model\Recruit::field('id,phone,email,hr_code,principal')->where($sel_where)->find()->toArray();
  78. $contact = Db::name('contact')->where('tag','recruit')->field('qrcode,phone contact_phone,email contact_email')->find();
  79. $contact['phone'] = $detail['phone'];
  80. $contact['email'] = $detail['email'];
  81. $contact['hr_code'] = $detail['hr_code'];
  82. $contact['principal'] = $detail['principal'];
  83. $this->success('ok',$contact);
  84. }
  85. /**
  86. * @title 招聘推荐
  87. * @desc 招聘推荐
  88. * @author qc
  89. * @method GET
  90. * @url /api/Recruit/getRecommendList
  91. * @header name:Authorization require:1 desc:Token
  92. * @param name:page type:int default:0 desc:页数
  93. * @param name:page_num type:int default:20 desc:每页数
  94. * @return name:id type:int default:-- desc:记录ID
  95. * @return name:title type:string default:-- desc:标题
  96. * @return name:company type:string default:-- desc:公司名
  97. * @return name:principal type:string default:-- desc:联系人
  98. * @return name:hr_headimg type:string default:-- desc:hr头像
  99. * @return name:cover type:string default:-- desc:公司logo
  100. * @return name:label_name type:array default:-- desc:标签
  101. * @return name:welfare_arr type:array default:-- desc:岗位福利
  102. * @return name:education type:string default:-- desc:学历
  103. * @return name:experience_min type:int default:0 desc:最低工作年限
  104. * @return name:experience_max type:int default:0 desc:最高工作年限
  105. * @return name:price_min type:int default:-- desc:最低薪资[弃用]
  106. * @return name:price_max type:int default:-- desc:最高薪资[弃用]
  107. * @return name:salary type:int default:-- desc:薪资【文本】
  108. * @return name:province type:string default:-- desc:省名
  109. * @return name:city type:string default:-- desc:市名
  110. * @return name:county type:string default:-- desc:县区
  111. * @return name:address type:string default:-- desc:地址
  112. * @return name:app_name type:string default:-- desc:发布方名称
  113. * @return name:app_logo type:string default:-- desc:发布方头像
  114. */
  115. public function getRecommendList()
  116. {
  117. $app_name = sysconf('app_name');
  118. $app_logo = sysconf('app_logo');
  119. $search_log = UserSearch::getSearchTitle($this->user_id,8);
  120. $search_arr = [];
  121. $where_str = 'b.id > 0';
  122. foreach ($search_log as $t){
  123. $search_arr[] = " b.title like '".'%'.$t."%'" .' ';
  124. $search_arr[] = " b.label like '".'%'.$t."%'" .' ';
  125. }
  126. if(!empty($search_arr)) $where_str = implode(' OR ',$search_arr);
  127. $field = 'a.id,title,a.user_id,label,salary,principal,hr_headimg,address,price_min,price_max,company,education,experience_min,experience_max,welfare,province,city,county,IFNULL(is_recommend,0) is_recommend ';
  128. $table = 'dd_recruit';
  129. $order_by_two = 'id';
  130. $sql = "SELECT $field FROM " .$table . " a LEFT JOIN ( SELECT id,IF(id,1,1) is_recommend FROM $table b WHERE ( $where_str )) AS c ON c.id = a.id WHERE a.status = 1 AND a.is_deleted = 0 ORDER BY is_recommend DESC , $order_by_two desc LIMIT {$this->off_set},{$this->page_num}";
  131. $list = Db::query($sql);
  132. array_walk($list,function (&$v,$k)use ($app_name,$app_logo){
  133. if(!$v['user_id']){
  134. $v['app_name'] = $app_name;
  135. $v['app_logo'] = $app_logo;
  136. }else{
  137. $user_info = User::where('id',$v['user_id'])->field('name,headimg')->find();
  138. $v['app_name'] = $user_info ? $user_info->name : '';
  139. $v['app_logo'] = $user_info ? $user_info->headimg : '';
  140. }
  141. $v['label_name'] = $v['label']? explode(',',trim($v['label'],',')) : null;
  142. $v['welfare_arr'] = explode(',',trim($v['welfare'],','));
  143. });
  144. $this->success('ok',['list'=>$list]);
  145. }
  146. /**
  147. * @title 获取招聘列表
  148. * @desc 获取招聘列表
  149. * @author qc
  150. * @method GET
  151. * @url /api/Recruit/getRecruitList
  152. * @header name:Authorization require:1 desc:Token
  153. * @param name:title type:string default:-- desc:标题
  154. * @param name:page type:int default:0 desc:页数
  155. * @param name:page_num type:int default:20 desc:每页数
  156. * @param name:sort_type type:int default:1 desc:1默认2时间升序3时间降序
  157. * @param name:first_classify type:int default:0 desc:一级分类id
  158. * @param name:second_classify type:int default:0 desc:二级分类id
  159. *
  160. * @return name:title type:string default:-- desc:标题
  161. * @return name:company type:string default:-- desc:公司名
  162. * @return name:cover type:string default:-- desc:公司logo
  163. * @return name:phone type:string default:-- desc:电话
  164. * @return name:email type:string default:-- desc:email
  165. * @return name:label_name type:array default:-- desc:标签
  166. * @return name:welfare_arr type:array default:-- desc:岗位福利
  167. * @return name:education type:string default:-- desc:学历
  168. * @return name:experience_min type:int default:0 desc:最低工作年限
  169. * @return name:experience_max type:int default:0 desc:最高工作年限
  170. * @return name:price_min type:int default:-- desc:最低薪资[弃用]
  171. * @return name:price_max type:int default:-- desc:最高薪资[弃用]
  172. * @return name:salary type:int default:-- desc:薪资【文本】
  173. * @return name:content type:string default:-- desc:招聘详情
  174. * @return name:create_at type:string default:-- desc:发布时间
  175. * @return name:first_classify type:int default:-- desc:一级分类id
  176. * @return name:second_classify type:int default:-- desc:二级分类id
  177. * @return name:province type:string default:-- desc:省名
  178. * @return name:city type:string default:-- desc:市名
  179. * @return name:county type:string default:-- desc:县区
  180. * @return name:address type:string default:-- desc:地址
  181. * @return name:longitude type:string default:-- desc:经度
  182. * @return name:latitude type:string default:-- desc:纬度
  183. * @return name:num type:int default:-- desc:招聘人数
  184. * @return name:app_name type:string default:-- desc:发布方名称
  185. * @return name:app_logo type:string default:-- desc:发布方头像
  186. */
  187. public function getRecruitList(){
  188. $title = input('get.title');
  189. $sort_type = input('get.sort_type',1);
  190. $first_classify = input('get.first_classify');
  191. $second_classify = input('get.second_classify');
  192. $app_name = sysconf('app_name');
  193. $app_logo = sysconf('app_logo');
  194. switch ($sort_type) {
  195. case 1:
  196. $order = ['sort'=>'desc','id'=>'desc'];
  197. break;
  198. case 2:
  199. $order = ['id'=>'asc','sort'=>'desc'];
  200. break;
  201. case 3:
  202. $order = ['id'=>'desc','sort'=>'desc'];
  203. break;
  204. }
  205. $sel_where = [];
  206. $sel_where[] = ['is_deleted','=',0];
  207. $sel_where[] = ['status','=',1];
  208. if($first_classify) $sel_where[] = ['first_classify','=',$first_classify];
  209. if($second_classify) $sel_where[] = ['second_classify','=',$second_classify];
  210. if($title && $this->user_id) UserSearch::saveSearchTitle($this->user_id,$title,8);
  211. $list = \app\common\model\Recruit::where($sel_where)
  212. ->when($title,function ($query)use($title){
  213. if($title) $query->where('title|label','like','%'.$title.'%');
  214. })->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
  215. foreach ($list as &$v) {
  216. $v['label_name'] = $v['label']? explode(',',trim($v['label'],',')) : null;
  217. $v['welfare_arr'] = explode(',',trim($v['welfare'],','));
  218. if(!$v['user_id']){
  219. $v['app_name'] = $app_name;
  220. $v['app_logo'] = $app_logo;
  221. }else{
  222. $user_info = User::where('id',$v['user_id'])->field('name,headimg')->find();
  223. $v['app_name'] = $user_info ? $user_info->name : '';
  224. $v['app_logo'] = $user_info ? $user_info->headimg : '';
  225. }
  226. }
  227. $this->success('ok',['list'=>$list]);
  228. }
  229. /**
  230. * @title 获取招聘详情
  231. * @desc 获取招聘详情
  232. * @author qc
  233. * @method GET
  234. * @url /api/Recruit/getRecruitDetail
  235. * @header name:Authorization require:1 desc:Token
  236. * @param name:id type:int default:-- desc:招聘记录id
  237. * @return name:title type:string default:-- desc:标题
  238. * @return name:company type:string default:-- desc:公司名
  239. * @return name:cover type:string default:-- desc:公司logo
  240. * @return name:company_label type:array default:-- desc:公司标签
  241. * @return name:principal type:string default:-- desc:联系人
  242. * @return name:hr_headimg type:string default:-- desc:联系人头像
  243. * @return name:phone type:string default:-- desc:电话
  244. * @return name:email type:string default:-- desc:email
  245. * @return name:label_name type:array default:-- desc:标签
  246. * @return name:welfare_arr type:array default:-- desc:岗位福利
  247. * @return name:education type:string default:-- desc:学历
  248. * @return name:experience_min type:int default:0 desc:最低工作年限
  249. * @return name:experience_max type:int default:0 desc:最高工作年限
  250. * @return name:price_min type:int default:-- desc:最低薪资[弃用]
  251. * @return name:price_max type:int default:-- desc:最高薪资[弃用]
  252. * @return name:salary type:int default:-- desc:薪资【文本】
  253. * @return name:content type:string default:-- desc:招聘详情
  254. * @return name:create_at type:string default:-- desc:发布时间
  255. * @return name:first_classify type:int default:-- desc:一级分类id
  256. * @return name:second_classify type:int default:-- desc:二级分类id
  257. * @return name:praise_num type:int default:-- desc:点赞量
  258. * @return name:is_praise type:int default:-- desc:是否点赞【0否1是】
  259. * @return name:is_collect type:int default:-- desc:是否收藏【0否1是】
  260. * @return name:collect_num type:int default:-- desc:收藏量
  261. * @return name:transmit_num type:int default:-- desc:转发量
  262. * @return name:province type:string default:-- desc:省名
  263. * @return name:city type:string default:-- desc:市名
  264. * @return name:county type:string default:-- desc:县区
  265. * @return name:address type:string default:-- desc:地址
  266. * @return name:longitude type:string default:-- desc:经度
  267. * @return name:latitude type:string default:-- desc:纬度
  268. * @return name:num type:int default:-- desc:招聘人数
  269. * @return name:hr_code type:int default:-- desc:二维码
  270. */
  271. public function getRecruitDetail()
  272. {
  273. $sel_where[] = ['id','=',input('get.id')];
  274. $detail = \app\common\model\Recruit::where($sel_where)->find()->toArray();
  275. $detail['label_name'] = explode(',',trim($detail['label'],','));
  276. $detail['welfare_arr'] = explode(',',trim($detail['welfare'],','));
  277. $detail['company_label'] = explode(',',trim($detail['company_label'],','));
  278. $detail['is_praise'] = PlatformLike::checkTags($this->user_id,$detail['id'],5);
  279. $detail['praise_num'] = PlatformLike::getPraiseNum($detail['id'],5);
  280. $detail['is_collect'] = UserCollect::checkCollectByType($this->user_id,8,$detail['id']);
  281. $detail['collect_num'] = UserCollect::getCollectNum(8,$detail['id']);
  282. UserTrack::crateTrack($this->user_id,8,input('get.id'),0);
  283. $this->success('ok',['detail'=>$detail]);
  284. }
  285. /**
  286. * @title 以下接口调用验证登录【需要header传Authorization】
  287. * @desc 以下接口调用验证登录
  288. * @author qc
  289. * @method
  290. * @url /api/Recruit/needLogin()
  291. */
  292. public function needLogin(){}
  293. /**
  294. * @title 点赞||取消点赞
  295. * @desc 点赞||取消点赞
  296. * @author qc
  297. * @method POST
  298. * @url /api/Recruit/recruitTags
  299. * @header name:Authorization require:1 desc:Token
  300. * @param name:id type:int default:1 desc:招聘记录id
  301. * @return name:tags type:int default:1 desc:0取消成功,1点赞成功
  302. */
  303. public function recruitTags()
  304. {
  305. $ret_val = PlatformLike::userTags($this->user_id,input('post.id'),5);
  306. $this->success($ret_val == 1 ?'点赞成功':'取消成功',['tags'=>$ret_val]);
  307. }
  308. /**
  309. * @title 收藏||取消收藏
  310. * @desc 用户收藏
  311. * @author qc
  312. * @method POST
  313. * @url /api/Recruit/recruitCollect
  314. * @header name:Authorization require:1 desc:Token
  315. * @param name:id type:int require:1 default:-- desc:招聘记录id
  316. * @param name:status type:int default:0 desc:收藏状态(0取消收藏【未收藏】,1收藏)
  317. */
  318. public function recruitCollect(){
  319. $coll_status = UserCollect::plateCollect($this->user_id,8,input('post.id',0));
  320. $coll_status ? $this->success('收藏成功',['status'=>1]) : $this->success('取消收藏成功',['status'=>0]);
  321. }
  322. /**
  323. * @title 转发(转发数量统计)
  324. * @desc 转发成功后调用
  325. * @author qc
  326. * @method POST
  327. * @url /api/Recruit/recruitTransmit
  328. * @header name:Authorization require:1 desc:Token
  329. * @param name:id type:int default:-- desc:招聘记录id
  330. */
  331. public function recruitTransmit()
  332. {
  333. $id = input('post.id',0);
  334. \app\common\model\Recruit::where('id',$id)->setInc('transmit_num');
  335. $this->success('ok');
  336. }
  337. /**
  338. * @title 我的发布【招聘】
  339. * @desc 我的发布【招聘】
  340. * @author qc
  341. * @method GET
  342. * @url /api/Recruit/getOwnRecruitList
  343. * @header name:Authorization require:1 desc:Token
  344. * @param name:title type:string default:-- desc:标题
  345. * @param name:page type:int default:0 desc:页数
  346. * @param name:page_num type:int default:20 desc:每页数
  347. * @return name:title type:string default:-- desc:标题
  348. * @return name:company type:string default:-- desc:公司名
  349. * @return name:cover type:string default:-- desc:公司logo
  350. * @return name:label_name type:array default:-- desc:标签
  351. * @return name:welfare_arr type:array default:-- desc:岗位福利
  352. * @return name:education type:string default:-- desc:学历
  353. * @return name:experience_min type:int default:0 desc:最低工作年限
  354. * @return name:experience_max type:int default:0 desc:最高工作年限
  355. * @return name:price_min type:int default:-- desc:最低薪资[弃用]
  356. * @return name:price_max type:int default:-- desc:最高薪资[弃用]
  357. * @return name:salary type:int default:-- desc:薪资【文本】
  358. * @return name:create_at type:string default:-- desc:发布时间
  359. * @return name:num type:int default:-- desc:招聘人数
  360. * @return name:principal type:string default:-- desc:联系人
  361. * @return name:hr_headimg type:string default:-- desc:联系人头像
  362. */
  363. public function getOwnRecruitList()
  364. {
  365. $title = input('get.title');
  366. $sel_where = [];
  367. $sel_where[] = ['is_deleted','=',0];
  368. $sel_where[] = ['status','=',1];
  369. $sel_where[] = ['user_id','=',$this->user_id];
  370. $list = \app\common\model\Recruit::where($sel_where)
  371. ->field('id,title,company,label,welfare,education,experience_min,salary,experience_max,price_min,price_max,create_at,num,principal,hr_headimg,province,city,county')
  372. ->when($title,function ($query)use($title){
  373. if($title) $query->where('title|label','like','%'.$title.'%');
  374. })->order(['id'=>'desc'])
  375. ->limit($this->off_set,$this->page_num)
  376. ->select()->toArray();
  377. foreach ($list as &$v) {
  378. $v['label_name'] = $v['label']? explode(',',trim($v['label'],',')) : null;
  379. $v['welfare_arr'] = explode(',',trim($v['welfare'],','));
  380. }
  381. $this->success('ok',['list'=>$list]);
  382. }
  383. /**
  384. * @title 浏览记录【招聘】
  385. * @desc 浏览记录【招聘】
  386. * @author qc
  387. * @method GET
  388. * @url /api/Recruit/getBrowseList
  389. * @header name:Authorization require:1 desc:Token
  390. * @param name:title type:string default:-- desc:标题
  391. * @param name:page type:int default:0 desc:页数
  392. * @param name:page_num type:int default:20 desc:每页数
  393. * @return name:id type:int default:-- desc:浏览记录id
  394. * @return name:title type:string default:-- desc:标题
  395. * @return name:recruit_id type:int default:-- desc:招聘记录id
  396. * @return name:company type:string default:-- desc:公司名
  397. * @return name:cover type:string default:-- desc:公司logo
  398. * @return name:label_name type:array default:-- desc:标签
  399. * @return name:welfare_arr type:array default:-- desc:岗位福利
  400. * @return name:education type:string default:-- desc:学历
  401. * @return name:experience_min type:int default:0 desc:最低工作年限
  402. * @return name:experience_max type:int default:0 desc:最高工作年限
  403. * @return name:price_min type:int default:-- desc:最低薪资[弃用]
  404. * @return name:price_max type:int default:-- desc:最高薪资[弃用]
  405. * @return name:salary type:int default:-- desc:薪资【文本】
  406. * @return name:num type:int default:-- desc:招聘人数
  407. * @return name:time type:string default:-- desc:浏览时间
  408. * @return name:principal type:string default:-- desc:联系人
  409. * @return name:hr_headimg type:string default:-- desc:联系人头像
  410. */
  411. public function getBrowseList()
  412. {
  413. $sel_where = [];
  414. $sel_where[] = ['t.user_id','=',$this->user_id];
  415. $sel_where[] = ['t.type','=',8];
  416. $title = input('get.title');
  417. if($title) $sel_where[] = ['i.title|i.label','like','%'.$title.'%'];
  418. $list = UserTrack::where($sel_where)
  419. ->alias('t')
  420. ->field('t.id,t.update_int,t.first_id recruit_id,i.salary,i.title,i.price_max,i.company,i.label,province,city,county,i.welfare,i.education,i.experience_min,i.experience_max,price_min,price_max,i.num,principal,hr_headimg')
  421. ->leftJoin('Recruit i','t.first_id = i.id')
  422. ->order('update_int desc')
  423. ->limit($this->off_set,$this->page_num)
  424. ->select()->toArray();
  425. foreach ($list as &$v) {
  426. $v['time'] = date("Y-m-d H:i:s",$v['update_int']);
  427. $v['label_name'] = $v['label']? explode(',',trim($v['label'],',')) : null;
  428. $v['welfare_arr'] = explode(',',trim($v['welfare'],','));
  429. }
  430. $this->success('ok',['list'=>$list]);
  431. }
  432. /**
  433. * @title 收藏记录【招聘】
  434. * @desc 收藏记录【招聘】
  435. * @author qc
  436. * @method GET
  437. * @url /api/Recruit/getRecruitCollect
  438. * @header name:Authorization require:1 desc:Token
  439. * @param name:title type:string default:-- desc:标题
  440. * @param name:page type:int default:0 desc:页数
  441. * @param name:page_num type:int default:20 desc:每页数
  442. * @return name:id type:int default:-- desc:收藏记录id
  443. * @return name:title type:string default:-- desc:标题
  444. * @return name:recruit_id type:int default:-- desc:招聘记录id
  445. * @return name:company type:string default:-- desc:公司名
  446. * @return name:cover type:string default:-- desc:公司logo
  447. * @return name:label_name type:array default:-- desc:标签
  448. * @return name:welfare_arr type:array default:-- desc:岗位福利
  449. * @return name:education type:string default:-- desc:学历
  450. * @return name:experience_min type:int default:0 desc:最低工作年限
  451. * @return name:experience_max type:int default:0 desc:最高工作年限
  452. * @return name:price_min type:int default:-- desc:最低薪资[弃用]
  453. * @return name:price_max type:int default:-- desc:最高薪资[弃用]
  454. * @return name:, type:int default:-- desc:薪资【文本】
  455. * @return name:num type:int default:-- desc:招聘人数
  456. * @return name:time type:string default:-- desc:浏览时间
  457. * @return name:principal type:string default:-- desc:联系人
  458. * @return name:hr_headimg type:string default:-- desc:联系人头像
  459. */
  460. public function getRecruitCollect()
  461. {
  462. $sel_where = [];
  463. $title = input('get.title');
  464. if($title) $sel_where[] = ['i.title|i.label','like','%'.$title.'%'];
  465. $sel_where[] = ['t.user_id','=',$this->user_id];
  466. $sel_where[] = ['t.coll_type','=',8];
  467. $list = UserCollect::where($sel_where)
  468. ->alias('t')
  469. ->field('t.id,t.create_at,t.coll_id recruit_id,i.title,i.company,i.label,i.salary,i.welfare,i.education,i.experience_min,i.experience_max,price_min,price_max,i.num,principal,hr_headimg,province,city,county')
  470. ->leftJoin('Recruit i','t.coll_id = i.id')
  471. ->order('id desc')
  472. ->limit($this->off_set,$this->page_num)
  473. ->select()->toArray();
  474. foreach ($list as &$v) {
  475. $v['label_name'] = $v['label']? explode(',',trim($v['label'],',')) : null;
  476. $v['welfare_arr'] = explode(',',trim($v['welfare'],','));
  477. }
  478. $this->success('ok',['list'=>$list]);
  479. }
  480. }