作者 何书鹏
1 个管道 的构建 通过 耗费 3 秒

合并分支 'heshupeng' 到 'master'

能力筛选



查看合并请求 !175
... ... @@ -14,7 +14,7 @@ use app\mobile\model\UserJobDownload;
*/
class CompanyJob extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedLogin = ['userJobAbility'];
protected $noNeedRight = ['*'];
protected $model = null;
protected $company_id = 0;
... ... @@ -111,7 +111,45 @@ class CompanyJob extends Api
}
/**
* @ApiWeigh (99)
* @ApiWeigh (98)
* @ApiTitle (能力筛选)
* @ApiSummary (能力筛选)
* @ApiMethod (POST)
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1599018234",
"data": [{
"id": 1, //一级ID
"pid": 0,
"name": "建筑工程", //一级名称
"children": [{ //二级
"id": 3, //二级ID
"pid": 1, //父ID
"name": "一级建造师", //二级名称
}]
}]
})
*/
public function userJobAbility()
{
$list = UserJobAbility::where('pid',0)->field('id,pid,name')->select();
$new_list = [0 => ['id' => 0, 'name' => '全部', 'pid' => 0]];
foreach($list as $v){
$children = UserJobAbility::where('pid',$v['id'])->field('id,pid,name')->select();;
$new_children = [0 => ['id' => 0, 'name' => '全部', 'pid' => $v['id']]];
foreach($children as $val){
$new_children[$val['id']] = $val;
}
$v['children'] = $new_children;
$new_list[$v['id']] = $v;
}
$this->success('成功', $new_list);
}
/**
* @ApiWeigh (97)
* @ApiTitle (求职-详情)
* @ApiSummary (求职-详情)
* @ApiMethod (POST)
... ...
此 diff 太大无法显示。