Index.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 md5(concat(createTime,mainId,`type`)) in (select md5(concat(max(createTime),mainId,`type`)) 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. ->where($where)->count();
  31. $backlog = ["title" => "【人才认定申报】待初审", "url" => "$('a.J_menuItem[href=\"/admin/talent/fst_verify\"]').click()", "count" => $count];
  32. $vars["backlog"][] = $backlog;
  33. $backLogCount += $count;
  34. }
  35. $vars["backLogCount"] = $backLogCount;
  36. return view("", $vars);
  37. }
  38. }