diff --git a/application/controllers/Api/Cage.php b/application/controllers/Api/Cage.php index 39dd637..9b0cb13 100644 --- a/application/controllers/Api/Cage.php +++ b/application/controllers/Api/Cage.php @@ -101,7 +101,7 @@ class Api_CageController extends Ctrl_Api{ * 获取笼位类型接口 */ public function getCagetypeAction(){ - $data = [1=>'库存笼',2=>'繁殖笼']; + $data = array(['id'=>1,'title'=>'库存笼'],['id'=>2,'title'=>'繁殖笼']); Tool_Fnc::apiMsg('获取笼位类型成功', '200',$data); } /** diff --git a/application/models/Cage.php b/application/models/Cage.php index 6ebff3b..0d45a16 100644 --- a/application/models/Cage.php +++ b/application/models/Cage.php @@ -21,8 +21,8 @@ class CageModel extends Orm_Base{ $shownum = $cagemodel->field('line_num')->where("c_user_id='{$params['uid']}'")->fRow(); $limmit = empty($shownum['line_num'])?20:$shownum['line_num']*5; $sql = "select cage.id,cage.number,cage.color,strains.title strains,cage.type from cage left join strains on cage.strains=strains.id"; - if(!empty($params['keywords'])){ - $sql .=" where cage.number like '%{$params['keywords']}%'"; + if(!empty($params['keyword'])){ + $sql .=" where cage.number like '%{$params['keyword']}%'"; } if(!empty($params['order'])){ $sql .=" order by cage.{$params['order']} desc";