diff --git a/application/models/Squirrel.php b/application/models/Squirrel.php index ab1941a..384b90b 100644 --- a/application/models/Squirrel.php +++ b/application/models/Squirrel.php @@ -34,12 +34,13 @@ class SquirrelModel extends Orm_Base{ ); public $pk = 'id'; public function getModelList($params){ + $sex = array("1"=>"雄","2"=>"雌","0"=>"其他"); $cageModel = new CageModel(); $NewSquirrel = new NewSquirrelModel(); //获取仓鼠信息 $data['slist']=$this->field('id,number,sex,birthday,father,mother,strains_id as strains,gene,hair_color,cage,remark')->where("is_delete=0 and type=1 and is_kill=0 {$params['where']}")->fList(); foreach($data['slist'] as $key => &$val){ - $val['sex'] = $val['sex']==1?'雄':'雌'; + $val['sex'] = $sex[$val['sex']]; //获取笼位号 $val['cage'] =$cageModel->getOneInfo($val['cage'])['number']; $val['icon'] = $this->getIcon($val['id'])['icon'];