|
|
|
@ -117,7 +117,7 @@ class Api_SquirrelController extends Ctrl_Api{ |
|
|
|
|
$data['dose_time'] = date("Y-m-d",strtotime("+{$squirrelSet['dose_time']} day",strtotime($data['birthday']))); |
|
|
|
|
//查询笼位类型 |
|
|
|
|
$cageinfo = $this->CageModel->field("type")->where("id={$data['cage']}")->fRow(); |
|
|
|
|
if($cageinfo==2){ |
|
|
|
|
if($cageinfo['type']==2){ |
|
|
|
|
if($data['sex']==1){ |
|
|
|
|
if((int)$this->Squirrelmodel->field("count(*) num")->where("sex=1 and cage={$data['cage']}")->fList()['num']==1) Tool_Fnc::apiMsg('该笼公鼠已上限', '500'); |
|
|
|
|
}if($data['sex']==2){ |
|
|
|
@ -183,7 +183,7 @@ class Api_SquirrelController extends Ctrl_Api{ |
|
|
|
|
$data['created'] = date('Y-m-d H:i:s',time()); |
|
|
|
|
$squirrelinfo = $this->Squirrelmodel->field("*")->where("id={$data['id']}")->fRow(); |
|
|
|
|
$cageinfo = $this->CageModel->field("type")->where("id={$squirrelinfo['cage']}")->fRow(); |
|
|
|
|
if($cageinfo==2){ |
|
|
|
|
if($cageinfo['type']==2){ |
|
|
|
|
if($data['sex']==1){ |
|
|
|
|
if((int)$this->Squirrelmodel->field("count(*) num")->where("sex=1 and cage={$data['cage']}")->fList()['num']==1) Tool_Fnc::apiMsg('该笼公鼠已上限', '500'); |
|
|
|
|
}if($data['sex']==2){ |
|
|
|
|