yangsai@163.com 6 months ago
parent 152d2a7d4c
commit a4e3beafb9
  1. 2
      application/controllers/Api/Squirrel.php
  2. 4
      application/models/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);
}
}

@ -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;

Loading…
Cancel
Save