yangsai@163.com 5 months ago
parent 33d6be13e1
commit 51ed65efb6
  1. 14
      application/controllers/Api/Squirrel.php
  2. 2
      application/models/Cage.php

@ -440,9 +440,19 @@ class Api_SquirrelController extends Ctrl_Api{
$uid = empty($this->POST['uid'])?Tool_Fnc::apiMsg('请登录', '500'):$this->POST['uid'];
$id = empty($this->POST['id'])?Tool_Fnc::apiMsg('幼崽信息获取失败', '500'):$this->POST['id'];
if(!$this->NewSquirrelmodel->where("id={$id} and c_user_id={$uid}")->del()){
Tool_Fnc::apiMsg('删除失败', '1');
Tool_Fnc::apiMsg('删除失败', '500');
}
Tool_Fnc::apiMsg('删除成功', '500');
Tool_Fnc::apiMsg('删除成功', '1');
}
public function deletesAction(){
$uid = empty($this->POST['uid'])?Tool_Fnc::apiMsg('请登录', '500'):$this->POST['uid'];
$id = empty($this->POST['id'])?Tool_Fnc::apiMsg('幼崽信息获取失败', '500'):$this->POST['id'];
$id = implode(",",$id);
$sql = "update {$this->Squirrelmodel->table} set is_delete=1 where id in ({$id}) and c_user_id={$uid}";
if(!$this->NewSquirrelmodel->exec($sql)){
Tool_Fnc::apiMsg('删除失败', '500');
}
Tool_Fnc::apiMsg('删除成功', '1');
}
}

@ -63,7 +63,7 @@ class CageModel extends Orm_Base{
$UserModel = new UserModel();
$info = $this->field('*')->where("id='{$id}'")->fRow();
//负责人id
$info['user'] = $UserModel->field('realname')->fRow()['realname'];
$info['user'] = $UserModel->field('realname')->where("id={$info['user_id']}")->fRow()['realname'];
return $info;
}
}

Loading…
Cancel
Save