|
@@ -1677,23 +1677,23 @@ class NewsService implements NewsServiceInterface
|
|
// 封装处理由问题
|
|
// 封装处理由问题
|
|
function processJob($job, $data) {
|
|
function processJob($job, $data) {
|
|
return $job->map(function ($job) use ($data) {
|
|
return $job->map(function ($job) use ($data) {
|
|
-
|
|
|
|
$category = $job->cat_arr_id?? '';
|
|
$category = $job->cat_arr_id?? '';
|
|
$cityid = $job->city_arr_id?? '';
|
|
$cityid = $job->city_arr_id?? '';
|
|
$city = json_decode($cityid, true);
|
|
$city = json_decode($cityid, true);
|
|
$pinyin = '';
|
|
$pinyin = '';
|
|
$level = json_decode($category, true);
|
|
$level = json_decode($category, true);
|
|
// 路由
|
|
// 路由
|
|
- if(!empty($level)){
|
|
|
|
|
|
+ if(!empty($level) && is_array($level)){
|
|
$pinyin = WebsiteCategory::whereIn('category_id', $level)
|
|
$pinyin = WebsiteCategory::whereIn('category_id', $level)
|
|
- ->where('website_id', $data['website_id']) // 添加网站ID条件 her
|
|
|
|
|
|
+ ->where('website_id', $data['website_id']) // 添加网站ID条件
|
|
->orderByRaw('FIELD(category_id, '. implode(',', $level). ')')
|
|
->orderByRaw('FIELD(category_id, '. implode(',', $level). ')')
|
|
->get(['aLIas_pinyin'])
|
|
->get(['aLIas_pinyin'])
|
|
->pluck('aLIas_pinyin')
|
|
->pluck('aLIas_pinyin')
|
|
->implode('/');
|
|
->implode('/');
|
|
if(empty($pinyin)){
|
|
if(empty($pinyin)){
|
|
- $pinyin = $category->aLIas_pinyin?? '';
|
|
|
|
|
|
+ $pinyin = $pinyin->aLIas_pinyin?? '';
|
|
}
|
|
}
|
|
|
|
+ $job->pinyin = $pinyin;
|
|
}
|
|
}
|
|
// 取城市-市??省
|
|
// 取城市-市??省
|
|
if(!empty($city) && is_array($city)){
|
|
if(!empty($city) && is_array($city)){
|
|
@@ -1762,12 +1762,7 @@ class NewsService implements NewsServiceInterface
|
|
}
|
|
}
|
|
// 薪资
|
|
// 薪资
|
|
if(isset($job->salary) &&!empty($job->salary)){
|
|
if(isset($job->salary) &&!empty($job->salary)){
|
|
- if(isset($job->type) &&!empty($job->type) && $job->type == 1){
|
|
|
|
- $where['evalue'] = $job->salary;
|
|
|
|
- }else{
|
|
|
|
- $where['id'] = $job->salary;
|
|
|
|
- }
|
|
|
|
- $salary = JobEnum::where('egroup','income')->where($where)->first(['ename']);
|
|
|
|
|
|
+ $salary = JobEnum::where('egroup','income')->where('evalue',$job->salary)->first(['ename']);
|
|
$job->salary_name = $salary->ename?? '';
|
|
$job->salary_name = $salary->ename?? '';
|
|
}
|
|
}
|
|
// 职位性质
|
|
// 职位性质
|
|
@@ -1785,7 +1780,7 @@ class NewsService implements NewsServiceInterface
|
|
$company_nature = JobNature::where('id',$job->company_nature)->first(['nature_name']);
|
|
$company_nature = JobNature::where('id',$job->company_nature)->first(['nature_name']);
|
|
$job->company_nature_name = $company_nature->nature_name?? '';
|
|
$job->company_nature_name = $company_nature->nature_name?? '';
|
|
}
|
|
}
|
|
- $job->pinyin = $pinyin;
|
|
|
|
|
|
+ // $job->pinyin = $pinyin;
|
|
return $job;
|
|
return $job;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -2107,18 +2102,18 @@ class NewsService implements NewsServiceInterface
|
|
* */
|
|
* */
|
|
function processArticle($article, $data) {
|
|
function processArticle($article, $data) {
|
|
$article['img'] = Article::where('article.status', 1)
|
|
$article['img'] = Article::where('article.status', 1)
|
|
- ->whereIn('article.id', $$article[0])
|
|
|
|
- ->where(function ($query) use ($data) {
|
|
|
|
- $query->where(function ($subQuery) use ($data) {
|
|
|
|
- $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '".intval($data['website_id'])."') = 0");
|
|
|
|
- })->orWhereNull("ignore_ids");
|
|
|
|
- })
|
|
|
|
- ->select(
|
|
|
|
- 'article.id',
|
|
|
|
- 'article.title',
|
|
|
|
- 'article.imgurl',
|
|
|
|
- 'article.author',
|
|
|
|
- );
|
|
|
|
|
|
+ ->whereIn('article.id', $$article[0])
|
|
|
|
+ ->where(function ($query) use ($data) {
|
|
|
|
+ $query->where(function ($subQuery) use ($data) {
|
|
|
|
+ $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '".intval($data['website_id'])."') = 0");
|
|
|
|
+ })->orWhereNull("ignore_ids");
|
|
|
|
+ })
|
|
|
|
+ ->select(
|
|
|
|
+ 'article.id',
|
|
|
|
+ 'article.title',
|
|
|
|
+ 'article.imgurl',
|
|
|
|
+ 'article.author',
|
|
|
|
+ );
|
|
return $article->map(function ($article) use ($data) {
|
|
return $article->map(function ($article) use ($data) {
|
|
$catid = $article->cat_arr_id?? '';
|
|
$catid = $article->cat_arr_id?? '';
|
|
$level = json_decode($catid, true);
|
|
$level = json_decode($catid, true);
|
|
@@ -2155,9 +2150,8 @@ class NewsService implements NewsServiceInterface
|
|
$q->WhereRaw("JSON_CONTAINS(job_hunting.city_arr_id, '". intval($data['city_id']). "') = 1");
|
|
$q->WhereRaw("JSON_CONTAINS(job_hunting.city_arr_id, '". intval($data['city_id']). "') = 1");
|
|
});
|
|
});
|
|
})
|
|
})
|
|
- ->select('job_hunting.id','job_hunting.cat_arr_id','job_hunting.name','job_hunting.job',
|
|
|
|
- 'job_hunting.job_name','job_hunting.industry','job_hunting.city_arr_id','job_hunting.experience',
|
|
|
|
- 'job_hunting.updated_at')
|
|
|
|
|
|
+ ->select('job_hunting.id','job_hunting.cat_arr_id','job_hunting.job','job_hunting.industry',
|
|
|
|
+ 'job_hunting.city_arr_id','job_hunting.experience','job_hunting.updated_at')
|
|
->orderBy('updated_at', 'desc')
|
|
->orderBy('updated_at', 'desc')
|
|
->limit($data['job1_num'])
|
|
->limit($data['job1_num'])
|
|
->get();
|
|
->get();
|
|
@@ -2242,8 +2236,8 @@ class NewsService implements NewsServiceInterface
|
|
$recruit_count = $query->count();
|
|
$recruit_count = $query->count();
|
|
$query = clone $query;
|
|
$query = clone $query;
|
|
$JobRecruiting = $query
|
|
$JobRecruiting = $query
|
|
- ->limit($data['pageSize'])
|
|
|
|
->offset(($data['page']-1)*$data['pageSize'])
|
|
->offset(($data['page']-1)*$data['pageSize'])
|
|
|
|
+ ->limit($data['pageSize'])
|
|
->get();
|
|
->get();
|
|
if(empty($JobRecruiting)){
|
|
if(empty($JobRecruiting)){
|
|
$JobRecruiting = "暂无相关职位信息";
|
|
$JobRecruiting = "暂无相关职位信息";
|
|
@@ -2308,7 +2302,14 @@ class NewsService implements NewsServiceInterface
|
|
if(!empty($company)){
|
|
if(!empty($company)){
|
|
$result['company'] = $this->processJob($company, $webid);
|
|
$result['company'] = $this->processJob($company, $webid);
|
|
}
|
|
}
|
|
- $other_job = $query->where('id','!=',$data['id'])->where('user_id', '=', $job[0]['user_id'])->get();
|
|
|
|
|
|
+
|
|
|
|
+ $other_job =JobRecruiting::where('status', 1)
|
|
|
|
+ ->where('website_id', $data['website_id'])
|
|
|
|
+ ->select('title','id','updated_at','cat_arr_id','user_id')
|
|
|
|
+ ->where('id','!=',$data['id'])
|
|
|
|
+ ->where('user_id', '=', $job[0]['user_id'])
|
|
|
|
+ ->limit($data['pageSize'])
|
|
|
|
+ ->get();
|
|
if(!empty($other_job)){
|
|
if(!empty($other_job)){
|
|
$result['other_job'] = $this->processJob($other_job, $webid);
|
|
$result['other_job'] = $this->processJob($other_job, $webid);
|
|
}
|
|
}
|
|
@@ -2319,12 +2320,16 @@ class NewsService implements NewsServiceInterface
|
|
->leftJoin('user', 'user.id', '=', 'job_hunting.user_id')
|
|
->leftJoin('user', 'user.id', '=', 'job_hunting.user_id')
|
|
->select('job_hunting.*','user_name')
|
|
->select('job_hunting.*','user_name')
|
|
->get();
|
|
->get();
|
|
|
|
+ $resume = JobRemuse::where('hunt_id',$data['id'])->get();
|
|
|
|
+ if(!empty($resume->toArray())){
|
|
|
|
+ $result['resume'] = 1;
|
|
|
|
+ } else{
|
|
|
|
+ $result['resume'] = 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- if(empty($job)){
|
|
|
|
|
|
+ if(empty($job->toArray())){
|
|
return Result::error("id参数错误", 0);
|
|
return Result::error("id参数错误", 0);
|
|
}
|
|
}
|
|
-
|
|
|
|
- $job[0]['type'] = $data['type'];
|
|
|
|
$result['job'] = $this->processJob($job, $webid);
|
|
$result['job'] = $this->processJob($job, $webid);
|
|
// 返现对应的栏目
|
|
// 返现对应的栏目
|
|
$catid = json_decode($job[0]['cat_arr_id'],true) ?? '';
|
|
$catid = json_decode($job[0]['cat_arr_id'],true) ?? '';
|
|
@@ -2336,7 +2341,7 @@ class NewsService implements NewsServiceInterface
|
|
$result['category'] = $category;
|
|
$result['category'] = $category;
|
|
}
|
|
}
|
|
if(empty($result)){
|
|
if(empty($result)){
|
|
- return Result::error("id参数错误", 0);
|
|
|
|
|
|
+ return Result::error("参数错误", 0);
|
|
}
|
|
}
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|