|
@@ -49,6 +49,7 @@ use Hyperf\Codec\Json;
|
|
|
|
|
|
use App\Tools\buildMenuTree;
|
|
|
use App\Model\JobApply;
|
|
|
+
|
|
|
#[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
|
class NewsService implements NewsServiceInterface
|
|
|
{
|
|
@@ -2643,23 +2644,59 @@ class NewsService implements NewsServiceInterface
|
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit(5)->get();
|
|
|
//获取5条用户待审核的公告
|
|
|
- $notice = Notice::where('status', 1)
|
|
|
+ $notice = Notice::where('status', 2)
|
|
|
+ ->where('user_id', $user_id)
|
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit(5)->get();
|
|
|
//获取5条用户的待审核投诉
|
|
|
- $complaint = Complaint::where('status', 1)
|
|
|
+ $complaint = Complaint::where('status', 2)
|
|
|
+ ->where('user_id', $user_id)
|
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit(5)->get();
|
|
|
-
|
|
|
//获取5条用户的book
|
|
|
- $book = Book::where('status', 1)
|
|
|
+ $book = Book::where('status', 2)
|
|
|
+ ->where('user_id', $user_id)
|
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit(5)->get();
|
|
|
//获取5条用户的求职
|
|
|
- $job_hunting = JobHunting::where('status', 1)
|
|
|
+ //获取5条用户的求职 1
|
|
|
+ $job_hunting = JobHunting::where('job_hunting.status', 1)
|
|
|
+ ->where('job_hunting.user_id', $user_id)
|
|
|
+ ->leftJoin('user', 'job_hunting.user_id', '=', 'user.id')
|
|
|
+ ->leftJoin('website', 'job_hunting.website_id', '=', 'website.id')
|
|
|
+ ->select('job_hunting.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name')
|
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit(5)->get();
|
|
|
- $count = count($chat) + count($chat_group) + count($apply_articale) + count($good);
|
|
|
+ //获取5条用户的求职 2
|
|
|
+ $job_recruiting = JobRecruiting::where('job_recruiting.status', 1)
|
|
|
+ ->where('job_recruiting.user_id', $user_id)
|
|
|
+ ->leftJoin('user', 'job_recruiting.user_id', '=', 'user.id')
|
|
|
+ ->leftJoin('website', 'job_recruiting.website_id', '=', 'website.id')
|
|
|
+ ->select('job_recruiting.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+ //人才库 1
|
|
|
+ $job_apply = JobApply::where('job_apply.status', 1)
|
|
|
+ ->where('job_apply.receiver_id', $user_id)
|
|
|
+ ->leftJoin('user', 'job_apply.user_id', '=', 'user.id')
|
|
|
+ ->leftJoin('website', 'job_apply.website_id', '=', 'website.id')
|
|
|
+ ->leftJoin('job_company', 'job_company.job_id', '=', 'job_apply.recruit_id')
|
|
|
+ ->leftJoin('job_recruiting', 'job_recruiting.id', '=', 'job_apply.recruit_id')
|
|
|
+ ->select('job_recruiting', 'job_recruiting.', '', '')
|
|
|
+ ->select('job_apply.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name', 'job_company.business_name as business_name', 'job_recruiting.title as job_name')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+ // 职场机会 2
|
|
|
+ $job_resume = JobResume::where('job_resume.status', 1)
|
|
|
+ ->where('job_resume.receiver_id', $user_id)
|
|
|
+ ->leftJoin('user', 'job_resume.receiver_id', '=', 'user.id')
|
|
|
+ ->leftJoin('website', 'job_resume.website_id', '=', 'website.id')
|
|
|
+ ->leftJoin('job_company', 'job_company.job_id', '=', 'job_resume.recruit_id')
|
|
|
+ ->select('job_resume.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name', 'job_company.business_name as business_name')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+
|
|
|
+ $count = count($chat) + count($chat_group) + count($apply_articale) + count($good) + count($notice) + count($complaint) + count($book) + count($job_hunting) + count($job_recruiting) + count($job_apply) + count($job_resume);
|
|
|
$result = [
|
|
|
'apply_articale' => $apply_articale,
|
|
|
'chat' => $chat,
|
|
@@ -2669,6 +2706,9 @@ class NewsService implements NewsServiceInterface
|
|
|
'complaint' => $complaint,
|
|
|
'book' => $book,
|
|
|
'job_hunting' => $job_hunting,
|
|
|
+ 'job_recruiting' => $job_recruiting,
|
|
|
+ 'job_apply' => $job_apply,
|
|
|
+ 'job_resume' => $job_resume,
|
|
|
'count' => $count,
|
|
|
];
|
|
|
} elseif ($type_id == 2) {
|
|
@@ -2772,12 +2812,64 @@ class NewsService implements NewsServiceInterface
|
|
|
// ->where('user_id', $user_id)
|
|
|
->orderBy('updated_at', 'desc')
|
|
|
->limit(5)->get();
|
|
|
- $count = count($chat) + count($chat_group) + count($apply_articale) + count($good);
|
|
|
+ //获取5条用户待审核的公告
|
|
|
+ $notice = Notice::where('status', 1)
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+ //获取5条用户的待审核投诉
|
|
|
+ $complaint = Complaint::where('status', 1)
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+ //获取5条用户的book
|
|
|
+ $book = Book::where('status', 1)
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+ //获取5条用户的求职 1
|
|
|
+ $job_hunting = JobHunting::where('job_hunting.status', 1)
|
|
|
+ ->leftJoin('user', 'job_hunting.user_id', '=', 'user.id')
|
|
|
+ ->leftJoin('website', 'job_hunting.website_id', '=', 'website.id')
|
|
|
+ ->select('job_hunting.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+ //获取5条用户的求职 2
|
|
|
+ $job_recruiting = JobRecruiting::where('job_recruiting.status', 1)
|
|
|
+ ->leftJoin('user', 'job_recruiting.user_id', '=', 'user.id')
|
|
|
+ ->leftJoin('website', 'job_recruiting.website_id', '=', 'website.id')
|
|
|
+ ->select('job_recruiting.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+ //人才库 1
|
|
|
+ $job_apply = JobApply::where('job_apply.status', 1)
|
|
|
+ ->leftJoin('user', 'job_apply.user_id', '=', 'user.id')
|
|
|
+ ->leftJoin('website', 'job_apply.website_id', '=', 'website.id')
|
|
|
+ ->leftJoin('job_company', 'job_company.job_id', '=', 'job_apply.recruit_id')
|
|
|
+ ->leftJoin('job_recruiting', 'job_recruiting.id', '=', 'job_apply.recruit_id')
|
|
|
+ ->select('job_recruiting', 'job_recruiting.', '', '')
|
|
|
+ ->select('job_apply.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name', 'job_company.business_name as business_name', 'job_recruiting.title as job_name')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+ // 职场机会 2
|
|
|
+ $job_resume = JobResume::where('job_resume.status', 1)
|
|
|
+ ->leftJoin('user', 'job_resume.receiver_id', '=', 'user.id')
|
|
|
+ ->leftJoin('website', 'job_resume.website_id', '=', 'website.id')
|
|
|
+ ->leftJoin('job_company', 'job_company.job_id', '=', 'job_resume.recruit_id')
|
|
|
+ ->select('job_resume.*', 'user.nickname as nickname', 'user.user_name as user_name', 'website.website_name as website_name', 'job_company.business_name as business_name')
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->limit(5)->get();
|
|
|
+
|
|
|
+ $count = count($chat) + count($chat_group) + count($apply_articale) + count($good) + count($notice) + count($complaint) + count($book) + count($job_hunting) + count($job_recruiting) + count($job_apply) + count($job_resume);
|
|
|
$result = [
|
|
|
'apply_articale' => $apply_articale,
|
|
|
'chat' => $chat,
|
|
|
'chat_group' => $chat_group,
|
|
|
'good' => $good,
|
|
|
+ 'notice' => $notice,
|
|
|
+ 'complaint' => $complaint,
|
|
|
+ 'book' => $book,
|
|
|
+ 'job_hunting' => $job_hunting,
|
|
|
+ 'job_recruiting' => $job_recruiting,
|
|
|
+ 'job_apply' => $job_apply,
|
|
|
+ 'job_resume' => $job_resume,
|
|
|
'count' => $count,
|
|
|
];
|
|
|
} elseif ($type_id == 20000) {
|
|
@@ -3157,15 +3249,15 @@ class NewsService implements NewsServiceInterface
|
|
|
)
|
|
|
->first();
|
|
|
$cityId = json_decode($result['city_arr_id'], true) ?? [];
|
|
|
- if(!empty($cityId)){
|
|
|
- if(isset($cityId[1]) && $cityId[1] != null){
|
|
|
+ if (!empty($cityId)) {
|
|
|
+ if (isset($cityId[1]) && $cityId[1] != null) {
|
|
|
$city = District::where('id', $cityId[1])->first(['name']);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$city = District::where('id', $cityId[0])->first(['name']);
|
|
|
}
|
|
|
$result['city'] = $city['name'] ?? '';
|
|
|
}
|
|
|
- if(empty($result)){
|
|
|
+ if (empty($result)) {
|
|
|
return Result::error("招聘信息不存在", 0);
|
|
|
}
|
|
|
// return Result::success($job);
|
|
@@ -3383,10 +3475,10 @@ class NewsService implements NewsServiceInterface
|
|
|
* */
|
|
|
public function getJobRecruitingArea(array $data): array
|
|
|
{
|
|
|
- if(isset($data['pid']) && $data['pid']!=null){
|
|
|
- $result = District::where('pid',$data['pid'])->get()->all();
|
|
|
- }else{
|
|
|
- $result = District::where('level',1)->get()->all();
|
|
|
+ if (isset($data['pid']) && $data['pid'] != null) {
|
|
|
+ $result = District::where('pid', $data['pid'])->get()->all();
|
|
|
+ } else {
|
|
|
+ $result = District::where('level', 1)->get()->all();
|
|
|
}
|
|
|
if (empty($result)) {
|
|
|
return Result::error("暂无此省市", 0);
|
|
@@ -3544,25 +3636,25 @@ class NewsService implements NewsServiceInterface
|
|
|
public function getRecruitingList(array $data): array
|
|
|
{
|
|
|
$user = User::where('id', $data['user_id'])->first();
|
|
|
- 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);
|
|
|
}
|
|
|
$recruitingId = JobApply::where('user_id', $data['user_id'])
|
|
|
- ->pluck('recruit_id');
|
|
|
+ ->pluck('recruit_id');
|
|
|
$where = [];
|
|
|
- if(isset($data['salary']) && $data['salary']!=null){
|
|
|
+ if (isset($data['salary']) && $data['salary'] != null) {
|
|
|
$where['job_recruiting.salary'] = $data['salary'];
|
|
|
}
|
|
|
- if(isset($data['experience']) && $data['experience']!=null){
|
|
|
- $where['job_recruiting.experience'] = $data['experience'];
|
|
|
+ if (isset($data['experience']) && $data['experience'] != null) {
|
|
|
+ $where['job_recruiting.experience'] = $data['experience'];
|
|
|
}
|
|
|
- if(isset($data['business_name']) && $data['business_name']!=null){
|
|
|
+ if (isset($data['business_name']) && $data['business_name'] != null) {
|
|
|
array_push($where, ['job_company.business_name', 'like', '%' . $data['business_name'] . '%']);
|
|
|
}
|
|
|
$query = JobRecruiting::whereIn('job_recruiting.id', $recruitingId)
|
|
|
->leftJoin('job_company', 'job_recruiting.id', '=', 'job_company.job_id')
|
|
|
->where($where);
|
|
|
- // ->count();
|
|
|
+ // ->count();
|
|
|
$count = $query->count();
|
|
|
$query = clone $query;
|
|
|
$job = $query
|
|
@@ -3576,12 +3668,12 @@ class NewsService implements NewsServiceInterface
|
|
|
})
|
|
|
// ->where($where)
|
|
|
->orderBy('job_recruiting.updated_at', 'desc')
|
|
|
- ->select('job_recruiting.id','job_recruiting.title', 'job_company.business_name', 'income_enum.evalue as salary_evalue', 'income_enum.ename as salary_ename', 'years_enum.evalue as experience_evalue', 'years_enum.ename as experience_ename')
|
|
|
+ ->select('job_recruiting.id', 'job_recruiting.title', 'job_company.business_name', 'income_enum.evalue as salary_evalue', 'income_enum.ename as salary_ename', 'years_enum.evalue as experience_evalue', 'years_enum.ename as experience_ename')
|
|
|
->offset(($data['page'] - 1) * $data['pageSize'])
|
|
|
->limit($data['pageSize'])
|
|
|
->get()
|
|
|
->all();
|
|
|
-
|
|
|
+
|
|
|
if (empty($job)) {
|
|
|
return Result::error("暂无招聘信息", 0);
|
|
|
}
|