wang jun 3 年之前
父節點
當前提交
1c20d8b95e

+ 1 - 1
application/admin/controller/Weblogin.php

@@ -10,7 +10,7 @@ namespace app\admin\controller;
 use app\admin\logic\webuserlogic;
 use app\admin\logic\webuserloglogic;
 use think\Controller;
-use think\Log;
+use think\facade\Log;
 
 class Weblogin extends AdminBase
 {

+ 2 - 2
application/admin/logic/webuserloglogic.php

@@ -9,7 +9,7 @@ namespace app\admin\logic;
 
 use app\admin\model\webuserlogmodel;
 use app\admin\model\webusermodel;
-use think\Request;
+use think\facade\Request;
 
 class webuserloglogic
 {
@@ -18,7 +18,7 @@ class webuserloglogic
     {
         $insertData = [];
         $m_wu = new webusermodel();
-        $ip = Request::instance()->ip();
+        $ip = Request::ip();
         $insertData = [
             'ip' => $ip,
             'createtime' => date('Y-m-d H:i:s'),

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

@@ -16,7 +16,7 @@ class Party extends Base
     {
         $param = request()->param();
         $l_p = new partylogic();
-        $time =date('Y-m-d H:i:s');
+        $time = date('Y-m-d H:i:s');
         $param['time'] = $time;
         $result = $l_p->getinfobytime($param);
         if (1 != $result['status']) {
@@ -56,12 +56,27 @@ class Party extends Base
         $list = $result['data'];
         $l_c = new companylogic();
         foreach ($list as $key => $value) {
-            $where = ['id'=>$value['company_id'],'activestate'=>1];
+            $where = ['id' => $value['company_id'], 'activestate' => 1];
             $result = $l_c->getinfowitchinventbyid($where);
-            if(1==$result['status']){
+            if (1 == $result['status']) {
                 $uselist[] = $result['data'];
             }
         }
         return backjson(200, $uselist);
     }
+    /**
+     * 判断企业是否已报名
+     * 20220208
+     * wj
+     */
+    public function checkiscompanysign()
+    {
+        $param = request()->param();
+        $l_p = new partylogic();
+        $result = $l_p->checkiscompanysign($param);
+        if (1 != $result['status']) {
+            return backjson(0, $result['msg']);
+        }
+        return backjson(200, $result['msg']);
+    }
 }

+ 3 - 3
application/index/logic/companylogic.php

@@ -58,9 +58,9 @@ class companylogic extends baselogic
         if (empty($info)) {
             return backarr(0, "用户不存在");
         }
-        if (empty($info['is_company'])) {
-            return backarr(0, "非企业用户");
-        }
+        /*if (empty($info['is_company'])) {
+        return backarr(0, "非企业用户");
+        }*/
         unset($arr['openid']);
         $where = [];
         $cinfo = [];

+ 26 - 2
application/index/logic/partylogic.php

@@ -35,9 +35,13 @@ class partylogic extends baselogic
             'getlistbywhere' => [
                 ['name' => 'partyid', 'title' => 'partyid', 'require' => true, 'type' => 'numeric'],
             ],
-            'getlistcompanybypartyid'=>[
+            'getlistcompanybypartyid' => [
                 ['name' => 'partyid', 'title' => 'partyid', 'require' => true, 'type' => 'numeric'],
-            ]
+            ],
+            'checkiscompanysign' => [
+                ['name' => 'partyid', 'title' => 'partyid', 'require' => true, 'type' => 'numeric'],
+                ['name' => 'companyid', 'title' => 'companyid', 'require' => true, 'type' => 'numeric'],
+            ],
         ];
         return $list;
     }
@@ -147,4 +151,24 @@ class partylogic extends baselogic
         $list = $m_pr->getList($where, '*', $page, $size);
         return backarr(1, "查询成功", $list);
     }
+    /**
+     * 判断企业是否已报名
+     * 20220208
+     * wj
+     */
+    public function checkiscompanysign($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $partyid = $arr['partyid'];
+        $companyid = $arr['companyid'];
+        $m_pr = new partyrecordmodel();
+        $issign = $m_pr->checkiscompanysign($partyid, $companyid);
+        if ($issign) {
+            return backarr(1, '已注册');
+        }
+        return backarr(0, '未注册');
+    }
 }

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

@@ -48,6 +48,8 @@ class resumelogic extends baselogic
                 ['name' => 'status', 'title' => 'status', 'type' => 'numeric', 'regex' => '/[0|1|2]{1}/'],
                 ['name' => 'page', 'title' => 'page', 'type' => 'numeric'],
                 ['name' => 'size', 'title' => 'size', 'type' => 'numeric'],
+                ['name' => 'iscompany', 'title' => 'iscompany', 'type' => 'numeric', 'regex' => '/[0|1]{1}/'],
+                ['name' => 'inventid', 'title' => 'inventid', 'type' => 'numeric'],
             ],
             'getinfobyid' => [
                 ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'numeric'],
@@ -348,16 +350,25 @@ class resumelogic extends baselogic
             return $result;
         }
         $openid = $arr['openid'];
+        $iscompany = isset($arr['iscompany']) ? $arr['iscompany'] : 0;
         $m_u = new usermodel();
         $uinfo = $m_u->getinfobyopenid($openid);
         if (empty($uinfo)) {
             return backarr(0, "用户信息不存在");
         }
         $where = [];
+        if (isset($arr['inventid'])) {
+            $where['invent_id'] = $arr['inventid'];
+        }
         if (isset($arr['status'])) {
             $where['status'] = $arr['status'];
         }
-        if (1 != $uinfo['is_company']) {
+        /*if (1 != $uinfo['is_company']) {
+        $where['send_user_id'] = $uinfo['id'];
+        } else {
+        $where['company_id'] = $uinfo['company_id'];
+        }*/
+        if (1 != $iscompany) {
             $where['send_user_id'] = $uinfo['id'];
         } else {
             $where['company_id'] = $uinfo['company_id'];

+ 1 - 1
application/index/model/inventmodel.php

@@ -114,7 +114,7 @@ class inventmodel extends Model
         $str = "select count(i.id) as count from t_invent as i
         join t_company as c on c.id=i.company_id
         join t_partyrecord as pr on pr.company_id =c.id
-        where pr.party_id='" . $partyid . "'";
+        where i.active_state=1 and pr.party_id='" . $partyid . "'";
         //$str = "select count(*) as count from t_company as c join t_partyrecord as pr on pr.company_id =c.id where pr.party_id='" . $partyid . "'";
         $result = $this->query($str);
         return $result[0]['count'];

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

@@ -79,4 +79,18 @@ class partyrecordmodel extends Model
         }
         return $data;
     }
+    /**
+     * 判断企业是否已报名
+     * 20220208
+     * wj
+     */
+    public function checkiscompanysign($partyid, $companyid)
+    {
+        $where = [
+            'party_id' => $partyid,
+            'company_id' => $companyid,
+        ];
+        $info = $this->where($where)->find();
+        return !empty($info);
+    }
 }