request->param()); return json($result); } function selectAll() { $result = CompanyApi::getAll(); return json($result); } /** * @auth {{/company/add}} * @return type */ function add() { if ($this->request->isPost()) { CompanyApi::edit($this->request->param()); return json(["code" => 200, "msg" => "添加单位成功"]); } return view(); } /** * @auth {{/company/update}} * @return type */ function edit() { if ($this->request->isPost()) { CompanyApi::edit($this->request->param()); return json(["code" => 200, "msg" => "编辑单位成功"]); } $id = $this->request->param("id"); $info = CompanyApi::getOne($id); return view("", ["info" => $info]); } /** * @auth {{/company/delete}} * @return type */ function delete() { $id = $this->request->param("id"); CompanyApi::delete($id); return json(["code" => 200, "msg" => "删除成功"]); } /** * @auth {{/company/select}} * @return type */ function view() { $id = $this->request->param("id"); $info = CompanyApi::getOne($id); return view("", ["info" => $info]); } function detail() { $id = $this->request->param("id"); $info = CompanyApi::getOne($id); return json($info); } }