wang jun 3 rokov pred
rodič
commit
600008d86a

+ 15 - 0
application/index/controller/Company.php

@@ -73,4 +73,19 @@ class Company extends Base
         }
         return backjson(200, $result['data']);
     }
+    /**
+     * 获取本次活动全部公司总数
+     * 20220122
+     * wj
+     */
+    public function getcountbyparty()
+    {
+        $param = request()->param();
+        $l_c = new companylogic();
+        $result = $l_c->getcountbyparty($param);
+        if (1 != $result['status']) {
+            return backjson(0, $result['msg']);
+        }
+        return backjson(200, $result['data']);
+    }
 }

+ 16 - 0
application/index/controller/Invent.php

@@ -74,4 +74,20 @@ class Invent extends Base
         return backjson(200, $result['data']);
     }
 
+    /**
+     * 获取本次活动全部职位总数
+     * 20220122
+     * wj
+     */
+    public function getcountbyparty()
+    {
+        $param = request()->param();
+        $l_i = new inventlogic();
+        $result = $l_i->getcountbyparty($param);
+        if (1 != $result['status']) {
+            return backjson(0, $result['msg']);
+        }
+        return backjson(200, $result['data']);
+    }
+
 }

+ 21 - 4
application/index/logic/companylogic.php

@@ -31,10 +31,10 @@ class companylogic extends baselogic
             'updatebyid' => [
                 ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'numeric'],
             ],
-            'getinfowitchinventbyid'=>[
+            'getinfowitchinventbyid' => [
                 ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'numeric'],
                 ['name' => 'activestate', 'title' => 'activestate', 'regex' => '/[0|1|2]{1}/'],
-            ]
+            ],
         ];
         return $list;
     }
@@ -102,8 +102,8 @@ class companylogic extends baselogic
             return backarr(0, "无数据");
         }
         $m_i = new inventmodel();
-        $where  = ['company_id' => $info['id']];
-        if(isset($arr['activestate'])){
+        $where = ['company_id' => $info['id']];
+        if (isset($arr['activestate'])) {
             $where['active_state'] = $arr['activestate'];
         }
         $ilist = $m_i->getlist($where, "*", 1, 0);
@@ -130,4 +130,21 @@ class companylogic extends baselogic
         }
         return backarr(1, "获取成功", ['id' => $id]);
     }
+
+    /**
+     * 获取本次活动全部公司总数
+     * 20220122
+     * wj
+     */
+    public function getcountbyparty($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $partyid = $arr['partyid'];
+        $m_c = new companymodel();
+        $count = $m_c->getcountbyparty($partyid);
+        return backarr(1, "获取成功", $count);
+    }
 }

+ 23 - 4
application/index/logic/inventlogic.php

@@ -40,6 +40,9 @@ class inventlogic extends baselogic
             'getinfobyid' => [
                 ['name' => 'id', 'title' => 'companyid', 'require' => true, 'type' => 'numeric'],
             ],
+            'getcountbyparty' => [
+                ['name' => 'partyid', 'title' => 'partyid', 'require' => true, 'type' => 'numeric'],
+            ],
         ];
         return $list;
     }
@@ -93,15 +96,15 @@ class inventlogic extends baselogic
             return backarr(0, "企业信息不存在");
         }
         $m_i = new inventmodel();
-        $where = [['company_id' ,'=', $companyid]];
+        $where = [['company_id', '=', $companyid]];
         if (isset($arr['title'])) {
-            $where[] = ['title','like' , '%' . $arr['title'] . '%'];
+            $where[] = ['title', 'like', '%' . $arr['title'] . '%'];
         }
         if (isset($arr['activestate'])) {
-            $where[] = ['active_state','=',$arr['activestate']];
+            $where[] = ['active_state', '=', $arr['activestate']];
         }
         if (isset($arr['passstate'])) {
-            $where[] = ['pass_state','=',$arr['passstate']];
+            $where[] = ['pass_state', '=', $arr['passstate']];
         }
         $page = isset($arr['page']) && !empty($arr['page']) ? $arr['page'] : 1;
         $size = isset($arr['size']) && !empty($arr['size']) ? $arr['size'] : 10;
@@ -150,4 +153,20 @@ class inventlogic extends baselogic
         }
         return backarr(1, "获取成功", $iinfo);
     }
+    /**
+     * 获取本次活动全部职位总数
+     * 20220122
+     * wj
+     */
+    public function getcountbyparty($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $partyid = $arr['partyid'];
+        $m_i = new inventmodel();
+        $count = $m_i->getcountbyparty($partyid);
+        return backarr(1, "获取成功", $count);
+    }
 }

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

@@ -106,4 +106,15 @@ class companymodel extends Model
         $row = $this->where($where)->update($updateData);
         return $row;
     }
+    /**
+     * 获取本次活动全部公司总数
+     * 20220122
+     * wj
+     */
+    public function getcountbyparty($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'];
+    }
 }

+ 15 - 0
application/index/model/inventmodel.php

@@ -104,4 +104,19 @@ class inventmodel extends Model
         $row = $this->where($where)->update($updateData);
         return $row;
     }
+    /**
+     * 获取本次活动全部职位总数
+     * 20220122
+     * wj
+     */
+    public function getcountbyparty($partyid)
+    {
+        $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 . "'";
+        //$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'];
+    }
 }