yangsai@163.com 6 months ago
parent 0ba62e380b
commit 62a0794271
  1. 10
      application/models/NewSquirrel.php

@ -35,14 +35,10 @@ class NewSquirrelModel extends Orm_Base{
$CageModel = new CageModel(); $CageModel = new CageModel();
$SquirrelModel = new SquirrelModel(); $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){ foreach($data['wj'] as $key => &$val){
if($val['is_fen']==1){ $val['cage'] = $CageModel->field('number')->where("id={$val['cage']}")->fRow()['number'];
unset($data[$key]); $val['icon'] = Yaf_Registry::get("config")->web->url->img."/public/icon/small.png";
}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";
}
} }
$data['j'] = $SquirrelModel->field('id,number,birthday,father,mother,strains_id as strains,gene,remark,cage')->where("type=2 {$params['where']}")->fList(); $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){ foreach($data['j'] as $key => &$va){

Loading…
Cancel
Save