diff --git a/application/models/NewSquirrel.php b/application/models/NewSquirrel.php index 5efeedb..fea5bc7 100644 --- a/application/models/NewSquirrel.php +++ b/application/models/NewSquirrel.php @@ -32,6 +32,7 @@ class NewSquirrelModel extends Orm_Base{ ); public $pk = 'id'; public function getModelList($params){ + $sex = array("1"=>"雄","2"=>"雌","0"=>"其他"); $CageModel = new CageModel(); $SquirrelModel = new SquirrelModel(); //获取幼崽信息 @@ -42,6 +43,7 @@ class NewSquirrelModel extends Orm_Base{ } $data['j'] = $SquirrelModel->field('id,number,birthday,father,mother,strains_id as strains,gene,remark,cage')->where("type=2 {$params['where']}")->fList(); foreach($data['j'] as $key => &$va){ + $va['sex'] = $sex[$va['sex']]; $va['cage'] = $CageModel->field('number')->where("id={$va['cage']}")->fRow()['number']; $va['icon'] = Yaf_Registry::get("config")->web->url->img."/public/icon/small.png"; }