diff --git a/application/controllers/Api/Squirrel.php b/application/controllers/Api/Squirrel.php index 8296f9f..2bf96b9 100644 --- a/application/controllers/Api/Squirrel.php +++ b/application/controllers/Api/Squirrel.php @@ -257,7 +257,7 @@ class Api_SquirrelController extends Ctrl_Api{ public function getIconAction(){ $id= empty($this->POST['id'])?Tool_Fnc::apiMsg('缺少小鼠id', '500'):$this->POST['id']; $data = $this->Squirrelmodel->getIcon($id); - Tool_Fnc::apiMsg('获取成功', '200',data); + Tool_Fnc::apiMsg('获取成功', '200',$data); } } diff --git a/application/models/Squirrel.php b/application/models/Squirrel.php index a06aab8..a19daa4 100644 --- a/application/models/Squirrel.php +++ b/application/models/Squirrel.php @@ -35,7 +35,7 @@ class SquirrelModel extends Orm_Base{ //获取仓鼠信息 $data['slist']=$this->field('id,number,sex,birthday,father,mother,strains_id as strains,gene,hair_color,cage,remark')->where("is_delete=0 and is_kill=0 {$params['where']}")->fList(); foreach($data['slist'] as $key => &$val){ - $val['sex'] = $val['sex']=1?'公':'母'; + $val['sex'] = $val['sex']==1?'公':'母'; //获取笼位号 $val['cage'] =$cageModel->getOneInfo($val['cage'])['number']; } @@ -80,7 +80,7 @@ class SquirrelModel extends Orm_Base{ public function getIcon($squirrel){ $date = strtotime(date('Y-m-d',time())); $info = $this->field('nusring_time')->where("id={$squirrel}")->fRow(); - if(strotime($info['nusring_time'])>$date){ + if(strtotime($info['nusring_time'])>$date){ $data['icon'] = $_SERVER['HTTP_HOST'].Yaf_Registry::get("config")->cangshu->url->small; }else{ $data['icon'] =$_SERVER['HTTP_HOST'].Yaf_Registry::get("config")->cangshu->url->big;