if(!empty($id)){ $where['id'] = $id; $where['pid'] = $id; $where['_logic'] = 'or'; $map['_complex'] = $where; }