|
@@ -1064,6 +1064,7 @@ class NewsService implements NewsServiceInterface
|
|
|
if(empty($user)){
|
|
|
return Result::error("用户不存在", 0);
|
|
|
}
|
|
|
+ // 企业会员
|
|
|
if($user['type_id'] == 3){
|
|
|
array_push($where,['user_id', $data['user_id']]);
|
|
|
}
|
|
@@ -1084,7 +1085,7 @@ class NewsService implements NewsServiceInterface
|
|
|
/*
|
|
|
* 招聘信息详情
|
|
|
* */
|
|
|
- public function getJobRecruiting(array $data): array
|
|
|
+ public function getJobRecruitingInfo(array $data): array
|
|
|
{
|
|
|
$result = JobRecruiting::where('id', $data['id'])
|
|
|
->leftJoin('user_info', 'job_recruiting.user_id', '=', 'user.id')
|
|
@@ -1099,11 +1100,17 @@ class NewsService implements NewsServiceInterface
|
|
|
/*
|
|
|
* 招聘信息添加
|
|
|
* */
|
|
|
- public function addRecruit(array $data): array
|
|
|
+ public function addJobRecruiting(array $data): array
|
|
|
{
|
|
|
- $data['user_id'] = $data['user_id'];
|
|
|
- $data['website_id'] = $data['website_id'];
|
|
|
- return Result::success($data);
|
|
|
+ // return Result::success($data);
|
|
|
+ $data['cat_arr_id'] = isset($data['cat_arr_id'])? json_encode($data['cat_arr_id']) : '';
|
|
|
+ $data['city_arr_id'] = isset($data['city_arr_id'])? json_encode($data['city_arr_id']) : '';
|
|
|
+ $result = JobRecruiting::insertGetId($data);
|
|
|
+ if (empty($result)) {
|
|
|
+ return Result::error("添加失败", 0);
|
|
|
+ }
|
|
|
+ return Result::success($result);
|
|
|
+
|
|
|
}
|
|
|
/*
|
|
|
* 招聘信息更新
|
|
@@ -1120,24 +1127,17 @@ class NewsService implements NewsServiceInterface
|
|
|
return Result::success($data);
|
|
|
}
|
|
|
/*
|
|
|
- * 获取省
|
|
|
+ * 获取省-市
|
|
|
* */
|
|
|
- public function getProvince(array $data): array
|
|
|
+ public function getJobRecruitingArea(array $data): array
|
|
|
{
|
|
|
- $result = District::where('level',1)->first();
|
|
|
- if (empty($result)) {
|
|
|
- return Result::error("暂无此省", 0);
|
|
|
+ if(isset($data['province_id']) && $data['province_id']!=null){
|
|
|
+ $result = District::where('pid',$data['pid'])->get()->all();
|
|
|
+ }else{
|
|
|
+ $result = District::where('level',1)->get()->all();
|
|
|
}
|
|
|
- return Result::success($result);
|
|
|
- }
|
|
|
- /*
|
|
|
- * 获取市
|
|
|
- * */
|
|
|
- public function getCity(array $data): array
|
|
|
- {
|
|
|
- $result = District::where('level',2)->first();
|
|
|
if (empty($result)) {
|
|
|
- return Result::error("暂无此市", 0);
|
|
|
+ return Result::error("暂无此省市", 0);
|
|
|
}
|
|
|
return Result::success($result);
|
|
|
}
|
|
@@ -1153,24 +1153,17 @@ class NewsService implements NewsServiceInterface
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
/*
|
|
|
- * 获取职位分类
|
|
|
+ * 获取职位
|
|
|
* */
|
|
|
public function getPositionList(array $data): array
|
|
|
{
|
|
|
- $result = JobPosition::where('zwpid',0)->get()->all();
|
|
|
- if (empty($result)) {
|
|
|
- return Result::error("暂无职位分类", 0);
|
|
|
+ if(isset($data['zwpid']) && $data['zwpid']!=null){
|
|
|
+ $result = JobPosition::where('zwpid',$data['zwpid'])->get()->all();
|
|
|
+ }else{
|
|
|
+ $result = JobPosition::where('zwpid',0)->get()->all();
|
|
|
}
|
|
|
- return Result::success($result);
|
|
|
- }
|
|
|
- /*
|
|
|
- * 获取职位
|
|
|
- * */
|
|
|
- public function getPosition(array $data): array
|
|
|
- {
|
|
|
- $result = JobPosition::where('zwpid',$data['zwpid'])->get()->all();
|
|
|
if (empty($result)) {
|
|
|
- return Result::error("暂无职位", 0);
|
|
|
+ return Result::error("暂无此职位", 0);
|
|
|
}
|
|
|
return Result::success($result);
|
|
|
}
|