Index.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\common\AdminController;
  4. use app\common\api\TalentState;
  5. use app\enterprise\model\Talent;
  6. /**
  7. * Description of Login
  8. *
  9. * @author sgq
  10. */
  11. class Index extends AdminController {
  12. public function index() {
  13. $vars["user"] = [
  14. "name" => $this->user["name"],
  15. "rolename" => $this->user["rolename"],
  16. "avatar" => $this->user["avatar"],
  17. "sex" => $this->user["sex"]
  18. ];
  19. $menus = \app\common\api\MenuApi::getMenuListByRoleid($this->user["roleid"]);
  20. $vars["menus"] = $menus;
  21. $codes = \app\common\api\MenuApi::getCodesByRoleId($this->user["roleid"]);
  22. $backLogCount = 0;
  23. if (in_array("talentInfo_first", $codes)) {
  24. $where[] = ["e.type", "=", session("user")["type"]];
  25. $where[] = ["ti.checkState", "=", TalentState::SCND_SUBMIT];
  26. $where[] = ["tl.state", "in", [TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT]];
  27. $count = Talent::alias("ti")
  28. ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
  29. ->leftJoin("(select mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=1 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.id")
  30. //->leftJoin("(select mainId,last_state,new_state,state,createTime,row_number() over (partition by mainId order by createTime desc) as rowIndex from `new_talent_checklog` where `type`=1 and `step` is null and active=1 and typeFileId is null) tl", "tl.mainId=ti.id and tl.rowIndex=1")
  31. ->where($where)->count();
  32. $backlog = ["title" => "【人才认定申报】待初审", "url" => "$('a.J_menuItem[href=\"/admin/talent/fst_verify\"]').click()", "count" => $count];
  33. $vars["backlog"][] = $backlog;
  34. $backLogCount += $count;
  35. }
  36. $vars["backLogCount"] = $backLogCount;
  37. return view("", $vars);
  38. }
  39. }