123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?php
- namespace app\data\controller\api\auth;
- use app\data\controller\api\Auth;
- use app\data\controller\api\Data;
- use app\data\model\DataCollectionLog;
- use app\data\model\DataPoolTalent;
- use app\data\model\DataRecruitment;
- use app\data\model\DataTeachingKnowledge;
- use app\data\model\DataUserApplyJobInfo;
- use app\data\model\DataUserApplyJobInfoChild;
- use app\data\service\MessageService;
- use think\admin\Storage;
- use think\db\Query;
- use think\exception\HttpResponseException;
- use think\admin\Controller;
- use hg\apidoc\annotation\Title;
- use hg\apidoc\annotation\Method;
- use hg\apidoc\annotation\Param;
- use hg\apidoc\annotation\Header;
- use hg\apidoc\annotation\Returned;
- use think\facade\Validate;
- /**
- * @Title("人才库")
- */
- class PoolTalent extends Auth
- {
- protected $noNeedLogin=['polllist','polltel'];
- /**
- * @Title("人才列表")
- * @Method("post")
- * @Header("api-name",type="string",require=1,default="",desc="访问类型")
- * @Header("api-token",type="string",require=1,default="",desc="token")
- * @Param("keyword",type="string",require=0,default="",desc="关键词搜索")
- * @Param("zc_id",type="string",require=0,default="",desc="职称ID,多个以逗号隔开")
- * @Param("city",type="string",require=1,default="",desc="城市")
- */
- public function polllist()
- {
- $data = $this->_vali([
- 'keyword.default'=>'',
- 'zc_id.default'=>'',
- 'city.default'=>''
- ]);
- $keyword = $data['keyword'];
- $zc_id = $data['zc_id'];
- $city = $data['city'];
- $list = DataPoolTalent::mk()
- ->where('audit',2)
- ->when($keyword,function ($query) use ($keyword){
- $query->whereLike('name|jg|phone|email|xl|tc|jn|pxjl','%'.$keyword.'%');
- })
- ->when($zc_id,function ($query) use ($zc_id){
- $query->whereIn('zc_id',$zc_id);
- })
- ->when($city,function ($query) use ($city){
- $query->where('city',$city);
- })
- ->with(['zc','gzll','user'=>function($query){
- $query->field('id,headimg');
- }])
- ->paginate();
- if(count($list) < 1){
- $this->error('未匹配到结果',$list);
- }
- $this->success('成功',$list);
- }
- /**
- * @Title("人才详情")
- * @Method("post")
- * @Header("api-name",type="string",require=1,default="",desc="访问类型")
- * @Header("api-token",type="string",require=1,default="",desc="token")
- * @Param("id",type="string",require=1,default="",desc="id主键")
- */
- public function polldetail()
- {
- $data = $this->_vali([
- 'id.default'=>'id必须',
- ]);
- $info = DataPoolTalent::mk()
- ->where('id',$data['id'])
- ->where('audit',2)
- ->with(['zc','gzll','user'=>function($query){
- $query->field('id,headimg');
- }])
- ->findOrEmpty();
- $this->success('成功',$info);
- }
- /**
- * @Title("人才列表底部电话")
- * @Method("post")
- * @Header("api-name",type="string",require=1,default="",desc="访问类型")
- * @Header("api-token",type="string",require=1,default="",desc="token")
- */
- public function polltel()
- {
- $tel = sysconf('config_pool_talent.tel');
- $this->success('成功',$tel);
- }
- }
|