|
@@ -2712,6 +2712,7 @@ class NewsService implements NewsServiceInterface
|
|
|
})
|
|
})
|
|
|
->where('book.status', 2)
|
|
->where('book.status', 2)
|
|
|
->where('book.img_url', '!=', '')
|
|
->where('book.img_url', '!=', '')
|
|
|
|
|
+ ->where('book.website_id', $website['website_id'])
|
|
|
->leftJoin('website_category', function ($join) use ($website) {
|
|
->leftJoin('website_category', function ($join) use ($website) {
|
|
|
$join->on('book.cat_id', '=', 'website_category.category_id')
|
|
$join->on('book.cat_id', '=', 'website_category.category_id')
|
|
|
->where('website_category.website_id', '=', $website['website_id']);
|
|
->where('website_category.website_id', '=', $website['website_id']);
|
|
@@ -2742,6 +2743,7 @@ class NewsService implements NewsServiceInterface
|
|
|
->orWhereRaw("JSON_CONTAINS(cat_arr_id, '$parentCatId')");
|
|
->orWhereRaw("JSON_CONTAINS(cat_arr_id, '$parentCatId')");
|
|
|
})
|
|
})
|
|
|
->where('book.status', 2)
|
|
->where('book.status', 2)
|
|
|
|
|
+ ->where('book.website_id', $website['website_id'])
|
|
|
->leftJoin('website_category', function ($join) use ($website) {
|
|
->leftJoin('website_category', function ($join) use ($website) {
|
|
|
$join->on('book.cat_id', '=', 'website_category.category_id')
|
|
$join->on('book.cat_id', '=', 'website_category.category_id')
|
|
|
->where('website_category.website_id', '=', $website['website_id']);
|
|
->where('website_category.website_id', '=', $website['website_id']);
|
|
@@ -3084,6 +3086,7 @@ class NewsService implements NewsServiceInterface
|
|
|
})
|
|
})
|
|
|
->select(
|
|
->select(
|
|
|
'job_hunting.id',
|
|
'job_hunting.id',
|
|
|
|
|
+ 'job_hunting.catid',
|
|
|
'job_hunting.cat_arr_id',
|
|
'job_hunting.cat_arr_id',
|
|
|
'job_hunting.job_name_get',
|
|
'job_hunting.job_name_get',
|
|
|
'job_hunting.industry',
|
|
'job_hunting.industry',
|
|
@@ -3093,7 +3096,9 @@ class NewsService implements NewsServiceInterface
|
|
|
'job_hunting.city_arr_id',
|
|
'job_hunting.city_arr_id',
|
|
|
'job_hunting.experience',
|
|
'job_hunting.experience',
|
|
|
'job_hunting.updated_at',
|
|
'job_hunting.updated_at',
|
|
|
- 'job_hunting.salary'
|
|
|
|
|
|
|
+ 'job_hunting.salary',
|
|
|
|
|
+ 'job_hunting.skillList',
|
|
|
|
|
+ 'job_hunting.slelf_evaluation',
|
|
|
)
|
|
)
|
|
|
->orderBy('updated_at', 'desc')
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit($data['job1_num'])
|
|
->limit($data['job1_num'])
|
|
@@ -3115,6 +3120,7 @@ class NewsService implements NewsServiceInterface
|
|
|
->leftJoin('job_company', 'job_recruiting.id', '=', 'job_company.job_id')
|
|
->leftJoin('job_company', 'job_recruiting.id', '=', 'job_company.job_id')
|
|
|
->select(
|
|
->select(
|
|
|
'job_recruiting.id',
|
|
'job_recruiting.id',
|
|
|
|
|
+ 'job_recruiting.catid',
|
|
|
'job_recruiting.cat_arr_id',
|
|
'job_recruiting.cat_arr_id',
|
|
|
'job_recruiting.title',
|
|
'job_recruiting.title',
|
|
|
'job_recruiting.jtzw_id',
|
|
'job_recruiting.jtzw_id',
|
|
@@ -3126,7 +3132,9 @@ class NewsService implements NewsServiceInterface
|
|
|
'job_recruiting.educational',
|
|
'job_recruiting.educational',
|
|
|
'job_recruiting.salary',
|
|
'job_recruiting.salary',
|
|
|
'job_recruiting.zw_id',
|
|
'job_recruiting.zw_id',
|
|
|
- 'job_company.business_name'
|
|
|
|
|
|
|
+ 'job_company.business_name',
|
|
|
|
|
+ 'job_recruiting.keyword',
|
|
|
|
|
+ 'job_recruiting.description',
|
|
|
)
|
|
)
|
|
|
->orderBy('updated_at', 'desc')
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit($data['job2_num'])
|
|
->limit($data['job2_num'])
|
|
@@ -3188,6 +3196,7 @@ class NewsService implements NewsServiceInterface
|
|
|
->leftJoin('job_company', 'job_recruiting.id', '=', 'job_company.job_id')
|
|
->leftJoin('job_company', 'job_recruiting.id', '=', 'job_company.job_id')
|
|
|
->select(
|
|
->select(
|
|
|
'job_recruiting.id',
|
|
'job_recruiting.id',
|
|
|
|
|
+ 'job_recruiting.catid',
|
|
|
'job_recruiting.hy_id',
|
|
'job_recruiting.hy_id',
|
|
|
'job_recruiting.title',
|
|
'job_recruiting.title',
|
|
|
'job_recruiting.zw_id',
|
|
'job_recruiting.zw_id',
|
|
@@ -3198,7 +3207,9 @@ class NewsService implements NewsServiceInterface
|
|
|
'job_recruiting.experience',
|
|
'job_recruiting.experience',
|
|
|
'job_recruiting.cat_arr_id',
|
|
'job_recruiting.cat_arr_id',
|
|
|
'job_recruiting.updated_at',
|
|
'job_recruiting.updated_at',
|
|
|
- 'job_company.business_name'
|
|
|
|
|
|
|
+ 'job_company.business_name',
|
|
|
|
|
+ 'job_recruiting.keyword',
|
|
|
|
|
+ 'job_recruiting.description',
|
|
|
)
|
|
)
|
|
|
->orderBy('job_recruiting.updated_at', 'desc');
|
|
->orderBy('job_recruiting.updated_at', 'desc');
|
|
|
$recruit_count = $query->count();
|
|
$recruit_count = $query->count();
|
|
@@ -3245,6 +3256,7 @@ class NewsService implements NewsServiceInterface
|
|
|
})
|
|
})
|
|
|
->select(
|
|
->select(
|
|
|
'job_hunting.id',
|
|
'job_hunting.id',
|
|
|
|
|
+ 'job_hunting.catid',
|
|
|
'job_hunting.sexy',
|
|
'job_hunting.sexy',
|
|
|
'job_hunting.experience',
|
|
'job_hunting.experience',
|
|
|
'job_hunting.origin',
|
|
'job_hunting.origin',
|
|
@@ -3256,7 +3268,9 @@ class NewsService implements NewsServiceInterface
|
|
|
'job_hunting.cat_arr_id',
|
|
'job_hunting.cat_arr_id',
|
|
|
'job_hunting.created_at',
|
|
'job_hunting.created_at',
|
|
|
'job_hunting.updated_at',
|
|
'job_hunting.updated_at',
|
|
|
- 'job_position.zwname as job_name'
|
|
|
|
|
|
|
+ 'job_position.zwname as job_name',
|
|
|
|
|
+ 'job_hunting.skillList',
|
|
|
|
|
+ 'job_hunting.slelf_evaluation',
|
|
|
)
|
|
)
|
|
|
->orderBy('job_hunting.updated_at', 'desc');
|
|
->orderBy('job_hunting.updated_at', 'desc');
|
|
|
$hunt_count = $query->count();
|
|
$hunt_count = $query->count();
|
|
@@ -3565,7 +3579,7 @@ class NewsService implements NewsServiceInterface
|
|
|
$query->where('user_id', $user['id']);
|
|
$query->where('user_id', $user['id']);
|
|
|
})
|
|
})
|
|
|
->where('status', 1)
|
|
->where('status', 1)
|
|
|
- ->select('id', 'title', 'website_id', 'user_id', 'updated_at')
|
|
|
|
|
|
|
+ ->select('id', 'title', 'website_id', 'user_id', 'updated_at', 'keyword', 'catid', 'description')
|
|
|
->orderBy('updated_at', 'desc')
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit($data['pageSize'])
|
|
->limit($data['pageSize'])
|
|
|
->get();
|
|
->get();
|
|
@@ -3714,21 +3728,21 @@ class NewsService implements NewsServiceInterface
|
|
|
// return Result::success($article);
|
|
// return Result::success($article);
|
|
|
// $catid =0 ;
|
|
// $catid =0 ;
|
|
|
|
|
|
|
|
- // if(!isset($article['cat_arr_id'])){
|
|
|
|
|
- // $catid = isset($article['catid']) ? $article['catid'] : (isset($article['category_id']) ? $article['category_id'] : null);
|
|
|
|
|
- // }else{
|
|
|
|
|
- // $catidArray = json_decode($article['cat_arr_id'], true);
|
|
|
|
|
- // $catid = !empty($catidArray) ? end($catidArray) : null;
|
|
|
|
|
- // }
|
|
|
|
|
- // // return Result::success($catid);
|
|
|
|
|
|
|
+ if (!isset($article['cat_arr_id'])) {
|
|
|
|
|
+ $catid = isset($article['catid']) ? $article['catid'] : (isset($article['category_id']) ? $article['category_id'] : null);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $catidArray = json_decode($article['cat_arr_id'], true);
|
|
|
|
|
+ $catid = !empty($catidArray) ? end($catidArray) : null;
|
|
|
|
|
+ }
|
|
|
|
|
+ // return Result::success($catid);
|
|
|
// // return Result::success($article['cat_arr_id']);
|
|
// // return Result::success($article['cat_arr_id']);
|
|
|
- // if (empty($catid)) {
|
|
|
|
|
- // return Result::error("该数据不存在", 0);
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (empty($catid)) {
|
|
|
|
|
+ return Result::error("该栏目路径不存在", 0);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // $pinyin = WebsiteCategory::where('website_id', $data['website_id'])
|
|
|
|
|
- // ->where('category_id',$catid)
|
|
|
|
|
- // ->first('path');
|
|
|
|
|
|
|
+ $path = WebsiteCategory::where('website_id', $data['website_id'])
|
|
|
|
|
+ ->where('category_id', $catid)
|
|
|
|
|
+ ->first('path');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// else{
|
|
// else{
|
|
@@ -3743,12 +3757,12 @@ class NewsService implements NewsServiceInterface
|
|
|
// // $pinyin[0] = $last_category['aLIas_pinyin'];
|
|
// // $pinyin[0] = $last_category['aLIas_pinyin'];
|
|
|
// // }
|
|
// // }
|
|
|
// }
|
|
// }
|
|
|
- // return Result::success($pinyin);
|
|
|
|
|
- // if (empty($pinyin)) {
|
|
|
|
|
- // return Result::error('非法路径!');
|
|
|
|
|
- // } else {
|
|
|
|
|
- return Result::success($last_category['path']);
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ // return Result::success($path);
|
|
|
|
|
+ if (!empty($path) && $path['path'] != $data['all_route']) {
|
|
|
|
|
+ return Result::error('非法路径!');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Result::success($last_category['path']);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
/**
|
|
/**
|
|
|
* 招工招聘 - 获取推荐职位
|
|
* 招工招聘 - 获取推荐职位
|
|
@@ -4119,13 +4133,39 @@ class NewsService implements NewsServiceInterface
|
|
|
return Result::error("您已添加过求职信息", 0);
|
|
return Result::error("您已添加过求职信息", 0);
|
|
|
}
|
|
}
|
|
|
var_dump($result, '-----------------test---------');
|
|
var_dump($result, '-----------------test---------');
|
|
|
- if (isset($data['city_arr_id']) && !empty($data['city_arr_id']) && is_string($data['city_arr_id'])) {
|
|
|
|
|
- // 如果 city_arr_id 是字符串,尝试将其转换为数组,取最后一个数据
|
|
|
|
|
- $cityArr = json_decode($data['city_arr_id'], true);
|
|
|
|
|
- $data['city_id'] = end($cityArr);
|
|
|
|
|
- } else {
|
|
|
|
|
- // 如果 city_arr_id 不是字符串,直接取最后一个数据
|
|
|
|
|
- $data['city_id'] = end($data['city_arr_id']);
|
|
|
|
|
|
|
+ if (isset($data['city_arr_id']) && !empty($data['city_arr_id'])) {
|
|
|
|
|
+ if (is_string($data['city_arr_id'])) {
|
|
|
|
|
+ // 如果 city_arr_id 是字符串,尝试将其转换为数组,取最后一个数据
|
|
|
|
|
+ $cityArr = json_decode($data['city_arr_id'], true);
|
|
|
|
|
+ // 确保 $cityArr 是数组
|
|
|
|
|
+ if (is_array($cityArr)) {
|
|
|
|
|
+ $data['city_id'] = end($cityArr);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 如果 city_arr_id 不是字符串,直接取最后一个数据
|
|
|
|
|
+ if (is_array($data['city_arr_id'])) {
|
|
|
|
|
+ $data['city_id'] = end($data['city_arr_id']);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 处理求职所绑定栏目
|
|
|
|
|
+ if (isset($data['cat_arr_id']) && !empty($data['cat_arr_id'])) {
|
|
|
|
|
+ if (is_string($data['cat_arr_id'])) {
|
|
|
|
|
+ // 如果 cat_arr_id 是字符串,尝试将其转换为数组,取最后一个数据
|
|
|
|
|
+ // 先清理可能存在的无效 JSON 字符
|
|
|
|
|
+ $cleanedCatArrStr = trim($data['cat_arr_id']);
|
|
|
|
|
+ $catArr = json_decode($cleanedCatArrStr, true);
|
|
|
|
|
+ // 检查 JSON 解码是否成功且结果是数组
|
|
|
|
|
+ if (json_last_error() === JSON_ERROR_NONE && is_array($catArr)) {
|
|
|
|
|
+ $data['catid'] = end($catArr);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 如果 cat_arr_id 不是字符串,直接取最后一个数据
|
|
|
|
|
+ if (is_array($data['cat_arr_id'])) {
|
|
|
|
|
+ $data['catid'] = end($data['cat_arr_id']);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if ((isset($data['status']) && $data['status'] == 1) || !isset($data['status'])) {
|
|
if ((isset($data['status']) && $data['status'] == 1) || !isset($data['status'])) {
|
|
|
$this->sendMessage([
|
|
$this->sendMessage([
|
|
@@ -4170,6 +4210,15 @@ class NewsService implements NewsServiceInterface
|
|
|
// 如果 city_arr_id 不是字符串,直接取最后一个数据
|
|
// 如果 city_arr_id 不是字符串,直接取最后一个数据
|
|
|
$data['city_id'] = end($data['city_arr_id']);
|
|
$data['city_id'] = end($data['city_arr_id']);
|
|
|
}
|
|
}
|
|
|
|
|
+ // 处理求职所绑定栏目
|
|
|
|
|
+ if (isset($data['cat_arr_id']) && !empty($data['cat_arr_id']) && is_string($data['cat_arr_id'])) {
|
|
|
|
|
+ // 如果 cat_arr_id 是字符串,尝试将其转换为数组,取最后一个数据
|
|
|
|
|
+ $catArr = json_decode($data['cat_arr_id'], true);
|
|
|
|
|
+ $data['catid'] = end($catArr);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 如果 cat_arr_id 不是字符串,直接取最后一个数据
|
|
|
|
|
+ $data['catid'] = end($data['cat_arr_id']);
|
|
|
|
|
+ }
|
|
|
if ((isset($data['status']) && $data['status'] == 1) || !isset($data['status'])) {
|
|
if ((isset($data['status']) && $data['status'] == 1) || !isset($data['status'])) {
|
|
|
$this->sendMessage([
|
|
$this->sendMessage([
|
|
|
'talk_type' => 600,
|
|
'talk_type' => 600,
|
|
@@ -5158,10 +5207,28 @@ class NewsService implements NewsServiceInterface
|
|
|
return Result::error("网站不存在", 0);
|
|
return Result::error("网站不存在", 0);
|
|
|
}
|
|
}
|
|
|
// var_dump('添加招聘进入news---user---user',$user);
|
|
// var_dump('添加招聘进入news---user---user',$user);
|
|
|
|
|
+ // 处理招聘关键词
|
|
|
|
|
+ if (isset($data['keyword']) && !empty($data['keyword'])) {
|
|
|
|
|
+ $data['keyword'] = str_replace(',', ',', $data['keyword']);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Jieba::init(); // 初始化 jieba-php
|
|
|
|
|
+ Finalseg::init();
|
|
|
|
|
+ $segList = Jieba::cut($data['title']);
|
|
|
|
|
+ $segList1 = array_slice($segList, 0, 8);
|
|
|
|
|
+ $data['keyword'] = implode(',', $segList1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// return Result::success($user);
|
|
// return Result::success($user);
|
|
|
$data['action_id'] = $data['user_id'] ?? null;
|
|
$data['action_id'] = $data['user_id'] ?? null;
|
|
|
$data['user_type'] = $user['type_id'] ?? null;
|
|
$data['user_type'] = $user['type_id'] ?? null;
|
|
|
$data['cat_arr_id'] = isset($data['cat_arr_id']) && !empty($data['cat_arr_id']) ? array_values(array_unique($data['cat_arr_id'])) : [];
|
|
$data['cat_arr_id'] = isset($data['cat_arr_id']) && !empty($data['cat_arr_id']) ? array_values(array_unique($data['cat_arr_id'])) : [];
|
|
|
|
|
+
|
|
|
|
|
+ if (isset($data['cat_arr_id']) && !empty($data['cat_arr_id']) && is_array($data['cat_arr_id'])) {
|
|
|
|
|
+ $data['catid'] = end($data['cat_arr_id']);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $data['catid'] = 0;
|
|
|
|
|
+ }
|
|
|
$data['city_arr_id'] = isset($data['city_arr_id']) && !empty($data['city_arr_id']) ? array_values(array_unique($data['city_arr_id'])) : [];
|
|
$data['city_arr_id'] = isset($data['city_arr_id']) && !empty($data['city_arr_id']) ? array_values(array_unique($data['city_arr_id'])) : [];
|
|
|
$data['cat_arr_id'] = isset($data['cat_arr_id']) && $data['cat_arr_id'] != [] ? json_encode(array_map('intval', $data['cat_arr_id'])) : '[]';
|
|
$data['cat_arr_id'] = isset($data['cat_arr_id']) && $data['cat_arr_id'] != [] ? json_encode(array_map('intval', $data['cat_arr_id'])) : '[]';
|
|
|
$data['city_arr_id'] = isset($data['city_arr_id']) && !empty($data['city_arr_id']) ? json_encode(array_map('intval', $data['city_arr_id'])) : '[]';
|
|
$data['city_arr_id'] = isset($data['city_arr_id']) && !empty($data['city_arr_id']) ? json_encode(array_map('intval', $data['city_arr_id'])) : '[]';
|
|
@@ -5310,7 +5377,21 @@ class NewsService implements NewsServiceInterface
|
|
|
if ($user['type_id'] == 3 && $job['user_id'] != $user['id']) {
|
|
if ($user['type_id'] == 3 && $job['user_id'] != $user['id']) {
|
|
|
return Result::error("用户暂无权限修改此招聘信息!", 0);
|
|
return Result::error("用户暂无权限修改此招聘信息!", 0);
|
|
|
}
|
|
}
|
|
|
|
|
+ // 处理招聘关键词
|
|
|
|
|
+ if (isset($data['keyword']) && !empty($data['keyword'])) {
|
|
|
|
|
+ $data['keyword'] = str_replace(',', ',', $data['keyword']);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Jieba::init(); // 初始化 jieba-php
|
|
|
|
|
+ Finalseg::init();
|
|
|
|
|
+ $segList = Jieba::cut($data['title']);
|
|
|
|
|
+ $segList1 = array_slice($segList, 0, 8);
|
|
|
|
|
+ $data['keyword'] = implode(',', $segList1);
|
|
|
|
|
+ }
|
|
|
$data['cat_arr_id'] = array_values(array_unique($data['cat_arr_id']));
|
|
$data['cat_arr_id'] = array_values(array_unique($data['cat_arr_id']));
|
|
|
|
|
+ if (isset($data['cat_arr_id']) && !empty($data['cat_arr_id']) && is_array($data['cat_arr_id'])) {
|
|
|
|
|
+ $data['catid'] = end($data['cat_arr_id']);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ }
|
|
|
$data['city_arr_id'] = array_values(array_unique($data['city_arr_id']));
|
|
$data['city_arr_id'] = array_values(array_unique($data['city_arr_id']));
|
|
|
$data['cat_arr_id'] = isset($data['cat_arr_id']) ? json_encode(array_map('intval', $data['cat_arr_id'])) : '';
|
|
$data['cat_arr_id'] = isset($data['cat_arr_id']) ? json_encode(array_map('intval', $data['cat_arr_id'])) : '';
|
|
|
$data['city_arr_id'] = isset($data['city_arr_id']) ? json_encode(array_map('intval', $data['city_arr_id'])) : '';
|
|
$data['city_arr_id'] = isset($data['city_arr_id']) ? json_encode(array_map('intval', $data['city_arr_id'])) : '';
|
|
@@ -7971,7 +8052,9 @@ class NewsService implements NewsServiceInterface
|
|
|
'job_recruiting.title',
|
|
'job_recruiting.title',
|
|
|
'job_company.business_name',
|
|
'job_company.business_name',
|
|
|
'job_recruiting.updated_at',
|
|
'job_recruiting.updated_at',
|
|
|
- 'job_recruiting.cat_arr_id'
|
|
|
|
|
|
|
+ 'job_recruiting.cat_arr_id',
|
|
|
|
|
+ 'job_recruiting.keyword',
|
|
|
|
|
+ 'job_recruiting.description'
|
|
|
)
|
|
)
|
|
|
->orderBy('job_recruiting.updated_at', 'desc')
|
|
->orderBy('job_recruiting.updated_at', 'desc')
|
|
|
|
|
|
|
@@ -7988,7 +8071,9 @@ class NewsService implements NewsServiceInterface
|
|
|
'job_hunting.name',
|
|
'job_hunting.name',
|
|
|
'job_hunting.cat_arr_id',
|
|
'job_hunting.cat_arr_id',
|
|
|
'job_position.zwname as job_name',
|
|
'job_position.zwname as job_name',
|
|
|
- 'job_hunting.updated_at'
|
|
|
|
|
|
|
+ 'job_hunting.updated_at',
|
|
|
|
|
+ 'job_hunting.keyword',
|
|
|
|
|
+ 'job_hunting.slelf_evaluation'
|
|
|
)
|
|
)
|
|
|
->orderBy('updated_at', 'desc')
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit($textnum)
|
|
->limit($textnum)
|