yangsai@163.com 6 months ago
parent 2e970fb5a0
commit ff2daca151
  1. 3
      application/controllers/Api/Squirrel.php

@ -182,8 +182,7 @@ class Api_SquirrelController extends Ctrl_Api{
$data['remark'] = empty($this->POST['remark'])||!isset($this->POST['remark'])?'':Tool_Fnc::safe_string($this->POST['remark']); $data['remark'] = empty($this->POST['remark'])||!isset($this->POST['remark'])?'':Tool_Fnc::safe_string($this->POST['remark']);
$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("id,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');

Loading…
Cancel
Save