#メール便対応商品
public function getList($product_type_id, $mail_delivery_available=true) {
$mail_deliv_id=20;
$objQuery = & SC_Query_Ex::getSingletonInstance();
$objQuery->setOrder('rank DESC');
$where='product_type_id = ? AND del_flg = 0';
$arrval=array($product_type_id);
if(!$mail_delivery_available){
$where.=' AND deliv_id !=?';
$arrval[]=$mail_deliv_id;
}
return $objQuery->select('*', 'dtb_deliv', $where ,$arrval );
}
上記のソースは色々混じってます。
#メール便対応商品
public function getList($product_type_id = null, $has_deleted = false,$mailflag = false)
{
$mail_deliv_id = 20;
$objQuery =& SC_Query_Ex::getSingletonInstance();
$col = '*';
$where = '';
$arrVal = array();
if (!$has_deleted) {
$where .= 'del_flg = 0';
}
if (!is_null($product_type_id)) {
if (!$has_deleted) {
$where .= ' AND ';
}
$where .= 'product_type_id = ?';
$arrVal[] = $product_type_id;
if ( $mailflag === false ) {
if($where != ""){
$where .= ' AND';
}
$where .= ' deliv_id <> ?';
$arrVal[] = $mail_deliv_id;//メール便のdeliv_id
}
}
$table = 'dtb_deliv';
$objQuery->setOrder('rank DESC');
$arrRet = $objQuery->select($col, $table, $where, $arrVal);
return $arrRet;
}
getlistの引数がデフォルトだとproduct_type_id, $has_deleted でその部分に追加で$mail_delivery_available
を追加しているはずですが、$has_deletedが消えています。
管理画面から読み出す部分に関してはproduct_type_idを渡さずに
と使用しているので、
$product_type_idがnullでproduct_type_id = NULL AND del_flg = 0とクエリが走り結果が0件となると思います。
自分で変更しているやつに関しては管理画面からのproduct_type_idがnullの場合にはメール便のチェックはスルーするようにしているので、下のソースを使用してみてください。
その際にpublic function getListからコピーしてお試しください。