request->post(); $result = DietRecordLogic::add($params); if ($result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(DietRecordLogic::getError()); } public function edit() { $params = $this->request->post(); $result = DietRecordLogic::edit($params); if ($result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(DietRecordLogic::getError()); } public function delete() { $params = $this->request->post(); $result = DietRecordLogic::delete($params); if ($result) { return $this->success('删除成功', [], 1, 1); } return $this->fail(DietRecordLogic::getError()); } public function detail() { $params = $this->request->get(); $result = DietRecordLogic::detail($params); return $this->data($result); } public function getRecordsByPatient() { $params = $this->request->get(); $result = DietRecordLogic::getRecordsByPatient($params); return $this->data($result); } }