|
|
@ -10,9 +10,6 @@ include_once(SERVER_ROOT . "/model/mPage.php"); |
|
|
|
class index extends publicBase { |
|
|
|
|
|
|
|
private function _check_login() { |
|
|
|
if ($this->post('uid') == 'admin') { |
|
|
|
return array('uid' => 0); |
|
|
|
} |
|
|
|
$uid = $this->post('uid'); |
|
|
|
$token = $this->post('token'); |
|
|
|
if ($uid < 0 || !$token) $this->ajax_json(false, '参数错误', array('code' => CODE_LOGIN_EXIPRE)); |
|
|
@ -64,7 +61,7 @@ class index extends publicBase { |
|
|
|
if ($name) $condition['name'] = $name; |
|
|
|
if (!$is_all) $condition['uid'] = 0; |
|
|
|
|
|
|
|
$total = $mformula->getAllFormulaTotal($condition); |
|
|
|
$total = $mformula->getFormulaTotal($condition); |
|
|
|
|
|
|
|
// 分页 |
|
|
|
$page = new Page(); |
|
|
@ -80,7 +77,7 @@ class index extends publicBase { |
|
|
|
if ($curpage < $page->totalpage) $this->view['post_page'] = $page->url . ($curpage + 1); //下一页连接 |
|
|
|
|
|
|
|
//只取出当前页显示 |
|
|
|
$list = $mformula->getAllFormulaList($condition, $curpage, $page->pagesize); |
|
|
|
$list = $mformula->getFormulaList($condition, $curpage, $page->pagesize); |
|
|
|
|
|
|
|
$this->view['list'] = $list; |
|
|
|
} |
|
|
@ -151,14 +148,13 @@ class index extends publicBase { |
|
|
|
$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(); |
|
|
|
|
|
|
|
$condition = array(); |
|
|
|
$condition['uid'] = $uinfo['uid']; |
|
|
|
if ($content) $condition['name'] = $content; |
|
|
|
|
|
|
|
$list = $mformula->getAllFormulaList($condition, $page_num, $page_size); |
|
|
|
$total = $mformula->getAllFormulaTotal($condition); |
|
|
|
$mformula = new mFormula(); |
|
|
|
$list = $mformula->getFormulaList($condition, $page_num, $page_size); |
|
|
|
$total = $mformula->getFormulaTotal($condition); |
|
|
|
|
|
|
|
$rdata = array( |
|
|
|
'total' => $total, |
|
|
@ -178,7 +174,7 @@ class index extends publicBase { |
|
|
|
if (!$id) $this->ajax_json(false, '参数错误'); |
|
|
|
|
|
|
|
$mformula = new mFormula(); |
|
|
|
$data = $mformula->getUserFormulaInfo($id, $uinfo['uid']); |
|
|
|
$data = $mformula->getFormulaInfo($id, $uinfo['uid']); |
|
|
|
if (!$data) $this->ajax_json(false, $mformula->getError()); |
|
|
|
|
|
|
|
$this->ajax_json(true, '获取成功', $data); |
|
|
@ -193,9 +189,14 @@ class index extends publicBase { |
|
|
|
$page_num = $this->post('page_num') ? $this->post('page_num') : 1; |
|
|
|
$page_size = $this->post('page_size') ? $this->post('page_size') : 20; |
|
|
|
|
|
|
|
|
|
|
|
$condition = array(); |
|
|
|
$condition['uid'] = array(0,$uinfo['uid']); |
|
|
|
if ($content) $condition['name'] = $content; |
|
|
|
|
|
|
|
$mformula = new mFormula(); |
|
|
|
$list = $mformula->getSearchFormulaList($uinfo['uid'], $page_num, $page_size, $content); |
|
|
|
$total = $mformula->getSearchFormulaTotal($uinfo['uid'], $content); |
|
|
|
$list = $mformula->getFormulaList($condition, $page_num, $page_size); |
|
|
|
$total = $mformula->getFormulaTotal($condition); |
|
|
|
|
|
|
|
$rdata = array( |
|
|
|
'total' => $total, |
|
|
|