parent
9b37879070
commit
ec5c1db884
@ -0,0 +1,32 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* 获取设置接口 |
||||
* @author YS |
||||
* @version 1.0 |
||||
*/ |
||||
class Api_SyssetController extends Ctrl_Api{ |
||||
public $CageSetModel; |
||||
public $SquirrelSetModel; |
||||
public $ExcelSetModel; |
||||
public function init(){ |
||||
if(empty($_SESSION['uid'])) {Tool_Fnc::apiMsg('非法调用', '500');} |
||||
$this->CageSetModel=new CageSetModel(); |
||||
$this->SquirrelSetModel=new SquirrelSetModel(); |
||||
$this->ExcelSetModel=new ExcelSetModel(); |
||||
} |
||||
/** |
||||
* 获取设置接口 |
||||
*/ |
||||
public function getSetInfoAction(){ |
||||
$params['user_id'] = $_SESSION['uid']; |
||||
//笼位设置 |
||||
$data['cageSet'] = $this->CageSetModel->getsetinfo($params); |
||||
//鼠设置 |
||||
$data['squirrelSet'] = $this->SquirrelSetModel->getsetinfo($params); |
||||
//excel导出设置 |
||||
$data['excelSet'] = $this->ExcelSetModel->getsetinfo($params); |
||||
Tool_Fnc::apiMsg('获取成功', '200',$data); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,15 @@ |
||||
<?php |
||||
class CagecolorModel extends Orm_Base{ |
||||
public $table = 'cage_color'; |
||||
public $field = array( |
||||
'id' => array('type' => "int(11)",'comment' => ''), |
||||
'color' => array('type' => "varchar(45)",'comment' => '颜色编码'), |
||||
'is_delete' => array('type' => "varchar(45)",'comment' => '是否删除'), |
||||
'created' => array('type' => "int(11)",'comment' => '添加时间'), |
||||
); |
||||
public $pk = 'id'; |
||||
public function getModelList($params){ |
||||
return $this->field("{$params['field']}")->where('is_delete=0')->fList(); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,52 @@ |
||||
<?php |
||||
class ExcelSetModel extends Orm_Base{ |
||||
public $table = 'excel_set'; |
||||
public $field = array( |
||||
'id' => array('type' => "int(11)",'comment' => 'excel设置id'), |
||||
'now_squirrel' => array('type' => "varchar(45)",'comment' => '现存鼠导出设置'), |
||||
'handle_squirrel' => array('type' => "varchar(45)",'comment' => '处理鼠导出设置'), |
||||
'user_id' => array('type' => "int(11)",'comment' => '是否删除'), |
||||
); |
||||
public $pk = 'id'; |
||||
public function getsetinfo($params){ |
||||
$data = $this->field('*')->where('='.$params['user_id'])->fRow(); |
||||
if(empty($data)){ |
||||
//现存鼠 |
||||
$data['now_squirrel']['number'] = true; |
||||
$data['now_squirrel']['sex'] = true; |
||||
$data['now_squirrel']['birthday'] = true; |
||||
$data['now_squirrel']['strains_id'] = true; |
||||
$data['now_squirrel']['gene'] = true; |
||||
$data['now_squirrel']['cage_num'] = true; |
||||
$data['now_squirrel']['content'] = true; |
||||
$data['now_squirrel']['hair_color'] = true; |
||||
$data['now_squirrel']['fenlong'] = true; |
||||
$data['now_squirrel']['fanzhi'] = true; |
||||
$data['now_squirrel']['breeding_tag'] = true; |
||||
$data['now_squirrel']['see_bole_tag'] = true; |
||||
$data['now_squirrel']['give_medicine'] = true; |
||||
$data['now_squirrel']['father'] = true; |
||||
$data['now_squirrel']['mother'] = true; |
||||
$data['now_squirrel']['remark'] = true; |
||||
//处理鼠 |
||||
$data['handle_squirrel']['number'] = true; |
||||
$data['handle_squirrel']['sex'] = true; |
||||
$data['handle_squirrel']['birthday'] = true; |
||||
$data['handle_squirrel']['strains_id'] = true; |
||||
$data['handle_squirrel']['gene'] = true; |
||||
$data['handle_squirrel']['cage_num'] = true; |
||||
$data['handle_squirrel']['content'] = true; |
||||
$data['handle_squirrel']['hair_color'] = true; |
||||
$data['handle_squirrel']['fenlong'] = true; |
||||
$data['handle_squirrel']['fanzhi'] = true; |
||||
$data['handle_squirrel']['breeding_tag'] = true; |
||||
$data['handle_squirrel']['see_bole_tag'] = true; |
||||
$data['handle_squirrel']['give_medicine'] = true; |
||||
$data['handle_squirrel']['father'] = true; |
||||
$data['handle_squirrel']['mother'] = true; |
||||
$data['handle_squirrel']['remark'] = true; |
||||
} |
||||
return $data; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,24 @@ |
||||
<?php |
||||
class SquirrelSetModel extends Orm_Base{ |
||||
public $table = 'squirrel_set'; |
||||
public $field = array( |
||||
'id' => array('type' => "int(11)",'comment' => ''), |
||||
'weaning_time' => array('type' => "varchar(45)",'comment' => '笼位编号'), |
||||
'nursing_time' => array('type' => "varchar(45)",'comment' => '断奶时间'), |
||||
'male_grow_time' => array('type' => "int(11)",'comment' => '雄性鼠成长时间'), |
||||
'female_grow_time' => array('type' => "varchar(255)",'comment' => '雌性鼠成长时间'), |
||||
'infertility_time' => array('type' => "varchar(255)",'comment' => '不育鼠时间'), |
||||
'dose_time' => array('type' => "varchar(255)",'comment' => '给药后持续几天显示给药标识'), |
||||
'color_time' => array('type' => "varchar(255)",'comment' => '记住几个近期给药的颜色'), |
||||
'breeding_tag' => array('type' => "varchar(255)",'comment' => '配繁标识'), |
||||
'see_bole_tag' => array('type' => "varchar(255)",'comment' => '见栓标识'), |
||||
'user_id' => array('type' => "int(11)",'comment' => '添加用户id'), |
||||
'created' => array('type' => "int(11)",'comment' => '添加时间'), |
||||
); |
||||
public $pk = 'id'; |
||||
public function getsetinfo($params){ |
||||
$data = $this->field('*')->where('user_id='.$params['user_id'])->fRow(); |
||||
return $data; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue