|
@@ -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]);
|