You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
40 lines
1.2 KiB
<?php
|
|
|
|
/**
|
|
* 基础信息接口
|
|
* @author YS
|
|
* @version 1.0
|
|
*/
|
|
class Api_BasicinfoController extends Ctrl_Api{
|
|
public $StrainsModel;
|
|
public $GeneModel;
|
|
public $POST;
|
|
public $GroupModel;
|
|
public function init(){
|
|
$this->StrainsModel=new StrainsModel();
|
|
$this->GeneModel=new GeneModel();
|
|
$this->POST =json_decode(file_get_contents('php://input'),true);
|
|
$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(){
|
|
$uid = empty($this->POST['uid'])?Tool_Fnc::apiMsg('用户信息获取失败', '500'):$this->POST['uid'];
|
|
$usermodel = new UserModel();
|
|
$user = $usermodel->field('*')->where("id={$uid}")->fRow();
|
|
$da['id'] = $user['id'];
|
|
$da['title'] = $user['group'];
|
|
$data[] = $da;
|
|
Tool_Fnc::apiMsg('获取成功', '200',$data);
|
|
}
|
|
|
|
} |