|
@@ -25,6 +25,8 @@ use App\Model\News;
|
|
|
use App\Model\UserInfo;
|
|
|
use App\Model\WebsiteGroup;;
|
|
|
|
|
|
+use App\Model\jobResume;
|
|
|
+
|
|
|
use Hyperf\DbConnection\Db;
|
|
|
use Hyperf\RpcServer\Annotation\RpcService;
|
|
|
use App\Tools\Result;
|
|
@@ -2305,6 +2307,55 @@ class NewsService implements NewsServiceInterface
|
|
|
];
|
|
|
return Result::success($data);
|
|
|
}
|
|
|
+ public function getJobHuntingApply(array $data): array
|
|
|
+ {
|
|
|
+ $where = [];
|
|
|
+
|
|
|
+ if (isset($data['username']) && !empty($data['username'])) {
|
|
|
+ $where[] = ['user.user_name', 'like', '%' . $data['username'] . '%'];
|
|
|
+ }
|
|
|
+ if (isset($data['salary']) && !empty($data['salary'])) {
|
|
|
+ $where = [
|
|
|
+ 'job_hunting.salary' => $data['salary'],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $type_id = isset($data['type_id']) ? $data['type_id'] : '';
|
|
|
+ $user_id = isset($data['user_id']) ? $data['user_id'] : '';
|
|
|
+ unset($data['type_id']);
|
|
|
+ if ($type_id != '10000') {
|
|
|
+ $where[] = ['job_resume.user_id', '=', $user_id];
|
|
|
+ }
|
|
|
+ $result = jobResume::where($where)
|
|
|
+ // ->when(!empty($data['status1']), function ($query) use ($data) {
|
|
|
+ // return $query->whereIn('job_hunting.status', [1, 3]); //1待审核2已审核3已拒绝
|
|
|
+ // })
|
|
|
+ // ->leftJoin('user', 'user.id', '=', 'job_hunting.user_id') 'user.nickname as nickname', , 'user.user_name as username'
|
|
|
+ ->where('job_enum.egroup', '=', 'income')
|
|
|
+ ->leftJoin('job_hunting', 'job_hunting.id', '=', 'job_resume.hunt_id')
|
|
|
+ ->leftJoin('district', 'district.id', '=', 'job_hunting.city_id')
|
|
|
+ ->leftJoin('job_enum', 'job_enum.evalue', '=', 'job_hunting.salary')
|
|
|
+ ->leftJoin('user', 'job_hunting.user_id', '=', 'user.id')
|
|
|
+ ->select('job_resume.*', 'job_hunting.job_name_get as job_name', 'job_hunting.salary as salary', 'district.name as cityname', 'job_enum.ename as salary_name', 'user.nickname as nickname', 'user.user_name as username')
|
|
|
+ ->orderBy("job_resume.updated_at", "desc")
|
|
|
+ ->limit($data['page_size'])
|
|
|
+ ->offset(($data['page'] - 1) * $data['page_size'])
|
|
|
+ ->get();
|
|
|
+ if (empty($result)) {
|
|
|
+ return Result::error("查询失败", 0);
|
|
|
+ }
|
|
|
+ $count = jobResume::where($where)
|
|
|
+ ->leftJoin('job_hunting', 'job_hunting.id', '=', 'job_resume.hunt_id')
|
|
|
+ ->leftJoin('district', 'district.id', '=', 'job_hunting.city_id')
|
|
|
+ ->leftJoin('job_enum', 'job_enum.evalue', '=', 'job_hunting.salary')
|
|
|
+ ->leftJoin('user', 'job_hunting.user_id', '=', 'user.id')
|
|
|
+ ->select('job_resume.*', 'job_hunting.job_name_get as job_name', 'job_hunting.salary as salary', 'district.name as cityname', 'job_enum.ename as salary_name', 'user.nickname as nickname', 'user.user_name as username')
|
|
|
+ ->count();
|
|
|
+ $data = [
|
|
|
+ 'rows' => $result->toArray(),
|
|
|
+ 'count' => $count,
|
|
|
+ ];
|
|
|
+ return Result::success($data);
|
|
|
+ }
|
|
|
public function addJobHunting(array $data): array
|
|
|
{
|
|
|
date_default_timezone_set('Asia/Shanghai');
|