Commit 7d3c3620 authored by wuxiaoli's avatar wuxiaoli

no message

parent f56842d0
...@@ -707,11 +707,12 @@ class FamilyTree extends Api ...@@ -707,11 +707,12 @@ class FamilyTree extends Api
public function myCreateFamilyPeople(){ public function myCreateFamilyPeople(){
$page=$this->request->param("page",1); $page=$this->request->param("page",1);
$skeyword=$this->request->param("skeyword"); $skeyword=$this->request->param("skeyword");
$map["ft.create_user_id"] =$this->auth->id; $where= " (ft.create_user_id = ".$this->auth->id. " OR ftm.create_user_id = ".$this->auth->id . ") ";
if(!empty($skeyword)){ if(!empty($skeyword)){
$map["ft.name"] = ["like","%".$skeyword."%"]; $where = $where . " AND fp.name like '%".$skeyword."'";
} }
$list=FamilyTreeModel::myCreateFamilyPeople($map,$page,$this->pageSize); $list=FamilyPeopleModel::myCreateFamilyPeople($where,$page,$this->pageSize);
$this->success("",$list); $this->success("",$list);
} }
......
...@@ -83,5 +83,21 @@ class FamilyPeopleModel extends Model ...@@ -83,5 +83,21 @@ class FamilyPeopleModel extends Model
return self::where($where)->update($data); return self::where($where)->update($data);
} }
/**
* 查询我创建的族员
*/
public static function myCreateFamilyPeople($where,$page,$pageSize=10){
$data=self::alias("fp")
->join("family_tree ft","ft.people_id=fp.id","LEFT")
->join("family_tree_mate ftm","ftm.people_id=fp.id","LEFT")
->field("fp.id,fp.name,fp.photo,fp.sex,fp.activation_code")
->where($where)
->page($page)
->limit($pageSize)
->order("fp.id DESC")
->select();
return $data;
}
} }
\ No newline at end of file
...@@ -206,19 +206,4 @@ ORDER BY ...@@ -206,19 +206,4 @@ ORDER BY
return $data; return $data;
}*/ }*/
/**
* 查询我创建的族员
*/
public static function myCreateFamilyPeople($where,$page,$pageSize=10){
$data=self::alias("ft")
->join("family_people fp","ft.people_id=fp.id","LEFT")
->field("ft.id,ft.name,ft.photo,ft.sex,ft.people_id,fp.activation_code")
->where($where)
->page($page)
->limit($pageSize)
->order("ft.parent_id asc,ft.id asc")
->select();
return $data;
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment