Browse Source

积分进度+1

sugangqiang 2 years ago
parent
commit
35621a9102
2 changed files with 68 additions and 43 deletions
  1. 62 5
      app/common/api/IntegralRecordApi.php
  2. 6 38
      app/enterprise/view/integral/index.html

+ 62 - 5
app/common/api/IntegralRecordApi.php

@@ -35,10 +35,57 @@ class IntegralRecordApi {
             $where[] = ["enterprise_id", "=", session("user")["uid"]];
             $where[] = ["enterprise_id", "=", session("user")["uid"]];
         }
         }
         $where[] = ["ir.delete", "=", 0];
         $where[] = ["ir.delete", "=", 0];
-        $count = IntegralRecord::alias("ir")->leftJoin("un_enterprise e", "e.id=ir.enterprise_id")->where($where)->count();
-        $list = IntegralRecord::alias("ir")->leftJoin("un_enterprise e", "e.id=ir.enterprise_id")->where($where)->field("ir.*,if(ir.updateTime is not null,ir.updateTime,ir.createTime) as orderTime")->limit($offset, $limit)->order("orderTime " . $order)->select();
+        if ($params["apply_year"]) {
+            $where[] = ["b.batch", "like", "%{$params['apply_year']}%"];
+        }
+        if ($params["name"]) {
+            $where[] = ["ir.name", "like", "%{$params['name']}%"];
+        }
+        if ($params["card_number"]) {
+            $where[] = ["ir.card_number", "like", "%{$params['card_number']}%"];
+        }
+        if ($params["phone"]) {
+            $where[] = ["ir.phone", "like", "%{$params['phone']}%"];
+        }
+        if ($params["email"]) {
+            $where[] = ["ir.email", "like", "%{$params['email']}%"];
+        }
+        if ($params["shareholder"]) {
+            $where[] = ["ir.shareholder", "=", $params['shareholder']];
+        }
+        switch ($params["checkState"]) {
+            case -1:
+                $where[] = ["tl.state", "in", [IntegralState::VERIFY_FAIL, IntegralState::REVERIFY_FAIL, IntegralState::ZX_FAIL, IntegralState::ANNOUNCED_REVERIFY_FAIL, IntegralState::PUBLISH_FAIL]];
+                break;
+            case 1:
+                $where[] = ["tl.state", "=", IntegralState::SAVE];
+                break;
+            case 2:
+                $where[] = ["tl.state", "in", [IntegralState::VERIFY_REJECT, IntegralState::REVERIFY_REJECT]];
+                break;
+            case 3:
+                $where[] = ["tl.state", "in", [IntegralState::SUBMIT, IntegralState::VERIFY_PASS]];
+                break;
+            case 4:
+                $where[] = ["tl.state", ">=", IntegralState::REVERIFY_PASS];
+                $where[] = ["tl.state", "not in", [IntegralState::REVERIFY_REJECT, IntegralState::REVERIFY_FAIL]];
+                break;
+            case 5:
+                $where[] = ["tl.state", "=", IntegralState::SUCCESS];
+                break;
+        }
+        $count = IntegralRecord::alias("ir")
+                        ->leftJoin("sys_batch b", "b.id=ir.batch_id")
+                        ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id")
+                        ->leftJoin("un_enterprise e", "e.id=ir.enterprise_id")->where($where)->count();
+        $list = IntegralRecord::alias("ir")
+                ->leftJoin("sys_batch b", "b.id=ir.batch_id")
+                ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id")
+                ->leftJoin("un_enterprise e", "e.id=ir.enterprise_id")->where($where)->field("ir.*,b.batch as apply_year,tl.state,tl.new_state,if(ir.updateTime is not null,ir.updateTime,ir.createTime) as orderTime")
+                ->limit($offset, $limit)
+                ->order("orderTime " . $order)
+                ->select();
         foreach ($list as $key => $item) {
         foreach ($list as $key => $item) {
-            $list[$key]["apply_year"] = BatchApi::getOne($item["batch_id"])["batch"];
             $tmp_items = [];
             $tmp_items = [];
             foreach ($item["detail"] as $_item) {
             foreach ($item["detail"] as $_item) {
                 $integral_item_info = getCacheById("IntegralItem", $_item["item_id"]);
                 $integral_item_info = getCacheById("IntegralItem", $_item["item_id"]);
@@ -146,23 +193,33 @@ class IntegralRecordApi {
         $offset = $params["offset"] ?: 0;
         $offset = $params["offset"] ?: 0;
         $limit = $params["limit"] ?: 10;
         $limit = $params["limit"] ?: 10;
         $where[] = ["delete", "=", 0];
         $where[] = ["delete", "=", 0];
+        if ($params["apply_year"]) {
+            $where[] = ["b.batch", "like", "%{$params['apply_year']}%"];
+        }
         if ($params["name"]) {
         if ($params["name"]) {
             $where[] = ["ir.name", "like", "%{$params['name']}%"];
             $where[] = ["ir.name", "like", "%{$params['name']}%"];
         }
         }
         if ($params["card_number"]) {
         if ($params["card_number"]) {
             $where[] = ["ir.card_number", "like", "%{$params['card_number']}%"];
             $where[] = ["ir.card_number", "like", "%{$params['card_number']}%"];
         }
         }
+        if ($params["phone"]) {
+            $where[] = ["ir.phone", "like", "%{$params['phone']}%"];
+        }
+        if ($params["email"]) {
+            $where[] = ["ir.email", "like", "%{$params['email']}%"];
+        }
         if ($params["shareholder"]) {
         if ($params["shareholder"]) {
             $where[] = ["ir.shareholder", "=", $params['shareholder']];
             $where[] = ["ir.shareholder", "=", $params['shareholder']];
         }
         }
         $count = IntegralRecord::alias("ir")->where($where)
         $count = IntegralRecord::alias("ir")->where($where)
+                ->leftJoin("sys_batch b", "b.id=ir.batch_id")
                 ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id")
                 ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id")
                 ->count();
                 ->count();
         $list = IntegralRecord::alias("ir")->where($where)
         $list = IntegralRecord::alias("ir")->where($where)
+                        ->leftJoin("sys_batch b", "b.id=ir.batch_id")
                         ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id")
                         ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id")
-                        ->field("ir.*,tl.state as real_state,tl.last_state,if(ir.updateTime is not null,ir.updateTime,ir.createTime) as orderTime")->limit($offset, $limit)->order("orderTime " . $order)->select();
+                        ->field("ir.*,b.batch as apply_year,tl.state as real_state,tl.last_state,if(ir.updateTime is not null,ir.updateTime,ir.createTime) as orderTime")->limit($offset, $limit)->order("orderTime " . $order)->select();
         foreach ($list as $key => $item) {
         foreach ($list as $key => $item) {
-            $list[$key]["apply_year"] = BatchApi::getOne($item["batch_id"])["batch"];
             $tmp_items = [];
             $tmp_items = [];
             foreach ($item["detail"] as $_item) {
             foreach ($item["detail"] as $_item) {
                 $integral_item_info = getCacheById("IntegralItem", $_item["item_id"]);
                 $integral_item_info = getCacheById("IntegralItem", $_item["item_id"]);

+ 6 - 38
app/enterprise/view/integral/index.html

@@ -40,46 +40,13 @@
                                 <div class="input-group input-group-sm">
                                 <div class="input-group input-group-sm">
                                     <div class="input-group-btn">
                                     <div class="input-group-btn">
                                         <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
                                         <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
-                                            性别
+                                            是否股东
                                         </button>
                                         </button>
                                     </div>
                                     </div>
-                                    <select class="form-control" id="sex">
+                                    <select class="form-control" id="shareholder">
                                         <option value=""></option>
                                         <option value=""></option>
-                                        <option value="1">男</option>
-                                        <option value="2">女</option>
-                                    </select>
-                                </div>
-                            </div>
-                            <div class="col-sm-3">                                
-                                <div class="input-group input-group-sm">
-                                    <div class="input-group-btn">
-                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
-                                            民族
-                                        </button>
-                                    </div>
-                                    <select class="form-control" id="nation">
-                                    </select>
-                                </div>
-                            </div>
-                            <div class="col-sm-3">                         
-                                <div class="input-group input-group-sm">
-                                    <div class="input-group-btn">
-                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
-                                            国籍/地区
-                                        </button>
-                                    </div>
-                                    <select class="form-control" id="nationality">
-                                    </select>
-                                </div>
-                            </div>
-                            <div class="col-sm-3">                        
-                                <div class="input-group input-group-sm">
-                                    <div class="input-group-btn">
-                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
-                                            人才层次
-                                        </button>
-                                    </div>
-                                    <select class="form-control" id="talent_arrange">
+                                        <option value="1">是</option>
+                                        <option value="2">否</option>
                                     </select>
                                     </select>
                                 </div>
                                 </div>
                             </div>
                             </div>
@@ -96,7 +63,8 @@
                                         <option value="1">待提交</option>
                                         <option value="1">待提交</option>
                                         <option value="2">已驳回</option>
                                         <option value="2">已驳回</option>
                                         <option value="3">审核中</option>
                                         <option value="3">审核中</option>
-                                        <option value="4">认定通过</option>
+                                        <option value="4">通过复审</option>
+                                        <option value="5">认定成功</option>
                                     </select>
                                     </select>
                                 </div>
                                 </div>
                             </div>
                             </div>