Browse Source

药方录入优化

pull/1/head
pengda 9 months ago
parent
commit
fdcb9d5851
  1. 13
      control/index.php

13
control/index.php

@ -17,6 +17,7 @@ class index extends publicBase {
$this->setViewFormat('html'); $this->setViewFormat('html');
$this->setViewTpl('index/home.html'); $this->setViewTpl('index/home.html');
} }
public function ajax_save_case() { public function ajax_save_case() {
$name = $this->post('name'); $name = $this->post('name');
$source = $this->post('source'); $source = $this->post('source');
@ -25,9 +26,9 @@ class index extends publicBase {
$herbs = $this->post('herbs'); $herbs = $this->post('herbs');
//新增药方 //新增药方
$mCase = new mCase(); $m_case = new mCase();
$id = $mCase->createCase($name, $source, $original, $method, $herbs); $id = $m_case->createCase($name, $source, $original, $method, $herbs);
if (!$id) $this->ajax_json(false, $mCase->getError()); if (!$id) $this->ajax_json(false, $m_case->getError());
$this->ajax_json(true, '添加成功'); $this->ajax_json(true, '添加成功');
} }
@ -40,9 +41,9 @@ class index extends publicBase {
$method = $this->post('method'); $method = $this->post('method');
$herbs = $this->post('herbs'); $herbs = $this->post('herbs');
$mCase = new mCase(); $m_case = new mCase();
$res = $mCase->updateCase($id, $name, $source, $original, $method, $herbs); $res = $m_case->updateCase($id, $name, $source, $original, $method, $herbs);
if (!$res) $this->ajax_json(false, $mCase->getError()); if (!$res) $this->ajax_json(false, $m_case->getError());
$this->ajax_json(true, '保存成功'); $this->ajax_json(true, '保存成功');
} }

Loading…
Cancel
Save