瀏覽代碼

增加合同到期待变更提醒

sandm 1 年之前
父節點
當前提交
05b302a382
共有 2 個文件被更改,包括 15 次插入30 次删除
  1. 13 2
      app/enterprise/controller/TalentBasicChange.php
  2. 2 28
      app/enterprise/view/talent_basic_change/htindex.html

+ 13 - 2
app/enterprise/controller/TalentBasicChange.php

@@ -329,17 +329,28 @@ class TalentBasicChange extends EnterpriseController {
     public function htEndList(){
         $offset = trim($this->request->param("offset")) ?: 0;
         $limit = trim($this->request->param("limit")) ?: 10;
+        $name = trim($this->request->param("name"));
+        $idCard = trim($this->request->param("card_number"));
         $where = [];
         $where[] = ["ti.delete", "=", 0];
+        $where[] = ["ti.active", "=", 1];
         $where[] = ["ti.checkState", "=", TalentState::CERTIFICATED];
         if (session("user")["usertype"] == 2) {
             $where[] = ["ti.enterprise_id", "=", session("user")["uid"]];
         }
+        if ($name) {
+            $where[] = ["name", "like", "%" . $name . "%"];
+        }
+        if ($idCard) {
+            $where[] = ["card_number", "like", "%" . $idCard . "%"];
+        }
 
         $now = date("Y-m-d",time());
+        //$where[] = ["trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3))", "<", $now];
+
 
-        $count = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is NULL and ti.delete = 0 and ti.checkState = '" .TalentState::CERTIFICATED . "' and ti.active = 1 and ti.enterprise_id = '" . session("user")["uid"] . "'")->count();
-        $list = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is NULL and ti.delete = 0 and ti.checkState = '" .TalentState::CERTIFICATED . "' and ti.active = 1 and ti.enterprise_id = '" . session("user")["uid"] . "'")->limit($offset, $limit)->select()->toArray();
+        $count = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}'")->count();
+        $list = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}'")->limit($offset, $limit)->select()->toArray();
         //echo Talent::getLastSql();die;
 
         return json(["total" => $count, "rows" => $list]);

+ 2 - 28
app/enterprise/view/talent_basic_change/htindex.html

@@ -27,40 +27,14 @@
                                 </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 id="checkState" class="form-control">
-                                        <option value="">请选择</option>
-                                        <option value="-1">待提交</option>
-                                        <option value="1">待审核</option>
-                                        <option value="9">重新提交</option>
-                                        <option value="2">已驳回</option>
-                                        <option value="3">已通过</option>
-                                    </select>
-                                </div>
-                            </div>
-                            <div class="col-sm-3">
-                                <button type="button" class="btn btn-sm btn-primary" onclick="TalentBasicChange.search()">
+                                <button type="button" class="btn btn-sm btn-primary" onclick="TalentHetongChange.search()">
                                     <i class="fa fa-search"></i>&nbsp;搜索
                                 </button>
-                                <button type="button" class="btn btn-sm btn-primary" onclick="TalentBasicChange.reset()">
+                                <button type="button" class="btn btn-sm btn-primary" onclick="TalentHetongChange.reset()">
                                     <i class="fa fa-trash"></i>&nbsp;重置
                                 </button>
                             </div>
                         </div>
-                        <div class="hidden-xs" id="TalentBasicChangeTableToolbar" role="group">
-                            <button type="button" class="btn btn-sm btn-primary" onclick="TalentBasicChange.openAddTalentBasicChange()">
-                                <i class="fa fa-plus"></i>&nbsp;添加
-                            </button>
-                            <button type="button" class="btn btn-sm btn-primary" onclick="TalentBasicChange.openTalentBasicChangeDetail()">
-                                <i class="fa fa-edit"></i>&nbsp;修改
-                            </button>
-                            <button type="button" class="btn btn-sm btn-primary" onclick="TalentBasicChange.openTalentBasicChangeSelect()">
-                                <i class="fa fa-eye"></i>&nbsp;查看
-                            </button>
-                        </div>
                         <table id="TalentHetongChangeTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
                             <thead>
                             <tr>