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