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