|
|
|
@ -24,14 +24,21 @@ class NewSquirrelModel extends Orm_Base{ |
|
|
|
|
); |
|
|
|
|
public $pk = 'id'; |
|
|
|
|
public function getModelList($params){ |
|
|
|
|
$SquirrelModel = new SquirrelModel; |
|
|
|
|
$CageModel = new CageModel(); |
|
|
|
|
//获取幼崽信息 |
|
|
|
|
$data=$this->field('id,count,birthday,father,mother,strains,gene,remark')->where("id>0 {$params['where']}")->fList(); |
|
|
|
|
|
|
|
|
|
$data=$this->field('id,count,birthday,father,mother,strains,gene,remark,cage')->where("id>0 {$params['where']}")->fList(); |
|
|
|
|
foreach($data as $key => &$val){ |
|
|
|
|
$val['cage'] = $CageModel->field('number')->where("id={$val['cage']}")->fRow()['number']; |
|
|
|
|
$val['icon'] = "/public/icon/small.png"; |
|
|
|
|
} |
|
|
|
|
return $data; |
|
|
|
|
} |
|
|
|
|
public function getOneInfo($squirrel){ |
|
|
|
|
return $this->field('id,count,birthday,father,mother,strains,gene,remark')->where("id={$squirrel}")->fRow(); |
|
|
|
|
$CageModel = new CageModel(); |
|
|
|
|
$data = $this->field('id,count,birthday,father,mother,strains,gene,remark,cage')->where("id={$squirrel}")->fRow(); |
|
|
|
|
$data['cage'] = $CageModel->field('number')->where("id={$data['cage']}")->fRow()['number']; |
|
|
|
|
$data['icon'] = "/public/icon/small.png"; |
|
|
|
|
return $data; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|