15313670163 1 개월 전
부모
커밋
7a4a3b3dbf

+ 228 - 0
app/JsonRpc/NewsService.php

@@ -6,11 +6,25 @@ use App\Model\ArticleData;
 use App\Model\Category;
 use App\Model\WebsiteCategory;
 use App\Model\ArticleSurvey;
+use App\Model\District;
 use App\Model\Good;
 use App\Model\Website;
+use App\Model\JobRecruiting;
+use App\Model\JobIndustry;
+use App\Model\JobPosition;
+use App\Model\JobNature;
+use App\Model\JobEnum;
+use App\Model\User;
+use App\Model\UserRole;
+use App\Model\News;
+use App\Model\UserInfo;
+use App\Model\WebsiteGroup;
+
+;
 use Hyperf\DbConnection\Db;
 use Hyperf\RpcServer\Annotation\RpcService;
 use App\Tools\Result;
+use Directory;
 use Ramsey\Uuid\Uuid;
 use Hyperf\Utils\Random;
 
@@ -1036,4 +1050,218 @@ class NewsService implements NewsServiceInterface
 
     //20250226  产品列表
 
+    // 20250306 招聘
+    /*
+    * 招聘列表
+    * */
+    public function getJobRecruitingList(array $data): array
+    {
+        $where = [];
+        if(isset($data['keyword']) && !empty($data['keyword'])){
+            array_push($where, ['job_recruiting.title', 'like', '%'. $data['keyword']. '%']);
+        }
+        $user = User::where('id', $data['user_id'])->first();
+        if(empty($user)){
+            return Result::error("用户不存在", 0);
+        }
+        if($user['type_id'] == 3){
+            array_push($where,['user_id', $data['user_id']]);
+        }
+        $result = JobRecruiting::where($where)
+                ->leftJoin('website', 'job_recruiting.website_id', '=', 'website.id')
+                ->leftJoin('user', 'job_recruiting.user_id', '=', 'user.id')
+                ->select('job_recruiting.*', 'website.website_name as website_name', 'user.user_name as user_name')
+                ->orderBy("updated_at", "desc")
+                ->offset(($data['page'] - 1) * $data['page_size'])
+                ->limit($data['page_size'])
+                ->get()
+                ->all();
+        if (empty($result)) {
+            return Result::error("暂无招聘信息", 0);
+        }
+        return Result::success($result);
+    }
+    /*
+    * 招聘信息详情
+    * */
+    public function getJobRecruiting(array $data): array
+    {
+        $result = JobRecruiting::where('id', $data['id'])
+        ->leftJoin('user_info', 'job_recruiting.user_id', '=', 'user.id')
+        ->select('job_recruiting.*', 'user_info.*')
+        ->orderBy("updated_at", "desc")
+        ->first();
+        if (empty($result)) {
+            return Result::error("暂无招聘信息", 0);
+        }
+        return Result::success($result);
+    }
+    /*
+    * 招聘信息添加
+    * */
+    public function addRecruit(array $data): array
+    {
+        $data['user_id'] = $data['user_id'];
+        $data['website_id'] = $data['website_id'];
+        return Result::success($data);   
+    }
+    /*
+    * 招聘信息更新
+    * */
+    public function updateJobRecruiting(array $data): array
+    {
+        return Result::success($data);
+    }
+    /*
+    * 招聘信息删除
+    * */
+    public function delJobRecruiting(array $data): array
+    {
+        return Result::success($data);   
+    }
+    /*
+    * 获取省
+    * */
+    public function getProvince(array $data): array
+    {
+        $result = District::where('level',1)->first();
+        if (empty($result)) {
+            return Result::error("暂无此省", 0);
+        }
+        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::success($result);
+    }
+    /*
+    * 获取行业分类
+    * */
+    public function getIndustry(array $data): array
+    {
+        $result = JobIndustry::get()->all();
+        if (empty($result)) {
+            return Result::error("暂无行业分类", 0);
+        }
+        return Result::success($result);
+    }
+    /*
+    * 获取职位分类
+    * */
+    public function getPositionList(array $data): array
+    {
+        $result = JobPosition::where('zwpid',0)->get()->all();
+        if (empty($result)) {
+            return Result::error("暂无职位分类", 0);
+        }
+        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::success($result);
+    }
+    /*
+    * 获取工作性质-菜单
+    * */
+    public function getJobNature(array $data): array
+    {
+        $result = JobEnum::get('egroup','nature')->all();
+        if (empty($result)) {
+            return Result::error("暂无工作性质", 0);
+        }
+        return Result::success($result);
+    }
+    /*
+    * 获取工作经验-菜单
+    * */
+    public function getExperience(array $data): array
+    {
+        $result = JobEnum::where('egroup','years')->get()->all();
+        if (empty($result)) {
+            return Result::error("暂无工作经验", 0);
+        }
+        return Result::success($result);
+    }
+    /*
+    * 获取学历-菜单
+    * */
+    public function getEducation(array $data): array
+    {
+        $result = JobEnum::where('egroup','education')->get()->all();
+        if (empty($result)) {
+            return Result::error("暂无学历", 0);
+        }
+        return Result::success($result);
+    }
+    /*
+    * 获取薪资-菜单
+    * */
+    public function getSalary(array $data): array
+    {
+        $result = JobEnum::where('egroup','income')->get()->all();
+        if (empty($result)) {
+            return Result::error("暂无薪资", 0);
+        }
+        return Result::success($result);   
+    }
+    /*
+    * 获取语言-菜单
+    * */
+    public function getLanguage(array $data): array
+    {
+        $result = JobEnum::where('egroup','language')->get()->all();
+        if (empty($result)) {
+            return Result::error("暂无语言", 0);
+        }
+        return Result::success($result);
+    }
+    /*
+    * 获取掌握程度-菜单
+    * */
+    public function getLevel(array $data): array
+    {
+        $result = JobEnum::where('egroup','languagetype')->get()->all();
+        if (empty($result)) {
+            return Result::error("暂无工作性质", 0);
+        }
+        return Result::success($result);
+    }
+    // 公司信息
+    /*
+    * 获取公司性质-菜单
+    * */
+    public function getCompanyNature(array $data): array
+    {
+        $result = JobNature::get()->all();
+        if (empty($result)) {
+            return Result::error("暂无公司性质", 0);
+        }
+        return Result::success($result);
+    }
+    /*
+    * 获取公司规模-菜单
+    * */
+    public function getCompanyScale(array $data): array
+    {
+        $result = JobEnum::get('egroup','cosize')->all();
+        if (empty($result)) {
+            return Result::error("暂无公司规模", 0);
+        }
+        return Result::success($result);
+    }
+    // 20250306 招聘
 }

+ 10 - 0
app/JsonRpc/NewsServiceInterface.php

@@ -140,4 +140,14 @@ interface NewsServiceInterface
      * @return array
      */
     public function getSurveyInfo(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getJobRecruitingList(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function addRecruit(array $data):array;
 }

+ 27 - 0
app/Model/JobEnum.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class JobEnum extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'job_enum';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/JobIndustry.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class JobIndustry extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'job_industry';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/JobNature.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class JobNature extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'job_nature';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/JobPosition.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class JobPosition extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'job_position';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/JobRecruiting.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class JobRecruiting extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'job_recruiting';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/User.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class User extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'user';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/UserInfo.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class UserInfo extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'user_info';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/WebsiteGroup.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class WebsiteGroup extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'website_group';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}