調整機構へのお問い合わせ
if($this->params[“book_fl1″] ==”1” or $this->params[“book_fl2″] ==”1”){
$query = “SELECT PROJ_TBL.*,MGZN_TBL.*, FEATURE_TBL.TEXT_PART_J”;
// $query .= ” FROM (PROJ_TBL INNER JOIN MGZN_TBL ON PROJ_TBL.PROJ_COD = MGZN_TBL.PROJ_
COD) INNER JOIN FEATURE_TBL ON MGZN_TBL.PROJ_COD = FEATURE_TBL.PROJ_COD”;
$query .= ” FROM (PROJ_TBL INNER JOIN MGZN_TBL ON PROJ_TBL.PROJ_COD = MGZN_TBL.PROJ_
COD) LEFT JOIN FEATURE_TBL ON MGZN_TBL.PROJ_COD = FEATURE_TBL.PROJ_COD”;
$query .= ” WHERE PROJ_TBL.KIND_COD=’04’ AND PROJ_TBL.REFF_FLG=’2′ AND PROJ_TBL.DELE
_FLG=’0′ AND MGZN_TBL.DELE_FLG=’0′ AND (FEATURE_TBL.DELE_FLG=’0′ or FEATURE_TBL.DELE_FLG is null)”;
if($this->params[“book_fl1″] ==”1” and $this->params[“book_fl2″] ==”1″){
$query .= ” AND (LEFT(MGZN_TBL.BOOK_CD,2) = ’11’ or LEFT(MGZN_TBL.BOOK_CD,2)
= ’21’ or LEFT(MGZN_TBL.BOOK_CD,2) = ’31’ or LEFT(MGZN_TBL.BOOK_CD,2) = ’41’ or LEFT(MGZN_TBL.BOOK_CD,2) =
’50’)”;
}elseif($this->params[“book_fl1″] ==”1” and $this->params[“book_fl2″] ==””){
$query .= ” AND LEFT(MGZN_TBL.BOOK_CD,2) = ’50′”;
}else{
$query .= ” AND (LEFT(MGZN_TBL.BOOK_CD,2) = ’11’ or LEFT(MGZN_TBL.BOOK_CD,2)
= ’21’ or LEFT(MGZN_TBL.BOOK_CD,2) = ’31’ or LEFT(MGZN_TBL.BOOK_CD,2) = ’41’)”;
}
$query .= ” AND (MGZN_TBL.ARTI1_J like ‘%”.$book.”%’ or MGZN_TBL.ARTI1_E like ‘%”.$b
ook.”%'”;
$query .= ” or MGZN_TBL.ARTI2_J like ‘%”.$book.”%’ or MGZN_TBL.ARTI2_E like ‘%”.$boo
k.”%'”;
$query .= ” or FEATURE_TBL.TEXT_PART_J like ‘%”.$book.”%’ or FEATURE_TBL.TEXT_PART_E
like ‘%”.$book.”%'”;
$query .= ” or MGZN_TBL.MGZN_NM like ‘%”.$book.”%’)”;