|
@@ -978,14 +978,10 @@ class NewsService implements NewsServiceInterface
|
|
*/
|
|
*/
|
|
public function getWebsiteCatidArticle(array $data): array
|
|
public function getWebsiteCatidArticle(array $data): array
|
|
{
|
|
{
|
|
- // return Result::success($data);
|
|
|
|
$where = [
|
|
$where = [
|
|
- // 'category.status' => 1,
|
|
|
|
'website_category.category_id' => $data['catid'],
|
|
'website_category.category_id' => $data['catid'],
|
|
'website_category.website_id' => $data['website_id'],
|
|
'website_category.website_id' => $data['website_id'],
|
|
- // 'article.status' => 1,
|
|
|
|
];
|
|
];
|
|
- // $category = WebsiteCategory::where($where);
|
|
|
|
if(isset($data['child_catnum']) && !empty($data['child_catnum'])){
|
|
if(isset($data['child_catnum']) && !empty($data['child_catnum'])){
|
|
$child_catnum = $data['child_catnum']?? 1;
|
|
$child_catnum = $data['child_catnum']?? 1;
|
|
$category['child'] = WebsiteCategory::where('pid',$data['catid'])->where('website_id',$data['website_id'])->select('category_id','alias')->limit($child_catnum)->get()->toArray();
|
|
$category['child'] = WebsiteCategory::where('pid',$data['catid'])->where('website_id',$data['website_id'])->select('category_id','alias')->limit($child_catnum)->get()->toArray();
|
|
@@ -995,7 +991,6 @@ class NewsService implements NewsServiceInterface
|
|
}
|
|
}
|
|
$imgArticles = [];
|
|
$imgArticles = [];
|
|
$textArticles = [];
|
|
$textArticles = [];
|
|
- // return Result::success($childCategoryIds);
|
|
|
|
if(isset($data['child_imgnum']) && !empty($data['child_imgnum']) && $data['child_imgnum']!=0){
|
|
if(isset($data['child_imgnum']) && !empty($data['child_imgnum']) && $data['child_imgnum']!=0){
|
|
// 初始化子分类图片新闻和文字新闻数组
|
|
// 初始化子分类图片新闻和文字新闻数组
|
|
|
|
|
|
@@ -1022,10 +1017,6 @@ class NewsService implements NewsServiceInterface
|
|
$subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '".intval($data['website_id'])."') = 0");
|
|
$subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '".intval($data['website_id'])."') = 0");
|
|
})->orWhereNull("ignore_ids");
|
|
})->orWhereNull("ignore_ids");
|
|
})
|
|
})
|
|
- // ->where(function ($query) {
|
|
|
|
- // $query->whereNull('imgurl')
|
|
|
|
- // ->orWhere('imgurl', '');
|
|
|
|
- // })
|
|
|
|
->select('*')
|
|
->select('*')
|
|
->orderBy('updated_at', 'desc')
|
|
->orderBy('updated_at', 'desc')
|
|
->limit($data['child_textnum'])
|
|
->limit($data['child_textnum'])
|
|
@@ -1055,10 +1046,6 @@ class NewsService implements NewsServiceInterface
|
|
$category['text'] = WebsiteCategory::where($where)
|
|
$category['text'] = WebsiteCategory::where($where)
|
|
->leftJoin('article', 'article.catid', 'website_category.category_id')
|
|
->leftJoin('article', 'article.catid', 'website_category.category_id')
|
|
->where('article.status', 1)
|
|
->where('article.status', 1)
|
|
- // ->where(function ($query) {
|
|
|
|
- // $query->whereNull('article.imgurl')
|
|
|
|
- // ->orWhere('article.imgurl', '');
|
|
|
|
- // })
|
|
|
|
->select('article.*','website_category.category_id','website_category.alias')
|
|
->select('article.*','website_category.category_id','website_category.alias')
|
|
->orderBy('article.updated_at', 'desc')
|
|
->orderBy('article.updated_at', 'desc')
|
|
->limit($data['text_num'])
|
|
->limit($data['text_num'])
|
|
@@ -1142,9 +1129,8 @@ class NewsService implements NewsServiceInterface
|
|
)
|
|
)
|
|
->orderBy('updated_at', 'desc')
|
|
->orderBy('updated_at', 'desc')
|
|
->limit($parentImgNum)
|
|
->limit($parentImgNum)
|
|
- ->get()->all();
|
|
|
|
-
|
|
|
|
- // 查询文字新闻
|
|
|
|
|
|
+ ->get()->all();
|
|
|
|
+ // 查询文字新闻
|
|
}
|
|
}
|
|
if($parentTextNum!=0){
|
|
if($parentTextNum!=0){
|
|
$textArticles = [];
|
|
$textArticles = [];
|
|
@@ -1262,10 +1248,7 @@ class NewsService implements NewsServiceInterface
|
|
'textnum' => $childTextArticles,
|
|
'textnum' => $childTextArticles,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
-
|
|
|
|
- // $resultItem['pinyin'] = $childCategoryInfo->aLIas_pinyin ?? '';
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
}else{
|
|
}else{
|
|
$resultItem['child'] = [];
|
|
$resultItem['child'] = [];
|
|
}
|
|
}
|
|
@@ -2199,6 +2182,7 @@ class NewsService implements NewsServiceInterface
|
|
}else{
|
|
}else{
|
|
$job_huntings = $this->processJob($job_hunting, $web);
|
|
$job_huntings = $this->processJob($job_hunting, $web);
|
|
}
|
|
}
|
|
|
|
+ // 0:待审核 1:已通过 2:已拒绝
|
|
$job_recruiting = JobRecruiting::where('job_recruiting.status', 1)
|
|
$job_recruiting = JobRecruiting::where('job_recruiting.status', 1)
|
|
->where('job_recruiting.website_id', $data['website_id'])
|
|
->where('job_recruiting.website_id', $data['website_id'])
|
|
->when(isset($data['city_id']) &&!empty($data['city_id']), function ($query) use ($data) {
|
|
->when(isset($data['city_id']) &&!empty($data['city_id']), function ($query) use ($data) {
|
|
@@ -2253,7 +2237,8 @@ class NewsService implements NewsServiceInterface
|
|
if(isset($data['jtzw_id']) &&!empty($data['jtzw_id'])){
|
|
if(isset($data['jtzw_id']) &&!empty($data['jtzw_id'])){
|
|
array_push($where, ['jtzw_id',$data['jtzw_id']]);
|
|
array_push($where, ['jtzw_id',$data['jtzw_id']]);
|
|
}
|
|
}
|
|
- $query = JobRecruiting::where('job_recruiting.status', 1)
|
|
|
|
|
|
+ if((isset($data['type']) && $data['type'] == 1) || !isset($data['type'])){
|
|
|
|
+ $query = JobRecruiting::where('job_recruiting.status', 1)
|
|
->where('job_recruiting.website_id', $data['website_id'])
|
|
->where('job_recruiting.website_id', $data['website_id'])
|
|
->where($where)
|
|
->where($where)
|
|
->when(isset($data['city_id']) &&!empty($data['city_id']), function ($query) use ($data) {
|
|
->when(isset($data['city_id']) &&!empty($data['city_id']), function ($query) use ($data) {
|
|
@@ -2271,18 +2256,20 @@ class NewsService implements NewsServiceInterface
|
|
'job_recruiting.jtzw_id','job_recruiting.city_arr_id','job_recruiting.due_data',
|
|
'job_recruiting.jtzw_id','job_recruiting.city_arr_id','job_recruiting.due_data',
|
|
'job_recruiting.cat_arr_id','job_recruiting.updated_at')
|
|
'job_recruiting.cat_arr_id','job_recruiting.updated_at')
|
|
->orderBy('updated_at', 'desc');
|
|
->orderBy('updated_at', 'desc');
|
|
- $recruit_count = $query->count();
|
|
|
|
- $query = clone $query;
|
|
|
|
- $JobRecruiting = $query
|
|
|
|
- ->offset(($data['page']-1)*$data['pageSize'])
|
|
|
|
- ->limit($data['pageSize'])
|
|
|
|
- ->get();
|
|
|
|
- if(empty($JobRecruiting)){
|
|
|
|
- $JobRecruiting = "暂无相关职位信息";
|
|
|
|
- }else{
|
|
|
|
- $JobRecruiting = $this->processJob($JobRecruiting, $website_id);
|
|
|
|
|
|
+ $recruit_count = $query->count();
|
|
|
|
+ $query = clone $query;
|
|
|
|
+ $JobRecruiting = $query
|
|
|
|
+ ->offset(($data['page']-1)*$data['pageSize'])
|
|
|
|
+ ->limit($data['pageSize'])
|
|
|
|
+ ->get();
|
|
|
|
+ if(empty($JobRecruiting)){
|
|
|
|
+ $JobRecruiting = "暂无相关职位信息";
|
|
|
|
+ }else{
|
|
|
|
+ $JobRecruiting = $this->processJob($JobRecruiting, $website_id);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- $query = JobHunting::where('status', 2)
|
|
|
|
|
|
+ if((isset($data['type']) && $data['type'] == 2) || !isset($data['type'])){
|
|
|
|
+ $query = JobHunting::where('status', 2)
|
|
->where('job_hunting.website_id', $data['website_id'])
|
|
->where('job_hunting.website_id', $data['website_id'])
|
|
->where($where)
|
|
->where($where)
|
|
->when(isset($data['city_id']) &&!empty($data['city_id']), function ($query) use ($data) {
|
|
->when(isset($data['city_id']) &&!empty($data['city_id']), function ($query) use ($data) {
|
|
@@ -2297,22 +2284,26 @@ class NewsService implements NewsServiceInterface
|
|
})
|
|
})
|
|
->select('id','sexy','experience','origin','industry','name','job','job_name_get','city_arr_id','cat_arr_id','created_at','updated_at')
|
|
->select('id','sexy','experience','origin','industry','name','job','job_name_get','city_arr_id','cat_arr_id','created_at','updated_at')
|
|
->orderBy('updated_at', 'desc');
|
|
->orderBy('updated_at', 'desc');
|
|
- $hunt_count = $query->count();
|
|
|
|
- $query = clone $query;
|
|
|
|
- $JobHunting = $query
|
|
|
|
- ->offset(($data['page']-1)*$data['pageSize'])
|
|
|
|
- ->limit($data['pageSize'])
|
|
|
|
- ->get();
|
|
|
|
- if(empty($JobHunting)){
|
|
|
|
- $JobRecruiting = "暂无相关简历信息";
|
|
|
|
- }else{
|
|
|
|
- $JobHunting = $this->processJob($JobHunting, $website_id);
|
|
|
|
|
|
+ $hunt_count = $query->count();
|
|
|
|
+ $query = clone $query;
|
|
|
|
+ $JobHunting = $query
|
|
|
|
+ ->offset(($data['page']-1)*$data['pageSize'])
|
|
|
|
+ ->limit($data['pageSize'])
|
|
|
|
+ ->get();
|
|
|
|
+ if(empty($JobHunting)){
|
|
|
|
+ $JobRecruiting = "暂无相关简历信息";
|
|
|
|
+ }else{
|
|
|
|
+ $JobHunting = $this->processJob($JobHunting, $website_id);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
$result = [
|
|
$result = [
|
|
- 'JobRecruiting' => $JobRecruiting,
|
|
|
|
- 'recruit_count' =>$recruit_count,
|
|
|
|
- 'JobHunting' => $JobHunting,
|
|
|
|
- 'hunt_count' =>$hunt_count,
|
|
|
|
|
|
+ 'JobRecruiting' => $JobRecruiting ?? [],
|
|
|
|
+ 'recruit_count' =>$recruit_count ?? 0,
|
|
|
|
+ 'JobHunting' => $JobHunting ?? [],
|
|
|
|
+ 'hunt_count' =>$hunt_count ?? 0,
|
|
];
|
|
];
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|