<query id="getBmg" action="select">
<tables>
<table name="bmg_other" />
</tables>
<conditions>
<condition operation="equal" column="target_srl" var="target_srl" filter="number" pipe="and"/>
<conditoin operation="equal" column="document_srl" var="document_srl" filter="number" pipe="and"/>
</conditions>
</query>
위와 같이 xml 쿼리문을 작성했습니다. pipe 조건절을 통해 target_srl 과 document_srl이 모두 만족해야 결과를 도출해내도록 했구요
$args->target_srl = abs($logged_info->member_srl); // 현재 댓글을 작성하려는 작성자의 member_srl
$args->document_srl = $obj->document_srl; // 현재 댓글을 작성하려는 글 번호
$output_i = executeQueryArray('bmg.getBmg', $args); // 내가 차단을 당했나요?
if($output_i->data){
return new BaseObject(-1, '쿼리 만족 결과 찾음!');
}
위는 모듈 코드입니다.
target_srl와 document_srl을 args에 넣어주고 쿼리문을 날렸는데,
현재 DB에는 완벽히 일치하는 데이터가 없음에도 불구하고 if($output_i->data) 내부에 들어가있는게 실행이되네요...
쿼리시 결과가 없을때만 해당 조건을 실행하게 하고싶은데 혹시 제가 잘못 작성한 부분이 있을까요?