|
|
@ -130,10 +130,11 @@ class mCase extends mBase { |
|
|
|
return $this->obj->selectAll($this->case_herb_tbl, array('sql'=>'`case_id`=?','vals'=>array($case_id)), 'sort asc '); |
|
|
|
} |
|
|
|
|
|
|
|
public function getCaseByName($name,$start,$pagesize) { |
|
|
|
public function getCaseByName($name, $page_num, $page_size) { |
|
|
|
$sql = " `name` like '%{$name}%'"; |
|
|
|
|
|
|
|
$res = $this->obj->selectAll($this->tbl, array('sql'=>$sql, 'vals'=>array()), 'use_num desc,sort asc ', array($start, $pagesize)); |
|
|
|
$offset = ($page_num - 1) * $page_size; |
|
|
|
$res = $this->obj->selectAll($this->tbl, array('sql'=>$sql, 'vals'=>array()), 'use_num desc,sort asc ', array($offset, $page_size)); |
|
|
|
|
|
|
|
if(empty($res)) return array(); |
|
|
|
return $res; |
|
|
@ -143,9 +144,11 @@ class mCase extends mBase { |
|
|
|
//药方信息 |
|
|
|
$case = $this->getCaseById($id); |
|
|
|
if(empty($case)){$this->setError('查询不到此药方');return false;} |
|
|
|
|
|
|
|
//药方药材信息 |
|
|
|
$case_herb = $this->getCaseHerbByCaseId($case['id']); |
|
|
|
if(empty($case_herb)){$this->setError('药方药材查询失败');return false;} |
|
|
|
|
|
|
|
//药材名称 |
|
|
|
$herb_ids = array_column($case_herb,'herb_id'); |
|
|
|
$herb = $this->getHerbByIds($herb_ids); |
|
|
|