|
|
@ -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); |
|
|
|