diff --git a/application/models/NewSquirrel.php b/application/models/NewSquirrel.php index 510df68..5efeedb 100644 --- a/application/models/NewSquirrel.php +++ b/application/models/NewSquirrel.php @@ -35,14 +35,10 @@ class NewSquirrelModel extends Orm_Base{ $CageModel = new CageModel(); $SquirrelModel = new SquirrelModel(); //获取幼崽信息 - $data['wj']=$this->field('id,count,birthday,father,mother,strains,gene,remark,cage,is_fen')->where("id>0 {$params['where']}")->fList(); + $data['wj']=$this->field('id,count,birthday,father,mother,strains,gene,remark,cage,is_fen')->where("id>0 {$params['where']} and is_fen=0")->fList(); foreach($data['wj'] as $key => &$val){ - if($val['is_fen']==1){ - unset($data[$key]); - }else{ - $val['cage'] = $CageModel->field('number')->where("id={$val['cage']}")->fRow()['number']; - $val['icon'] = Yaf_Registry::get("config")->web->url->img."/public/icon/small.png"; - } + $val['cage'] = $CageModel->field('number')->where("id={$val['cage']}")->fRow()['number']; + $val['icon'] = Yaf_Registry::get("config")->web->url->img."/public/icon/small.png"; } $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){