diff --git a/application/controllers/Api/Squirrel.php b/application/controllers/Api/Squirrel.php index ed439d5..fedfe42 100644 --- a/application/controllers/Api/Squirrel.php +++ b/application/controllers/Api/Squirrel.php @@ -91,7 +91,7 @@ class Api_SquirrelController extends Ctrl_Api{ $data['number'] =empty($this->POST['number'])||!isset($this->POST['number'])?Tool_Fnc::apiMsg('请输入编号', '500'):Tool_Fnc::safe_string($this->POST['number']); $number = $this->Squirrelmodel->field("type")->where("number='{$data['number']}'")->fRow(); if(!empty($number)) Tool_Fnc::apiMsg('该编号已存在', '500'); - $data['sex'] =empty($this->POST['sex'])||!isset($this->POST['sex'])?Tool_Fnc::apiMsg('请选择性别', '500'):Tool_Fnc::safe_string($this->POST['sex']); + $data['sex'] =empty($this->POST['sex'])||!isset($this->POST['sex'])?0:Tool_Fnc::safe_string($this->POST['sex']); $data['birthday'] =empty($this->POST['birthday'])||!isset($this->POST['birthday'])?Tool_Fnc::apiMsg('请填写生日', '500'):Tool_Fnc::safe_string($this->POST['birthday']); $data['father'] = empty($this->POST['father'])||!isset($this->POST['father'])?0:Tool_Fnc::safe_string($this->POST['father']); $data['mother'] = empty($this->POST['mother'])||!isset($this->POST['father'])?0:Tool_Fnc::safe_string($this->POST['mother']); @@ -174,7 +174,7 @@ class Api_SquirrelController extends Ctrl_Api{ public function editAction(){ $data['uid'] = empty($this->POST['uid'])||!isset($this->POST['uid'])?Tool_Fnc::apiMsg('请先登录', '500'):Tool_Fnc::safe_string($this->POST['id']); $data['id'] = empty($this->POST['id'])||!isset($this->POST['id'])?Tool_Fnc::apiMsg('系统错误', '500'):Tool_Fnc::safe_string($this->POST['id']); - $data['sex'] =empty($this->POST['sex'])||!isset($this->POST['sex'])?Tool_Fnc::apiMsg('请选择性别', '500'):Tool_Fnc::safe_string($this->POST['sex']); + $data['sex'] =empty($this->POST['sex'])||!isset($this->POST['sex'])?0:Tool_Fnc::safe_string($this->POST['sex']); $data['birthday'] =empty($this->POST['birthday'])||!isset($this->POST['birthday'])?Tool_Fnc::apiMsg('请填写生日', '500'):Tool_Fnc::safe_string($this->POST['birthday']); $data['father'] = empty($this->POST['father'])||!isset($this->POST['father'])?0:Tool_Fnc::safe_string($this->POST['father']); $data['mother'] = empty($this->POST['mother'])||!isset($this->POST['father'])?0:Tool_Fnc::safe_string($this->POST['mother']); diff --git a/application/models/Squirrel.php b/application/models/Squirrel.php index 384b90b..6557213 100644 --- a/application/models/Squirrel.php +++ b/application/models/Squirrel.php @@ -89,8 +89,8 @@ class SquirrelModel extends Orm_Base{ if($cageinfo['type']==2) $exec->where("cage={$cage}"); } $data = $exec->fList(); - $data[] = ['id'=>0,'number'=>"未知",'sex'=>2]; - $data[] = ['id'=>0,'number'=>"未知",'sex'=>1]; + $data[] = ['id'=>0,'number'=>"其他",'sex'=>2]; + $data[] = ['id'=>0,'number'=>"其他",'sex'=>1]; return $data; } public function getIcon($squirrel){