123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace app\enterprise\controller;
- use app\enterprise\common\EnterpriseController;
- use app\common\model\TalentQuit as TqModel;
- /**
- * Description of TalentQuit
- *
- * @author sgq
- */
- class TalentQuit extends EnterpriseController {
- public function index() {
- return view("", ["type" => $this->user["type"]]);
- }
- public function list() {
- $type = $this->user["type"];
- $params = \StrUtil::batchGetRequestDecodeParam($this->request);
- $order = $params["order"] ?: "desc";
- $offset = $params["offset"] ?: 0;
- $limit = $params["limit"] ?: 10;
- $where = [];
- $where[] = ["enterpriseId", "=", $this->user["uid"]];
- if ($params["talentName"]) {
- $where[] = ["talentName", "like", "%" . $params["talentName"] . "%"];
- }
- if ($params["idCard"]) {
- $where[] = ["idCard", "like", "%" . $params["idCard"] . "%"];
- }
- if ($params["enterpriseName"]) {
- $where[] = ["enterpriseName", "like", "%" . $params["enterpriseName"] . "%"];
- }
- if ($params["talentArrange"]) {
- $where[] = ["talentArrange", "=", $params["talentArrange"]];
- }
- $count = TqModel::where($where)->count();
- $list = TqModel::where($where)->limit($offset, $limit)->order("createTime " . $order)->select()->toArray();
- $talentArrangeMap = \app\common\api\DictApi::selectByParentCode("talent_arrange");
- foreach ($list as &$item) {
- $item["talentArrangeName"] = $talentArrangeMap[$item["talentArrange"]];
- }unset($item);
- return json(["total" => $count, "rows" => $list]);
- }
- public function apply() {
- return view();
- }
- public function view() {
- return view();
- }
- }
|