王君 3 yıl önce
ebeveyn
işleme
7a52bf36e5

+ 2 - 3
application/index/controller/Party.php

@@ -58,10 +58,9 @@ class Party extends Base
         foreach ($list as $key => $value) {
             $where = ['id'=>$value['company_id'],'activestate'=>1];
             $result = $l_c->getinfowitchinventbyid($where);
-            if(!$result['status']){
-                return backjson(0, $result['msg']);
+            if(1==$result['status']){
+                $uselist[] = $result['data'];
             }
-            $uselist[] = $result['data'];
         }
         return backjson(200, $uselist);
     }

+ 25 - 0
application/index/controller/Resume.php

@@ -91,4 +91,29 @@ class Resume extends Base
         }
         return backjson(200, $result['data']);
     }
+    /**
+     * 根据条件 查投递简历记录
+     *
+     * @return void
+     */
+    public function getsendedresumebywhere(){
+        $param = request()->param();
+        $l_r = new resumelogic();
+        $result = $l_r->getsendedresumebywhere($param);
+        if (1 != $result['status']) {
+            return backjson(0, $result['msg']);
+        }
+        $rlist = [];
+        $list = $result['data'];
+        $l_r = new resumelogic();
+        foreach ($list as $key => $value) {
+            $where =['id'=>$value['resume_id']];
+            $result = $l_r->getallinfobyid($where);
+            if(1==$result['status']){
+                $rlist[] = $result['data'];
+                 
+            }
+        } 
+        return backjson(200, $rlist);
+    }
 }

+ 2 - 0
application/index/logic/inventlogic.php

@@ -31,6 +31,8 @@ class inventlogic extends baselogic
                 ['name' => 'passstate', 'title' => 'passstate', 'type' => 'numeric', 'regex' => '/[0|1|2]{1}/'],
                 ['name' => 'activestate', 'title' => 'activestate', 'type' => 'numeric', 'regex' => '/[0|1]{1}/'],
                 ['name' => 'title', 'title' => 'title', 'type' => 'string', 'regex' => '/.{2,}/'],
+                ['name' => 'page', 'title' => 'page', 'type' => 'numeric'],
+                ['name' => 'size', 'title' => 'size', 'type' => 'numeric'],
             ],
             'updatebyid' => [
                 ['name' => 'id', 'title' => 'companyid', 'require' => true, 'type' => 'numeric'],

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

@@ -35,6 +35,9 @@ class partylogic extends baselogic
             'getlistbywhere' => [
                 ['name' => 'partyid', 'title' => 'partyid', 'require' => true, 'type' => 'numeric'],
             ],
+            'getlistcompanybypartyid'=>[
+                ['name' => 'partyid', 'title' => 'partyid', 'require' => true, 'type' => 'numeric'],
+            ]
         ];
         return $list;
     }

+ 143 - 1
application/index/logic/resumelogic.php

@@ -38,11 +38,26 @@ class resumelogic extends baselogic
             'getinfobyopenid' => [
                 ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
             ],
-            'sendinvent' => [
+            'sendresume' => [
                 ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
                 ['name' => 'inventid', 'title' => 'inventid', 'require' => true, 'type' => 'numeric'],
                 ['name' => 'partyid', 'title' => 'partyid', 'type' => 'numeric'],
             ],
+            'getsendedresumebywhere'=>[
+                ['name' => 'openid', 'title' => 'companyid', 'require' => true, 'type' => 'string'],
+                ['name' => 'status', 'title' => 'status', 'type' => 'numeric', 'regex' => '/[0|1|2]{1}/'],
+                ['name' => 'page', 'title' => 'page', 'type' => 'numeric'],
+                ['name' => 'size', 'title' => 'size', 'type' => 'numeric'],
+            ],
+            'getinfobyid'=>[
+                ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'numeric'],
+            ],
+            'getinfobyuserid'=>[
+                ['name' => 'userid', 'title' => 'userid', 'require' => true, 'type' => 'numeric'],
+            ],
+            'getallinfobyid'=>[
+                ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'numeric'],
+            ]
         ];
         return $list;
     }
@@ -175,6 +190,95 @@ class resumelogic extends baselogic
         $rinfo['welist'] = $welist;
         return backarr(1, "查询成功", $rinfo);
     }
+    /**
+     * 根据id获取简历
+     * 20220119
+     * wj
+     */
+    public function getinfobyid($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $id = $arr['id'];
+        $m_r = new resumemodel();
+        $rinfo = $m_r->getinfobyid($id);
+        if (empty($rinfo)) {
+            return backarr(0, "简历不存在");
+        }
+        $resumeid = $rinfo['id'];
+        $m_eb = new educationbackgroundemodel();
+        $eblist = $m_eb->getList(['resume_id' => $resumeid], '*', 1, 0);
+        $rinfo['eblist'] = $eblist;
+        $m_we = new workexperiencemodel();
+        $welist = $m_we->getList(['resume_id' => $resumeid], '*', 1, 0);
+        $rinfo['welist'] = $welist;
+        return backarr(1, "查询成功", $rinfo);
+    }
+    /**
+     * 根据id获取简历、用户信息
+     * 20220119
+     * wj
+     */
+    public function  getallinfobyid($arr){
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $id = $arr['id'];
+        $m_r = new resumemodel();
+        $rinfo = $m_r->getinfobyid($id);
+        if (empty($rinfo)) {
+            return backarr(0, "简历不存在");
+        }
+        $resumeid = $rinfo['id'];
+        $m_eb = new educationbackgroundemodel();
+        $eblist = $m_eb->getList(['resume_id' => $resumeid], '*', 1, 0);
+        $rinfo['eblist'] = $eblist;
+        $m_we = new workexperiencemodel();
+        $welist = $m_we->getList(['resume_id' => $resumeid], '*', 1, 0);
+        $rinfo['welist'] = $welist;
+        $userid = $rinfo['user_id'];
+        $m_u = new usermodel();
+        $uinfo = $m_u->getfieldbyid($userid);
+        if (empty($uinfo)) {
+            return backarr(0, "用户信息不存在");
+        }
+        $rinfo['userinfo'] = $uinfo;
+        return backarr(1, "查询成功", $rinfo);
+    }
+    /**
+     * 根据id获取简历
+     * 20220119
+     * wj
+     */
+    public function getinfobyuserid($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $userid = $arr['userid'];
+        $m_u = new usermodel();
+        $uinfo = $m_u->getinfobyid($userid);
+        if (empty($uinfo)) {
+            return backarr(0, "用户信息不存在");
+        }
+        $m_r = new resumemodel();
+        $rinfo = $m_r->getinfobyuserid($userid);
+        if (empty($rinfo)) {
+            return backarr(0, "简历不存在");
+        }
+        $resumeid = $rinfo['id'];
+        $m_eb = new educationbackgroundemodel();
+        $eblist = $m_eb->getList(['resume_id' => $resumeid], '*', 1, 0);
+        $rinfo['eblist'] = $eblist;
+        $m_we = new workexperiencemodel();
+        $welist = $m_we->getList(['resume_id' => $resumeid], '*', 1, 0);
+        $rinfo['welist'] = $welist;
+        return backarr(1, "查询成功", $rinfo);
+    }
     /**
      * 简历投递
      * 20220119
@@ -217,6 +321,7 @@ class resumelogic extends baselogic
         $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)) {
@@ -224,4 +329,41 @@ class resumelogic extends baselogic
         }
         return backarr(1, "投递成功", ['id' => $id]);
     }
+    /**
+     * 根据条件获取简历投地记录
+     * 企业用户返回 向企业投递的简历 根据 company_id 查
+     * 非企业用户返回 投递过的简历 根据 send_user_id 查
+     *
+     * @return void
+     */
+    public function getsendedresumebywhere($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, "用户信息不存在");
+        }
+        $where = [];
+        if(isset($arr['status'])){
+            $where['status'] = $arr['status'];
+        }
+        if(1!=$uinfo['is_company']){
+            $where['send_user_id'] = $uinfo['id'];
+        }else{
+            $where['company_id'] = $uinfo['company_id'];
+        }
+        $m_s = new sendrecordmodel();
+        $count = $m_s->getlist($where,'count');
+        if($count<0){
+            return backarr(0,"无数据");
+        }
+        $page = isset($arr['page']) && !empty($arr['page']) ? $arr['page'] : 1;
+        $size = isset($arr['size']) && !empty($arr['size']) ? $arr['size'] : 10;
+        $list = $m_s->getList($where, '*', $page, $size);
+        return backarr(1, "查询成功", $list);
+    }
 }

+ 23 - 0
application/index/logic/userlogic.php

@@ -32,6 +32,9 @@ class userlogic extends baselogic
             'getfieldbyopenid' => [
                 ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
             ],
+            'getfieldbyid'=>[
+                ['name' => 'userid', 'title' => 'userid', 'require' => true, 'type' => 'string'],
+            ]
         ];
         return $list;
     }
@@ -174,4 +177,24 @@ class userlogic extends baselogic
         }
         return backarr(1, '查询成功', $info);
     }
+    /**
+     * 获取数据根据openid
+     * wj
+     * 20220118
+     */
+    public function getfieldbyid($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $userid = $arr['userid'];
+        $m_u = new usermodel();
+        $field = ["id", "user_name", "telno", "gender", "age", "email", "is_active", "is_company"];
+        $info = $m_u->getfieldbyid($userid, $field);
+        if (empty($info)) {
+            return backarr(0, '无用户');
+        }
+        return backarr(1, '查询成功', $info);
+    }
 }

+ 11 - 0
application/index/model/resumemodel.php

@@ -89,6 +89,17 @@ class resumemodel extends Model
         $info = $this->where($where)->find();
         return $info;
     }
+    /**
+     * 根据id获取信息
+     * wj
+     * 20220119
+     */
+    public function getinfobyid($id)
+    {
+        $where = ['id' => $id];
+        $info = $this->where($where)->find();
+        return $info;
+    }
     /**
      * 根据id修改数据
      * wj

+ 28 - 0
application/index/model/usermodel.php

@@ -79,6 +79,17 @@ class usermodel extends Model
         }
         return $data;
     }
+    /**
+     * 根据id获取信息
+     * wj
+     * 20220118
+     */
+    public function getinfobyid($id)
+    {
+        $where = ['id' => $id];
+        $info = $this->where($where)->find();
+        return $info;
+    }
     /**
      * 根据openid获取信息
      * wj
@@ -97,10 +108,27 @@ class usermodel extends Model
      */
     public function getfieldbyopenid($openid, $field = "")
     {
+        if(empty($field)){
+            $field=["id", "user_name", "telno", "gender", "age", "email", "is_active", "is_company"];
+        }
         $where = ['openid' => $openid];
         $info = $this->field($field)->where($where)->find();
         return $info;
     }
+    /**
+     * 根据id获取信息
+     * wj
+     * 20220118
+     */
+    public function getfieldbyid($id, $field = "")
+    {
+        if(empty($field)){
+            $field=["id", "user_name", "telno", "gender", "age", "email", "is_active", "is_company"];
+        }
+        $where = ['id' => $id];
+        $info = $this->field($field)->where($where)->find();
+        return $info;
+    }
     /**
      * 根据openid获取信息
      * wj