|
|
|
@ -26,17 +26,12 @@ class NewSquirrelModel extends Orm_Base{ |
|
|
|
|
public function getModelList($params){ |
|
|
|
|
$SquirrelModel = new SquirrelModel; |
|
|
|
|
//获取幼崽信息 |
|
|
|
|
$data=$this->field('count,birthday,father,mother,strains,gene,remark')->where("id>0 {$params['where']}")->fList(); |
|
|
|
|
foreach($data as $key => &$val){ |
|
|
|
|
$father = $SquirrelModel->getOneInfo($val['father']); |
|
|
|
|
$mother = $SquirrelModel->getOneInfo($val['mother']); |
|
|
|
|
$val['father'] = empty($father)?'无':$father['number']; |
|
|
|
|
$val['mother'] = empty($mother)?'无':$mother['number']; |
|
|
|
|
} |
|
|
|
|
$data=$this->field('id,count,birthday,father,mother,strains,gene,remark')->where("id>0 {$params['where']}")->fList(); |
|
|
|
|
|
|
|
|
|
return $data; |
|
|
|
|
} |
|
|
|
|
public function getOneInfo($squirrel){ |
|
|
|
|
return $this->field('count,birthday,father,mother,strains,gene,remark')->where("id={$squirrel}")->fRow(); |
|
|
|
|
return $this->field('id,count,birthday,father,mother,strains,gene,remark')->where("id={$squirrel}")->fRow(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|