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

@ -35,15 +35,11 @@ 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){
unset($data[$key]);
}else{
$val['cage'] = $CageModel->field('number')->where("id={$val['cage']}")->fRow()['number']; $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['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){
$va['cage'] = $CageModel->field('number')->where("id={$va['cage']}")->fRow()['number']; $va['cage'] = $CageModel->field('number')->where("id={$va['cage']}")->fRow()['number'];

Loading…
Cancel
Save