From fdcb9d585139b84f6e142b785ffa865e23dbe615 Mon Sep 17 00:00:00 2001 From: pengda <10266652509@qq.com> Date: Mon, 2 Sep 2024 10:40:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=AF=E6=96=B9=E5=BD=95=E5=85=A5=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/index.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/control/index.php b/control/index.php index 248ddf8..d32905c 100644 --- a/control/index.php +++ b/control/index.php @@ -17,6 +17,7 @@ class index extends publicBase { $this->setViewFormat('html'); $this->setViewTpl('index/home.html'); } + public function ajax_save_case() { $name = $this->post('name'); $source = $this->post('source'); @@ -25,9 +26,9 @@ class index extends publicBase { $herbs = $this->post('herbs'); //新增药方 - $mCase = new mCase(); - $id = $mCase->createCase($name, $source, $original, $method, $herbs); - if (!$id) $this->ajax_json(false, $mCase->getError()); + $m_case = new mCase(); + $id = $m_case->createCase($name, $source, $original, $method, $herbs); + if (!$id) $this->ajax_json(false, $m_case->getError()); $this->ajax_json(true, '添加成功'); } @@ -40,9 +41,9 @@ class index extends publicBase { $method = $this->post('method'); $herbs = $this->post('herbs'); - $mCase = new mCase(); - $res = $mCase->updateCase($id, $name, $source, $original, $method, $herbs); - if (!$res) $this->ajax_json(false, $mCase->getError()); + $m_case = new mCase(); + $res = $m_case->updateCase($id, $name, $source, $original, $method, $herbs); + if (!$res) $this->ajax_json(false, $m_case->getError()); $this->ajax_json(true, '保存成功'); }