|
@@ -30,7 +30,7 @@ use Ramsey\Uuid\Uuid;
|
|
|
use Hyperf\Utils\Random;
|
|
|
|
|
|
use function Hyperf\Support\retry;
|
|
|
-
|
|
|
+use App\Model\JobApply;
|
|
|
#[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
|
class NewsService implements NewsServiceInterface
|
|
|
{
|
|
@@ -1247,6 +1247,15 @@ class NewsService implements NewsServiceInterface
|
|
|
'job_company.email'
|
|
|
)
|
|
|
->first();
|
|
|
+ $cityId = json_decode($result['city_arr_id'], true) ?? [];
|
|
|
+ if(!empty($cityId)){
|
|
|
+ if(isset($cityId[1]) && $cityId[1] != null){
|
|
|
+ $city = District::where('id', $cityId[1])->first(['name']);
|
|
|
+ }else{
|
|
|
+ $city = District::where('id', $cityId[0])->first(['name']);
|
|
|
+ }
|
|
|
+ $result['city'] = $city['name'] ?? '';
|
|
|
+ }
|
|
|
if(empty($result)){
|
|
|
return Result::error("招聘信息不存在", 0);
|
|
|
}
|
|
@@ -1466,7 +1475,7 @@ class NewsService implements NewsServiceInterface
|
|
|
* */
|
|
|
public function getJobRecruitingArea(array $data): array
|
|
|
{
|
|
|
- if(isset($data['province_id']) && $data['province_id']!=null){
|
|
|
+ if(isset($data['pid']) && $data['pid']!=null){
|
|
|
$result = District::where('pid',$data['pid'])->get()->all();
|
|
|
}else{
|
|
|
$result = District::where('level',1)->get()->all();
|
|
@@ -1626,15 +1635,53 @@ class NewsService implements NewsServiceInterface
|
|
|
* */
|
|
|
public function getRecruitingList(array $data): array
|
|
|
{
|
|
|
- // $user = User::where('id', $data['user_id'])->first();
|
|
|
- // if(empty($user)){
|
|
|
- // return Result::error("用户不存在", 0);
|
|
|
- // }
|
|
|
- // $web = Website::where('id', $data['website_id'])->first();
|
|
|
- // if(empty($web)){
|
|
|
- // return Result::error("网站不存在", 0);
|
|
|
- // }
|
|
|
-
|
|
|
+ $user = User::where('id', $data['user_id'])->first();
|
|
|
+ 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');
|
|
|
+ $where = [];
|
|
|
+ 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['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 = $query->count();
|
|
|
+ $query = clone $query;
|
|
|
+ $job = $query
|
|
|
+ ->leftJoin('job_enum as income_enum', function ($join) {
|
|
|
+ $join->on('job_recruiting.salary', '=', 'income_enum.evalue')
|
|
|
+ ->where('income_enum.egroup', 'income');
|
|
|
+ })
|
|
|
+ ->leftJoin('job_enum as years_enum', function ($join) {
|
|
|
+ $join->on('job_recruiting.experience', '=', 'years_enum.evalue')
|
|
|
+ ->where('years_enum.egroup', 'years');
|
|
|
+ })
|
|
|
+ // ->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')
|
|
|
+ ->offset(($data['page'] - 1) * $data['pageSize'])
|
|
|
+ ->limit($data['pageSize'])
|
|
|
+ ->get()
|
|
|
+ ->all();
|
|
|
+
|
|
|
+ if (empty($job)) {
|
|
|
+ return Result::error("暂无招聘信息", 0);
|
|
|
+ }
|
|
|
+ $result = [
|
|
|
+ 'row' => $job,
|
|
|
+ 'count' => $count,
|
|
|
+ ];
|
|
|
+ return Result::success($result);
|
|
|
}
|
|
|
// 20250306 招聘
|
|
|
}
|