|
|
|
@ -70,10 +70,7 @@ class Api_CageController extends Ctrl_Api{ |
|
|
|
|
$CageNum = $this->Cagemodel->field('count(*) as num')->where("c_user_id={$data['c_user_id']}")->fRow(); |
|
|
|
|
$CageNum = empty($CageNum)?1:(int) $CageNum['num']+1; |
|
|
|
|
$data['type'] = $this->POST['type']; |
|
|
|
|
$data['number'] = "NO.0000".$CageNum; |
|
|
|
|
if($CageNum>9) $data['number'] = "NO.000".$CageNum; |
|
|
|
|
if($CageNum>99) $data['number'] = "NO.00".$CageNum; |
|
|
|
|
if($CageNum>999) $data['number'] = "NO.0".$CageNum; |
|
|
|
|
$data['number'] = $CageNum; |
|
|
|
|
$data['strains'] =empty($this->POST['strains'])||!isset($this->POST['strains'])?Tool_Fnc::apiMsg('请选择笼位品系', '500'):Tool_Fnc::safe_string($this->POST['strains']); |
|
|
|
|
$data['color'] =empty($this->POST['color'])||!isset($this->POST['color'])?Tool_Fnc::apiMsg('请选择笼位颜色', '500'):Tool_Fnc::safe_string($this->POST['color']); |
|
|
|
|
$data['group'] = empty($this->POST['group'])||!isset($this->POST['group'])?Tool_Fnc::apiMsg('请选择实验室', '500'):Tool_Fnc::safe_string($this->POST['group']); |
|
|
|
@ -90,17 +87,14 @@ class Api_CageController extends Ctrl_Api{ |
|
|
|
|
$uid = empty($this->POST['uid'])?Tool_Fnc::apiMsg('请先登录', '500'):$this->POST['uid']; |
|
|
|
|
$CageNum = $this->Cagemodel->field('count(*) as num')->where("user_id={$uid}")->fRow(); |
|
|
|
|
$CageNum = empty($CageNum)?1:(int) $CageNum['num']+1; |
|
|
|
|
$data['number'] = "NO.0000".$CageNum; |
|
|
|
|
if($CageNum>9) $data['number'] = "NO.000".$CageNum; |
|
|
|
|
if($CageNum>99) $data['number'] = "NO.00".$CageNum; |
|
|
|
|
if($CageNum>999) $data['number'] = "NO.0".$CageNum; |
|
|
|
|
$data['number'] = $CageNum; |
|
|
|
|
Tool_Fnc::apiMsg('获取笼位号成功', '200',$data); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 获取笼位类型接口 |
|
|
|
|
*/ |
|
|
|
|
public function getCagetypeAction(){ |
|
|
|
|
$data = array(['id'=>1,'title'=>'库存笼'],['id'=>2,'title'=>'繁殖笼']); |
|
|
|
|
$data = array(['id'=>1,'title'=>'库存笼'],['id'=>2,'title'=>'繁殖笼'],['id'=>3,'title'=>'其他']); |
|
|
|
|
Tool_Fnc::apiMsg('获取笼位类型成功', '200',$data); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|