wang jun vor 3 Jahren
Ursprung
Commit
3ed683239a

+ 61 - 0
application/index/controller/Party.php

@@ -0,0 +1,61 @@
+<?php
+namespace app\index\controller;
+
+use app\index\logic\companylogic;
+use app\index\logic\partylogic;
+use think\Controller;
+
+class Party extends Base
+{
+    /**
+     * 根据时间获取活动信息
+     * 20220119
+     * wj
+     */
+    public function getinfobytime()
+    {
+        $param = request()->param();
+        $l_p = new partylogic();
+        $result = $l_p->getlistbywhere($param);
+        if (1 != $result['status']) {
+            return backjson(0, $result['msg']);
+        }
+        return backjson(200, $result['data']);
+    }
+    /**
+     * 企业报名
+     * 20220119
+     * wj
+     */
+    public function companysignup()
+    {
+        $param = request()->param();
+        $l_p = new partylogic();
+        $result = $l_p->companysingup($param);
+        if (1 != $result['status']) {
+            return backjson(0, $result['msg']);
+        }
+        return backjson(200, $result['data']);
+    }
+    /**
+     * 获取报名的企业列表
+     * 20220119
+     * wj
+     */
+    public function getcompanylist()
+    {
+        $param = request()->param();
+        $l_p = new partylogic();
+        $result = $l_p->getlistcompanybypartyid($param);
+        if (1 != $result['status']) {
+            return backjson(0, $result['msg']);
+        }
+        $uselist = [];
+        $list = $result['data'];
+        $l_c = new companylogic();
+        foreach ($list as $key => $value) {
+            $uselist[] = $l_c->getinfowitchinventbyid($value['company_id']);
+        }
+        return backjson(200, $uselist);
+    }
+}

+ 16 - 1
application/index/controller/Resume.php

@@ -3,7 +3,7 @@
  * @Author: wang jun
  * @Date: 2022-01-18 10:57:14
  * @Last Modified by: wang jun
- * @Last Modified time: 2022-01-19 15:32:41
+ * @Last Modified time: 2022-01-19 17:28:58
  * 微信类
  */
 namespace app\index\controller;
@@ -76,4 +76,19 @@ class Resume extends Base
         }
         return backjson(200, $result['data']);
     }
+    /**
+     * 用户投递简历
+     * 20220119
+     * wj
+     */
+    public function sendresume()
+    {
+        $param = request()->param();
+        $l_r = new resumelogic();
+        $result = $l_r->sendresume($param);
+        if (1 != $result['status']) {
+            return backjson(0, $result['msg']);
+        }
+        return backjson(200, $result['data']);
+    }
 }

+ 146 - 0
application/index/logic/partylogic.php

@@ -0,0 +1,146 @@
+<?php
+/*
+ * @Author: wang jun
+ * @Date: 2022-01-18 11:12:23
+ * @Last Modified by: wang jun
+ * @Last Modified time: 2022-01-19 17:24:07
+ * 微信类
+ */
+namespace app\index\logic;
+
+use app\index\model\companymodel;
+use app\index\model\partymodel;
+use app\index\model\partyrecordmodel;
+
+class partylogic extends baselogic
+{
+    /**
+     * 设置请求数据规则
+     * 20220107
+     * wj
+     */
+    protected function setrules()
+    {
+        $list = [
+            'getinfobytime' => [
+                ['name' => 'time', 'title' => 'openid', 'require' => true, 'type' => 'string'],
+            ],
+            'getinfobyid' => [
+                ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'numeric'],
+            ],
+            'companysingup' => [
+                ['name' => 'partyid', 'title' => 'partyid', 'require' => true, 'type' => 'numeric'],
+                ['name' => 'companyid', 'title' => 'companyid', 'require' => true, 'type' => 'numeric'],
+            ],
+            'getlistbywhere' => [
+                ['name' => 'partyid', 'title' => 'partyid', 'require' => true, 'type' => 'numeric'],
+            ],
+        ];
+        return $list;
+    }
+    /**
+     * 根据时间获取信息
+     * 20220119
+     * wj
+     */
+    public function getinfobytime($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $time = $arr['time'];
+        $m_i = new partymodel();
+        $info = $m_i->getinfobytime($time);
+        if (empty($row)) {
+            return backarr(0, "无数据");
+        }
+        return backarr(1, "获取成功", $info);
+    }
+    /**
+     * 根据id获取信息
+     * 20220119
+     * wj
+     */
+    public function getinfobyid($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $id = $arr['id'];
+        $m_i = new partymodel();
+        $info = $m_i->getinfobyid($id);
+        if (empty($row)) {
+            return backarr(0, "无数据");
+        }
+        return backarr(1, "获取成功", $info);
+    }
+    /**
+     * 企业报名
+     * 20220119
+     * wj
+     */
+    public function companysingup($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $companyid = $arr['companyid'];
+        $partyid = $arr['partyid'];
+        $m_c = new companymodel();
+        $cinfo = $m_c->getinfobyid($companyid);
+        if (empty($cinfo)) {
+            return backarr(0, "企业信息不存在");
+        }
+        $m_p = new partymodel();
+        $pinfo = $m_p->getinfobyid($partyid);
+        if (empty($pinfo)) {
+            return backarr(0, "活动信息不存在");
+        }
+        $m_pr = new partyrecordmodel();
+        $where = [
+            'party_id' => $pinfo['id'],
+            'company_id' => $cinfo['id'],
+        ];
+        $pfinfo = $m_pr->getInfo($where, ['id']);
+        if (!empty($pfinfo)) {
+            return backarr(0, "企业已报名");
+        }
+        $arr['party_id'] = $pinfo['id'];
+        $arr['company_id'] = $cinfo['id'];
+        $id = $m_pr->insertData($arr);
+        if (empty($id)) {
+            return backarr(0, "报名失败");
+        }
+        return backarr(0, "报名成功", ['id' => $id]);
+    }
+    /**
+     * 获取列表
+     * 20220119
+     * wj
+     */
+    public function getlistcompanybypartyid($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $partyid = $arr['partyid'];
+        $m_p = new partymodel();
+        $pinfo = $m_p->getinfobyid($partyid);
+        if (empty($pinfo)) {
+            return backarr(0, "活动信息不存在");
+        }
+        $where = ['party_id' => $partyid];
+        $page = isset($arr['page']) && !empty($arr['page']) ? $arr['page'] : 1;
+        $size = isset($arr['size']) && !empty($arr['size']) ? $arr['size'] : 10;
+        $count = $m_i->getList($where, 'count');
+        if ($count <= 0) {
+            return backarr(0, "无数据");
+        }
+        $list = $m_i->getList($where, '*', $page, $size);
+        return backarr(1, "查询成功", $list);
+    }
+}

+ 58 - 2
application/index/logic/resumelogic.php

@@ -3,13 +3,16 @@
  * @Author: wang jun
  * @Date: 2022-01-18 11:12:23
  * @Last Modified by: wang jun
- * @Last Modified time: 2022-01-19 15:48:24
+ * @Last Modified time: 2022-01-19 17:29:15
  * 微信类
  */
 namespace app\index\logic;
 
 use app\index\model\educationbackgroundemodel;
+use app\index\model\inventmodel;
+use app\index\model\partymodel;
 use app\index\model\resumemodel;
+use app\index\model\sendrecordmodel;
 use app\index\model\usermodel;
 use app\index\model\workexperiencemodel;
 
@@ -35,6 +38,11 @@ class resumelogic extends baselogic
             'getinfobyopenid' => [
                 ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
             ],
+            'sendinvent' => [
+                ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
+                ['name' => 'inventid', 'title' => 'inventid', 'require' => true, 'type' => 'numeric'],
+                ['name' => 'partyid', 'title' => 'partyid', 'type' => 'numeric'],
+            ],
         ];
         return $list;
     }
@@ -135,7 +143,11 @@ class resumelogic extends baselogic
         }
         return backarr(1, "新增成功", ['id' => $id]);
     }
-
+    /**
+     * 根据openid获取简历
+     * 20220119
+     * wj
+     */
     public function getinfobyopenid($arr)
     {
         $result = $this->checkparam(__FUNCTION__, $arr);
@@ -163,4 +175,48 @@ class resumelogic extends baselogic
         $rinfo['welist'] = $welist;
         return backarr(1, "查询成功", $rinfo);
     }
+    /**
+     * 简历投递
+     * 20220119
+     * wj
+     */
+    public function sendresume($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $openid = $arr['openid'];
+        $m_u = new usermodel();
+        $uinfo = $m_u->getinfobyopenid($openid);
+        if (empty($uinfo)) {
+            return backarr(0, "用户信息不存在");
+        }
+        $inventid = $arr['inventid'];
+        $m_i = new inventmodel();
+        $iinfo = $m_i->getinfobyid($inventid);
+        $m_r = new resumemodel();
+        $userid = $uinfo['id'];
+        $rinfo = $m_r->getinfobyuserid($userid);
+        if (empty($rinfo)) {
+            return backarr(0, "简历不存在");
+        }
+        $partyid = $arr['partyid'];
+        $m_p = new partymodel();
+        $pinfo = $m_p->getinfobyid($partyid);
+        if (empty($pinfo)) {
+            return backarr(0, "活动不存在");
+        }
+        $arr['send_user_id'] = $userid;
+        $arr['party_id'] = $pinfo['id'];
+        $arr['company_id'] = $iinfo['company_id'];
+        $arr['resume_id'] = $rinfo['id'];
+        $arr['invent_id'] = $iinfo['id'];
+        $m_s = new sendrecordmodel();
+        $id = $m_s->insertData($arr);
+        if (empty($id)) {
+            return backarr(0, "投递失败");
+        }
+        return backarr(1, "投递成功", ['id' => $id]);
+    }
 }

+ 113 - 0
application/index/model/partymodel.php

@@ -0,0 +1,113 @@
+<?php
+/*
+ * @Author: wang jun
+ * @Date: 2022-01-18 09:43:33
+ * @Last Modified by: wang jun
+ * @Last Modified time: 2022-01-19 16:39:15
+ */
+namespace app\index\model;
+
+use think\Model;
+
+class partymodel extends Model
+{
+    protected $table = 't_party';
+
+    public function insertData($data)
+    {
+        if (!isset($data['crate_time']) || empty($data['crate_time']) || !is_string($data['crate_time'])) {
+            $data['crate_time'] = date("Y-m-d H:i:s");
+        }
+        $data = $this->formatData($data);
+        if (empty($data)) {
+            return false;
+        }
+
+        $id = $this->insertGetId($data);
+        return empty($id) ? false : $id;
+    }
+    /**
+     * 校验入库数据
+     * 20220119
+     */
+    private function formatData($data)
+    {
+        $useData = [];
+        $fields = $this->getTableFields();
+        foreach ($data as $key => $value) {
+            if (in_array($key, $fields)) {
+                $useData[$key] = $value;
+            }
+        }
+        return $useData;
+    }
+    public function getInfo($where, $field = "*", $row = true)
+    {
+        $info = $this->field($field)->where($where);
+        if ($row) {
+            $info = $info->find();
+        } else {
+            $info = $info->select();
+        }
+        return empty($info) ? false : $info;
+    }
+
+    public function updateinfo($where, $updateData)
+    {
+        $row = $this->where($where)->update($updateData);
+        return empty($row) ? false : $row;
+    }
+
+    public function deleteinfo($where)
+    {
+        $row = $this->where($where)->delete();
+        return empty($row) ? false : $row;
+    }
+
+    public function getList($where = [], $field = "*", $page = 1, $size = 10, $order = "id desc", $group = "", $row = false)
+    {
+        $sqlObj = $this->where($where);
+        if ("count" != $field) {
+            $sqlObj = $sqlObj->field($field)->order($order)->group($group)->page($page, $size);
+            if ($row) {
+                $data = $sqlObj->find();
+            } else {
+                $data = $sqlObj->select();
+            }
+        } else {
+            $data = $sqlObj = $sqlObj->count();
+        }
+        return $data;
+    }
+    /**
+     * 根据时间获取活动
+     * 20220119
+     * wj
+     */
+    public function getinfobytime($time)
+    {
+        $where = [
+            'isactive' => 1,
+            'start_time' => ['<=', $time],
+            'end_time' => ['>=', $time],
+        ];
+        $order = "id asc";
+        $info = $this->where($where)->order($order)->find();
+        return empty($info) ? false : $info;
+    }
+    /**
+     * 根据时间获取活动
+     * 20220119
+     * wj
+     */
+    public function getinfobyid($id)
+    {
+        $where = [
+            'id' => $id,
+            'isactive' => 1,
+        ];
+        $order = "id asc";
+        $info = $this->where($where)->order($order)->find();
+        return empty($info) ? false : $info;
+    }
+}

+ 82 - 0
application/index/model/partyrecordmodel.php

@@ -0,0 +1,82 @@
+<?php
+/*
+ * @Author: wang jun
+ * @Date: 2022-01-18 09:43:33
+ * @Last Modified by: wang jun
+ * @Last Modified time: 2022-01-19 16:37:16
+ */
+namespace app\index\model;
+
+use think\Model;
+
+class partyrecordmodel extends Model
+{
+    protected $table = 't_partyrecord';
+
+    public function insertData($data)
+    {
+        if (!isset($data['create_time']) || empty($data['create_time']) || !is_string($data['create_time'])) {
+            $data['create_time'] = date("Y-m-d H:i:s");
+        }
+        $data = $this->formatData($data);
+        if (empty($data)) {
+            return false;
+        }
+
+        $id = $this->insertGetId($data);
+        return empty($id) ? false : $id;
+    }
+    /**
+     * 校验入库数据
+     * 20220119
+     */
+    private function formatData($data)
+    {
+        $useData = [];
+        $fields = $this->getTableFields();
+        foreach ($data as $key => $value) {
+            if (in_array($key, $fields)) {
+                $useData[$key] = $value;
+            }
+        }
+        return $useData;
+    }
+    public function getInfo($where, $field = "*", $row = true)
+    {
+        $info = $this->field($field)->where($where);
+        if ($row) {
+            $info = $info->find();
+        } else {
+            $info = $info->select();
+        }
+        return empty($info) ? false : $info;
+    }
+
+    public function updateinfo($where, $updateData)
+    {
+        $row = $this->where($where)->update($updateData);
+        return empty($row) ? false : $row;
+    }
+
+    public function deleteinfo($where)
+    {
+        $row = $this->where($where)->delete();
+        return empty($row) ? false : $row;
+    }
+
+    public function getList($where = [], $field = "*", $page = 1, $size = 10, $order = "id desc", $group = "", $row = false)
+    {
+        $sqlObj = $this->where($where);
+        if ("count" != $field) {
+            $sqlObj = $sqlObj->field($field)->order($order)->group($group)->page($page, $size);
+            if ($row) {
+                $data = $sqlObj->find();
+            } else {
+                $data = $sqlObj->select();
+            }
+        } else {
+            $data = $sqlObj = $sqlObj->count();
+        }
+        return $data;
+    }
+}

+ 82 - 0
application/index/model/sendrecordmodel.php

@@ -0,0 +1,82 @@
+<?php
+/*
+ * @Author: wang jun
+ * @Date: 2022-01-18 09:43:33
+ * @Last Modified by: wang jun
+ * @Last Modified time: 2022-01-19 16:30:31
+ */
+namespace app\index\model;
+
+use think\Model;
+
+class sendrecordmodel extends Model
+{
+    protected $table = 't_sendrecord';
+
+    public function insertData($data)
+    {
+        if (!isset($data['send_time']) || empty($data['send_time']) || !is_string($data['send_time'])) {
+            $data['send_time'] = date("Y-m-d H:i:s");
+        }
+        $data = $this->formatData($data);
+        if (empty($data)) {
+            return false;
+        }
+
+        $id = $this->insertGetId($data);
+        return empty($id) ? false : $id;
+    }
+    /**
+     * 校验入库数据
+     * 20220119
+     */
+    private function formatData($data)
+    {
+        $useData = [];
+        $fields = $this->getTableFields();
+        foreach ($data as $key => $value) {
+            if (in_array($key, $fields)) {
+                $useData[$key] = $value;
+            }
+        }
+        return $useData;
+    }
+    public function getInfo($where, $field = "*", $row = true)
+    {
+        $info = $this->field($field)->where($where);
+        if ($row) {
+            $info = $info->find();
+        } else {
+            $info = $info->select();
+        }
+        return empty($info) ? false : $info;
+    }
+
+    public function updateinfo($where, $updateData)
+    {
+        $row = $this->where($where)->update($updateData);
+        return empty($row) ? false : $row;
+    }
+
+    public function deleteinfo($where)
+    {
+        $row = $this->where($where)->delete();
+        return empty($row) ? false : $row;
+    }
+
+    public function getList($where = [], $field = "*", $page = 1, $size = 10, $order = "id desc", $group = "", $row = false)
+    {
+        $sqlObj = $this->where($where);
+        if ("count" != $field) {
+            $sqlObj = $sqlObj->field($field)->order($order)->group($group)->page($page, $size);
+            if ($row) {
+                $data = $sqlObj->find();
+            } else {
+                $data = $sqlObj->select();
+            }
+        } else {
+            $data = $sqlObj = $sqlObj->count();
+        }
+        return $data;
+    }
+}