TalentQuit.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\enterprise\controller;
  3. use app\enterprise\common\EnterpriseController;
  4. use app\common\model\TalentQuit as TqModel;
  5. /**
  6. * Description of TalentQuit
  7. *
  8. * @author sgq
  9. */
  10. class TalentQuit extends EnterpriseController {
  11. public function index() {
  12. return view("", ["type" => $this->user["type"]]);
  13. }
  14. public function list() {
  15. $type = $this->user["type"];
  16. $params = \StrUtil::batchGetRequestDecodeParam($this->request);
  17. $order = $params["order"] ?: "desc";
  18. $offset = $params["offset"] ?: 0;
  19. $limit = $params["limit"] ?: 10;
  20. $where = [];
  21. $where[] = ["enterpriseId", "=", $this->user["uid"]];
  22. if ($params["talentName"]) {
  23. $where[] = ["talentName", "like", "%" . $params["talentName"] . "%"];
  24. }
  25. if ($params["idCard"]) {
  26. $where[] = ["idCard", "like", "%" . $params["idCard"] . "%"];
  27. }
  28. if ($params["enterpriseName"]) {
  29. $where[] = ["enterpriseName", "like", "%" . $params["enterpriseName"] . "%"];
  30. }
  31. if ($params["talentArrange"]) {
  32. $where[] = ["talentArrange", "=", $params["talentArrange"]];
  33. }
  34. $count = TqModel::where($where)->count();
  35. $list = TqModel::where($where)->limit($offset, $limit)->order("createTime " . $order)->select()->toArray();
  36. $talentArrangeMap = \app\common\api\DictApi::selectByParentCode("talent_arrange");
  37. foreach ($list as &$item) {
  38. $item["talentArrangeName"] = $talentArrangeMap[$item["talentArrange"]];
  39. }unset($item);
  40. return json(["total" => $count, "rows" => $list]);
  41. }
  42. public function apply() {
  43. return view();
  44. }
  45. public function view() {
  46. return view();
  47. }
  48. }