YS:父亲母亲接口

master
yangsai@163.com 7 months ago
parent e29be06b95
commit 588c0639ae
  1. 5
      application/controllers/Api/Squirrel.php
  2. 3
      application/models/NewSquirrel.php
  3. 5
      application/models/Squirrel.php

@ -247,5 +247,10 @@ class Api_SquirrelController extends Ctrl_Api{
if(!$ret) Tool_Fnc::apiMsg('添加失败', '500');
Tool_Fnc::apiMsg('添加成功', '200');
}
public function getparentsAction(){
$data['sex'] = empty($this->POST['sex'])||!isset($this->POST['sex'])?Tool_Fnc::apiMsg('缺少性别参数', '500'):Tool_Fnc::safe_string($this->POST['sex']);
$return = $this->Squirrelmodel->partent($data);
Tool_Fnc::apiMsg('添加成功', '200',$return);
}
}

@ -35,5 +35,8 @@ class NewSquirrelModel extends Orm_Base{
}
return $data;
}
public function getFatherAction(){
}
}

@ -76,5 +76,10 @@ class SquirrelModel extends Orm_Base{
public function getOneInfo($cage){
return $this->field('*')->where("id={$cage}")->fRow();
}
public function partent($params){
$time = date('Y-m-d',time());
$data=$this->field('id,number')->where("is_delete=0 and is_kill=0 and sex = {$params['sex']} and grow_time<'{$time}'")->fList();
return $data;
}
}

Loading…
Cancel
Save