dataLists(new OaSelfExamineLists()); } /** * @notes 添加自评记录 * @return \think\response\Json * @author likeadmin * @date 2024/06/03 15:36 */ public function add() { $params = (new OaSelfExamineValidate())->post()->goCheck('add'); $result = OaSelfExamineLogic::add($params,$this->adminId); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(OaSelfExamineLogic::getError()); } /** * @notes 编辑自评记录 * @return \think\response\Json * @author likeadmin * @date 2024/06/03 15:36 */ public function edit() { $params = (new OaSelfExamineValidate())->post()->goCheck('edit'); $result = OaSelfExamineLogic::edit($params,$this->adminId); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(OaSelfExamineLogic::getError()); } /** * @notes 删除自评记录 * @return \think\response\Json * @author likeadmin * @date 2024/06/03 15:36 */ public function delete() { $params = (new OaSelfExamineValidate())->post()->goCheck('delete'); $result = OaSelfExamineLogic::delete($params); if (true === $result) { return $this->success('删除成功', [], 1, 1); } return $this->fail(OaSelfExamineLogic::getError()); } /** * @notes 获取自评记录详情 * @return \think\response\Json * @author likeadmin * @date 2024/06/03 15:36 */ public function detail() { $params = (new OaSelfExamineValidate())->goCheck('detail'); $result = OaSelfExamineLogic::detail($params); return $this->data($result); } public function delete_detail() { $id = $this->request->post('id'); if(empty($id)){ return $this->fail('参数错误'); } $data = OaSelfExamineDetail::where('id',$id)->findOrEmpty(); if($data->isEmpty()){ return $this->fail('考核项信息不存在'); } $result = OaSelfExamineDetail::destroy($id); return $result ? $this->success('删除成功' ,[], 1, 1) : $this->fail('删除失败'); } }