parent
d9e452bb40
commit
9b37879070
@ -0,0 +1,33 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* 基础信息接口 |
||||
* @author YS |
||||
* @version 1.0 |
||||
*/ |
||||
class Api_BasicinfoController extends Ctrl_Api{ |
||||
public $StrainsModel; |
||||
public $GeneModel; |
||||
public $GroupModel; |
||||
public function init(){ |
||||
$this->StrainsModel=new StrainsModel(); |
||||
$this->GeneModel=new GeneModel(); |
||||
$this->GroupModel=new GroupModel(); |
||||
} |
||||
//获取品系列表接口 |
||||
public function strainsAction(){ |
||||
$data = $this->StrainsModel->getModelList(); |
||||
Tool_Fnc::apiMsg('获取成功', '200',$data); |
||||
} |
||||
//获取基因列表接口 |
||||
public function geneAction(){ |
||||
$data = $this->GeneModel->getModelList(); |
||||
Tool_Fnc::apiMsg('获取成功', '200',$data); |
||||
} |
||||
//获取基因列表接口 |
||||
public function groupAction(){ |
||||
$data = $this->GroupModel->getModelList(); |
||||
Tool_Fnc::apiMsg('获取成功', '200',$data); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,15 @@ |
||||
<?php |
||||
class GeneModel extends Orm_Base{ |
||||
public $table = 'Gene'; |
||||
public $field = array( |
||||
'id' => array('type' => "int(11)",'comment' => ''), |
||||
'title' => array('type' => "varchar(45)",'comment' => '基因名称'), |
||||
'is_delete' => array('type' => "varchar(45)",'comment' => '是否删除'), |
||||
'created' => array('type' => "int(11)",'comment' => '添加时间'), |
||||
); |
||||
public $pk = 'id'; |
||||
public function getModelList(){ |
||||
return $this->field('id,title')->where('is_delete=0')->fList(); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,15 @@ |
||||
<?php |
||||
class GroupModel extends Orm_Base{ |
||||
public $table = 'groups'; |
||||
public $field = array( |
||||
'id' => array('type' => "int(11)",'comment' => ''), |
||||
'title' => array('type' => "varchar(45)",'comment' => '实验室名称'), |
||||
'is_delete' => array('type' => "varchar(45)",'comment' => '是否删除'), |
||||
'created' => array('type' => "int(11)",'comment' => '添加时间'), |
||||
); |
||||
public $pk = 'id'; |
||||
public function getModelList(){ |
||||
return $this->field('id,title')->where('is_delete=0')->fList(); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,15 @@ |
||||
<?php |
||||
class StrainsModel extends Orm_Base{ |
||||
public $table = 'strains'; |
||||
public $field = array( |
||||
'id' => array('type' => "int(11)",'comment' => ''), |
||||
'title' => array('type' => "varchar(45)",'comment' => '品系名称'), |
||||
'is_delete' => array('type' => "varchar(45)",'comment' => '是否删除'), |
||||
'created' => array('type' => "int(11)",'comment' => '添加时间'), |
||||
); |
||||
public $pk = 'id'; |
||||
public function getModelList(){ |
||||
return $this->field('id,title')->where('is_delete=0')->fList(); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue