From 8f14b881d75900cdad26c456cd9469a195b499a9 Mon Sep 17 00:00:00 2001 From: "yangsai@163.com" <2624183217@qq.com> Date: Tue, 28 May 2024 11:40:42 +0800 Subject: [PATCH] YS --- application/controllers/Api/Squirrel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/controllers/Api/Squirrel.php b/application/controllers/Api/Squirrel.php index d4f56b0..4bb4187 100644 --- a/application/controllers/Api/Squirrel.php +++ b/application/controllers/Api/Squirrel.php @@ -120,14 +120,14 @@ class Api_SquirrelController extends Ctrl_Api{ if($cageinfo==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']==1){ + }if($data['sex']==2){ if((int)$this->Squirrelmodel->field("count(*) num")->where("sex=2 and cage={$data['cage']}")->fList()['num']==2) Tool_Fnc::apiMsg('该笼母鼠已上限', '500'); } }else{ //查询笼位是否有不同性别鼠 if($data['sex']==1){ if(!empty($this->Squirrelmodel->field("*")->where("sex=2 and cage={$data['cage']}")->fRow())) Tool_Fnc::apiMsg('该笼只能添加母鼠', '500'); - }if($data['sex']==1){ + }if($data['sex']==2){ if(!empty($this->Squirrelmodel->field("*")->where("sex=1 and cage={$data['cage']}")->fRow())) Tool_Fnc::apiMsg('该笼只能添加公鼠', '500'); } } @@ -186,14 +186,14 @@ class Api_SquirrelController extends Ctrl_Api{ if($cageinfo==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']==1){ + }if($data['sex']==2){ if((int)$this->Squirrelmodel->field("count(*) num")->where("sex=2 and cage={$data['cage']}")->fList()['num']==2) Tool_Fnc::apiMsg('该笼母鼠已上限', '500'); } }else{ //查询笼位是否有不同性别鼠 if($data['sex']==1){ if(!empty($this->Squirrelmodel->field("*")->where("sex=2 and cage={$data['cage']}")->fRow())) Tool_Fnc::apiMsg('该笼只能添加母鼠', '500'); - }if($data['sex']==1){ + }if($data['sex']==2){ if(!empty($this->Squirrelmodel->field("*")->where("sex=1 and cage={$data['cage']}")->fRow())) Tool_Fnc::apiMsg('该笼只能添加公鼠', '500'); } }