From d1769916c33f183f645aaec2cb3c53d291f1994f Mon Sep 17 00:00:00 2001 From: pengda <10266652509@qq.com> Date: Sat, 14 Sep 2024 16:08:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=8B=9F=E8=8D=AF=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/index.php | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/control/index.php b/control/index.php index 13b4376..51eed10 100644 --- a/control/index.php +++ b/control/index.php @@ -62,6 +62,41 @@ class index extends publicBase { $this->ajax_json(true, '保存成功'); } + public function ajax_user_formula() { + $uinfo = $this->_check_login(); + + $page_num = $this->post('page_num') ? $this->post('page_num') : 1; + $page_size = $this->post('page_size') ? $this->post('page_size') : 20; + + //新增药方 + $mformula = new mFormula(); + $list = $mformula->getUserFormulaList($uinfo['uid'], $page_num, $page_size); + $total = $mformula->getUserFormulaTotal($uinfo['uid']); + + $rdata = array( + 'total' => $total, + 'per_page' => $page_size, + 'last_page' => ceil($total / $page_size), + 'current_page' => $page_num, + 'list' => $list, + ); + + $this->ajax_json(true, '获取成功', $rdata); + } + + public function ajax_user_formula_detail() { + $uinfo = $this->_check_login(); + + $id = $this->post('id') + 0; + if (!$id) $this->ajax_json(false, '参数错误'); + + $mformula = new mFormula(); + $data = $mformula->getUserFormulaInfo($id, $uinfo['uid']); + if (!$data) $this->ajax_json(false, $mformula->getError()); + + $this->ajax_json(true, '获取成功', $data); + } + public function ajax_search() { $uinfo = $this->_check_login(); @@ -93,7 +128,7 @@ class index extends publicBase { if (!$id) $this->ajax_json(false, '参数错误'); $mformula = new mFormula(); - $data = $mformula->getFormulaInfo($id); + $data = $mformula->getFormulaInfo($id, $uinfo['uid']); if (!$data) $this->ajax_json(false, $mformula->getError()); $this->ajax_json(true, '获取成功', $data);