|
|
|
<?php
|
|
|
|
class NewSquirrelModel extends Orm_Base{
|
|
|
|
public $table = 'new_squirrel';
|
|
|
|
public $field = array(
|
|
|
|
'id' => array('type' => "int(11)",'comment' => ''),
|
|
|
|
'count' => array('type' => "varchar(45)",'comment' => '笼位编号'),
|
|
|
|
'birthday' => array('type' => "int(11)",'comment' => '小鼠生日'),
|
|
|
|
'father' => array('type' => "varchar(255)",'comment' => '小鼠父亲'),
|
|
|
|
'mother' => array('type' => "varchar(255)",'comment' => '小鼠母亲'),
|
|
|
|
'strains' => array('type' => "varchar(255)",'comment' => '小鼠品系'),
|
|
|
|
'gene' => array('type' => "varchar(255)",'comment' => '小鼠基因'),
|
|
|
|
'remark' => array('type' => "int(11)",'comment' => '备注'),
|
|
|
|
'is_fen' => array('type' => "varchar(255)",'comment' => '是否杀死'),
|
|
|
|
'fen_num' => array('type' => "varchar(255)",'comment' => '是否删除'),
|
|
|
|
'cage' => array('type' => "varchar(255)",'comment' => '笼位id'),
|
|
|
|
'created' => array('type' => "varchar(255)",'comment' => '是否为新生小鼠'),
|
|
|
|
'c_user_id' => array('type' => "varchar(255)",'comment' => '操作人信息'),
|
|
|
|
'weaning_time' => array('type' => "varchar(255)",'comment' => '断奶时间'),
|
|
|
|
'nursing_time' => array('type' => "varchar(255)",'comment' => '护理时间'),
|
|
|
|
'grow_time' => array('type' => "varchar(255)",'comment' => '成长时间'),
|
|
|
|
'infertility_time' => array('type' => "varchar(255)",'comment' => '是否为新生小鼠'),
|
|
|
|
'dose_time' => array('type' => "varchar(255)",'comment' => '是否为新生小鼠'),
|
|
|
|
|
|
|
|
);
|
|
|
|
public $pk = 'id';
|
|
|
|
public function getModelList($params){
|
|
|
|
$CageModel = new CageModel();
|
|
|
|
//获取幼崽信息
|
|
|
|
$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){
|
|
|
|
$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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|