|
@@ -7,7 +7,6 @@ use App\Model\ArticleData;
|
|
use App\Model\Category;
|
|
use App\Model\Category;
|
|
use App\Model\WebsiteCategory;
|
|
use App\Model\WebsiteCategory;
|
|
use App\Model\ArticleSurvey;
|
|
use App\Model\ArticleSurvey;
|
|
-use App\Model\jobHunting;
|
|
|
|
use App\Model\District;
|
|
use App\Model\District;
|
|
use App\Model\Good;
|
|
use App\Model\Good;
|
|
use App\Model\JobCompany;
|
|
use App\Model\JobCompany;
|
|
@@ -49,6 +48,7 @@ use Hyperf\Codec\Json;
|
|
|
|
|
|
use App\Tools\buildMenuTree;
|
|
use App\Tools\buildMenuTree;
|
|
use App\Model\JobApply;
|
|
use App\Model\JobApply;
|
|
|
|
+use App\Model\JobHunting;
|
|
use App\Model\JobRemuse;
|
|
use App\Model\JobRemuse;
|
|
|
|
|
|
#[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
#[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
@@ -1924,64 +1924,55 @@ class NewsService implements NewsServiceInterface
|
|
$data = json_decode($input['id'] ?? '', true) ?? [];
|
|
$data = json_decode($input['id'] ?? '', true) ?? [];
|
|
$result['goods'] = array_map(function ($item) use ($input) {
|
|
$result['goods'] = array_map(function ($item) use ($input) {
|
|
// 检查parent元素是否存在且不是undefined
|
|
// 检查parent元素是否存在且不是undefined
|
|
- if (isset($item['level']) && $item['level'] != 'undefined' && $item['level'] != "") {
|
|
|
|
- list($Levelid, $goodStart, $goodNum) = explode(',', $item['level']);
|
|
|
|
- $website = $input['website_id'];
|
|
|
|
- $query = Good::where('good.status', 2)
|
|
|
|
- ->where('good.website_id', $website);
|
|
|
|
- switch ($Levelid) {
|
|
|
|
- case 1:
|
|
|
|
- case 2:
|
|
|
|
- case 3:
|
|
|
|
- $goods = $query->where(function ($q) use ($Levelid) {
|
|
|
|
- $q->whereRaw("JSON_CONTAINS(good.level, '" . intval($Levelid) . "') = 0")
|
|
|
|
- ->orWhereRaw("JSON_CONTAINS(good.level, '\"" . intval($Levelid) . "\"') = 0");
|
|
|
|
- });
|
|
|
|
- break;
|
|
|
|
- case 4:
|
|
|
|
- $goods = $query;
|
|
|
|
- break;
|
|
|
|
- case 5:
|
|
|
|
- $goods = $query->where('type_id', 1);
|
|
|
|
- break;
|
|
|
|
- case 6:
|
|
|
|
- $goods = $query->where('type_id', 2);
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- return [];
|
|
|
|
- }
|
|
|
|
- $all_goods = $goods
|
|
|
|
- ->select(
|
|
|
|
- 'good.id',
|
|
|
|
- 'good.name',
|
|
|
|
- 'good.imgurl',
|
|
|
|
- 'good.description',
|
|
|
|
- 'good.updated_at',
|
|
|
|
- 'good.catid',
|
|
|
|
- 'good.type_id',
|
|
|
|
- 'good.price',
|
|
|
|
- 'good.level',
|
|
|
|
- 'good.website_id'
|
|
|
|
- )
|
|
|
|
- ->orderBy('updated_at', 'desc')
|
|
|
|
- ->offset($goodStart)
|
|
|
|
- ->limit($goodNum)
|
|
|
|
- ->get();
|
|
|
|
- $web['website_id'] = $website;
|
|
|
|
- $all_goods = $this->processGoods($all_goods, $web);
|
|
|
|
- }
|
|
|
|
- return $all_goods;
|
|
|
|
- }, $data);
|
|
|
|
- $website = $input['website_id'];
|
|
|
|
- $result['article'] = Article::where(function ($query) use ($website) {
|
|
|
|
- $query->where(function ($subQuery) use ($website) {
|
|
|
|
- $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '" . intval($website) . "') = 0");
|
|
|
|
- })->orWhereNull("ignore_ids");
|
|
|
|
- })
|
|
|
|
- ->where('catid', $catid)
|
|
|
|
- ->where('article.status', 1)
|
|
|
|
- ->leftJoin('article_data', 'article_data.article_id', 'article.id')
|
|
|
|
- ->select('article.id', 'article.title', 'article.updated_at', 'introduce', 'islink', 'linkurl', 'article_data.content')
|
|
|
|
|
|
+ if (isset($item['level']) && $item['level'] != 'undefined' && $item['level']!= "") {
|
|
|
|
+ list($Levelid, $goodStart,$goodNum) = explode(',', $item['level']);
|
|
|
|
+ $website = $input['website_id'];
|
|
|
|
+ $query = Good::where('good.status', 2)
|
|
|
|
+ ->where('good.website_id', $website);
|
|
|
|
+ switch ($Levelid) {
|
|
|
|
+ case 1:
|
|
|
|
+ case 2:
|
|
|
|
+ case 3:
|
|
|
|
+ $goods = $query->where(function($q) use ($Levelid) {
|
|
|
|
+ $q->whereRaw("JSON_CONTAINS(good.level, '". intval($Levelid). "') = 1")
|
|
|
|
+ ->orWhereRaw("JSON_CONTAINS(good.level, '\"". intval($Levelid). "\"') = 1");
|
|
|
|
+ });
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ $goods = $query;
|
|
|
|
+ break;
|
|
|
|
+ case 5:
|
|
|
|
+ $goods = $query->where('type_id',1);
|
|
|
|
+ break;
|
|
|
|
+ case 6:
|
|
|
|
+ $goods = $query->where('type_id',2);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ return [];
|
|
|
|
+ }
|
|
|
|
+ $all_goods = $goods
|
|
|
|
+ ->select('good.id', 'good.name', 'good.imgurl', 'good.description',
|
|
|
|
+ 'good.updated_at', 'good.catid','good.type_id','good.price','good.level',
|
|
|
|
+ 'good.website_id')
|
|
|
|
+ ->orderBy('updated_at','desc')
|
|
|
|
+ ->offset($goodStart)
|
|
|
|
+ ->limit($goodNum)
|
|
|
|
+ ->get();
|
|
|
|
+ $web['website_id'] = $website;
|
|
|
|
+ $all_goods = $this->processGoods($all_goods, $web);
|
|
|
|
+ }
|
|
|
|
+ return $all_goods;
|
|
|
|
+ }, $data);
|
|
|
|
+ $website = $input['website_id'];
|
|
|
|
+ $result['article'] = Article::where(function ($query) use ($website) {
|
|
|
|
+ $query->where(function ($subQuery) use ($website) {
|
|
|
|
+ $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '" . intval($website) . "') = 0");
|
|
|
|
+ })->orWhereNull("ignore_ids");
|
|
|
|
+ })
|
|
|
|
+ ->where('catid', $catid)
|
|
|
|
+ ->where('article.status', 1)
|
|
|
|
+ ->leftJoin('article_data', 'article_data.article_id', 'article.id')
|
|
|
|
+ ->select('article.id', 'article.title', 'article.updated_at', 'introduce', 'islink', 'linkurl','article_data.content')
|
|
->orderBy('article.updated_at', 'desc')
|
|
->orderBy('article.updated_at', 'desc')
|
|
->first();
|
|
->first();
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
@@ -4568,7 +4559,7 @@ class NewsService implements NewsServiceInterface
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
- * 获取招聘信息列表
|
|
|
|
|
|
+ * 获取招聘信息列表-职场机会(个人会员收到企业推送岗位)
|
|
* */
|
|
* */
|
|
public function getRecruitingList(array $data): array
|
|
public function getRecruitingList(array $data): array
|
|
{
|
|
{
|
|
@@ -4576,10 +4567,11 @@ class NewsService implements NewsServiceInterface
|
|
if (empty($user) || ($user['type_id'] != 10000 && $user['type_id'] != 1)) {
|
|
if (empty($user) || ($user['type_id'] != 10000 && $user['type_id'] != 1)) {
|
|
return Result::error("用户不存在", 0);
|
|
return Result::error("用户不存在", 0);
|
|
}
|
|
}
|
|
- if ($user['type_id'] == 1) {
|
|
|
|
|
|
+ // 1:个人会员 职场机会
|
|
|
|
+ if($user['type_id'] == 1){
|
|
$where['user_id'] = $user['id'];
|
|
$where['user_id'] = $user['id'];
|
|
}
|
|
}
|
|
- $recruitingId = JobApply::when($user['type_id'] == 1, function ($query) use ($user) {
|
|
|
|
|
|
+ $recruitingId = JobResume::when($user['type_id'] == 1, function ($query) use ($user) {
|
|
$query->where('recruit_id', $user['id']);
|
|
$query->where('recruit_id', $user['id']);
|
|
})
|
|
})
|
|
->pluck('recruit_id');
|
|
->pluck('recruit_id');
|
|
@@ -4665,6 +4657,46 @@ class NewsService implements NewsServiceInterface
|
|
}
|
|
}
|
|
return Result::success($recruiting);
|
|
return Result::success($recruiting);
|
|
}
|
|
}
|
|
|
|
+ /*
|
|
|
|
+ * 获取企业会员-我的沟通
|
|
|
|
+ * */
|
|
|
|
+ public function getJobResumeList(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $user = User::where('id', $data['user_id'])->first();
|
|
|
|
+ if(empty($user) || ($user['type_id']!= 10000 && $user['type_id']!= 3)){
|
|
|
|
+ return Result::error("用户不存在", 0);
|
|
|
|
+ }
|
|
|
|
+ $where = [];
|
|
|
|
+ if(isset($data['salary']) && $data['salary']!=null){
|
|
|
|
+ $where['job_hunting.salary'] = $data['salary'];
|
|
|
|
+ }
|
|
|
|
+ if(isset($data['user_name']) && $data['user_name']!=null){
|
|
|
|
+ array_push($where, ['user.user_name', 'like', '%'. $data['user_name']. '%']);
|
|
|
|
+ }
|
|
|
|
+ $job = JobResume::when($user['type_id'] == 3, function ($query) use ($user) {
|
|
|
|
+ $query->where('job_resume.user_id', $user['id']);
|
|
|
|
+ })
|
|
|
|
+ ->when(!empty($where), function ($query) use ($where) {
|
|
|
|
+ $query->where($where);
|
|
|
|
+ })
|
|
|
|
+ ->leftJoin('job_hunting','job_hunting.id','job_resume.hunt_id')
|
|
|
|
+ ->leftJoin('job_recruiting','job_recruiting.id','job_resume.recruit_id')
|
|
|
|
+ ->leftJoin('user','user.id','job_resume.receiver_id')
|
|
|
|
+ ->select('job_resume.hunt_id','job_resume.recruit_id','job_hunting.id','job_hunting.salary','job_hunting.city_id','job_recruiting.jtzw_id','user.user_name');
|
|
|
|
+ $count = $job->count();
|
|
|
|
+ if($count == 0){
|
|
|
|
+ return Result::error("暂无沟通记录", 0);
|
|
|
|
+ }
|
|
|
|
+ $jobs = $job->offset(($data['page'] - 1) * $data['pageSize'])
|
|
|
|
+ ->limit($data['pageSize'])
|
|
|
|
+ ->get();
|
|
|
|
+ if (empty($jobs)) {
|
|
|
|
+ return Result::error("暂无沟通记录", 0);
|
|
|
|
+ }
|
|
|
|
+ $result['row'] = $this->processJob($jobs, '');
|
|
|
|
+ $result['count'] = $count;
|
|
|
|
+ return Result::success($result);
|
|
|
|
+ }
|
|
// 20250306 招聘
|
|
// 20250306 招聘
|
|
//20250422 书刊音像
|
|
//20250422 书刊音像
|
|
public function addBook(array $data): array
|
|
public function addBook(array $data): array
|