|
|
|
@ -25,9 +25,9 @@ class CageModel extends Orm_Base{ |
|
|
|
|
$sql .=" and (number like '%{$params['keyword']}%' or strains like '%{$params['keyword']}%')"; |
|
|
|
|
} |
|
|
|
|
if(!empty($params['order'])){ |
|
|
|
|
$sql .=" order by {$params['order']} desc"; |
|
|
|
|
$sql .=" order by {$params['order']} {$params['desc']}"; |
|
|
|
|
}else{ |
|
|
|
|
$sql .=" order by id desc"; |
|
|
|
|
$sql .=" order by id {$params['desc']}"; |
|
|
|
|
} |
|
|
|
|
$data['count'] = count($this->query($sql)); |
|
|
|
|
$offset = ($params['page']-1)*$limmit; |
|
|
|
|