本文整理汇总了PHP中SC_Query::setoption方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Query::setoption方法的具体用法?PHP SC_Query::setoption怎么用?PHP SC_Query::setoption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Query
的用法示例。
在下文中一共展示了SC_Query::setoption方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lfGetCSVData
function lfGetCSVData()
{
global $arrAUTHORITY;
global $arrWORK;
$oquery = new SC_Query();
$cols = "authority,name,department,login_id,work";
$oquery->setwhere("del_flg <> 1");
$oquery->andwhere("member_id <> " . ADMIN_ID);
$oquery->setoption("ORDER BY rank DESC");
$list_data = $oquery->select($cols, "dtb_member");
$max = count($list_data);
for ($i = 0; $i < $max; $i++) {
$line = "";
$line .= "\"" . $arrAUTHORITY[$list_data[$i]['authority']] . "\",";
$tmp = ereg_replace("\"", "\"\"", $list_data[$i]['name']);
$line .= "\"" . $tmp . "\",";
$tmp = ereg_replace("\"", "\"\"", $list_data[$i]['department']);
$line .= "\"" . $tmp . "\",";
$tmp = ereg_replace("\"", "\"\"", $list_data[$i]['login_id']);
$line .= "\"" . $tmp . "\",";
$line .= "\"" . $arrWORK[$list_data[$i]['work']] . "\"\n";
$data .= $line;
}
$header = "\"権限\",\"名前\",\"所属\",\"ログインID\",\"稼働状況\"\n";
return $header . $data;
}
示例2: lfGetCat
function lfGetCat($parent_category_id)
{
$objQuery = new SC_Query();
if ($parent_category_id == "") {
$parent_category_id = '0';
}
$col = "category_id, category_name, level, rank, description";
$where = "del_flg = 0 AND parent_category_id = ?";
$objQuery->setoption("ORDER BY rank DESC");
$arrRet = $objQuery->select($col, "dtb_category", $where, array($parent_category_id));
return $arrRet;
}
示例3: lfGetMainCat
function lfGetMainCat($count_check = false, &$objSubPage)
{
$objQuery = new SC_Query();
$col = "*";
$from = "dtb_category left join dtb_category_total_count using (category_id)";
// メインカテゴリーとその直下のカテゴリーを取得する。
$where = 'level <= 2 AND del_flg = 0';
// 登録商品数のチェック
if ($count_check) {
$where .= " AND product_count > 0";
}
$objQuery->setoption("ORDER BY rank DESC");
$arrRet = $objQuery->select($col, $from, $where);
// メインカテゴリーを抽出する。
$arrMainCat = array();
foreach ($arrRet as $cat) {
if ($cat['level'] != 1) {
continue;
}
// 子カテゴリーを持つかどうかを調べる。
$arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray($arrRet, 'parent_category_id', 'category_id', $cat['category_id']);
$cat['has_children'] = count($arrChildrenID) > 0;
$arrMainCat[] = $cat;
}
$objSubPage->arrCat = $arrMainCat;
return $objSubPage;
}
示例4: sfGetLevelCatList
/**
* カテゴリーツリーの取得を行う.
*
* 親カテゴリの Value=0 を対象とする
*
* @param bool $parent_zero 親カテゴリの Value=0 の場合 true
* @return array カテゴリツリーの配列
*/
function sfGetLevelCatList($parent_zero = true)
{
$objQuery = new SC_Query();
$col = "category_id, parent_category_id, category_name, level";
$where = "del_flg = 0";
$objQuery->setoption("ORDER BY rank DESC");
$arrRet = $objQuery->select($col, "dtb_category", $where);
$max = count($arrRet);
for ($cnt = 0; $cnt < $max; $cnt++) {
if ($parent_zero) {
if ($arrRet[$cnt]['level'] == LEVEL_MAX) {
$arrValue[$cnt] = $arrRet[$cnt]['category_id'];
} else {
$arrValue[$cnt] = "";
}
} else {
$arrValue[$cnt] = $arrRet[$cnt]['category_id'];
}
$arrOutput[$cnt] = "";
// 子カテゴリから親カテゴリを検索
$parent_category_id = $arrRet[$cnt]['parent_category_id'];
for ($cat_cnt = $arrRet[$cnt]['level']; $cat_cnt > 1; $cat_cnt--) {
foreach ($arrRet as $arrCat) {
// 親が見つかったら順番に代入
if ($arrCat['category_id'] == $parent_category_id) {
$arrOutput[$cnt] = CATEGORY_HEAD . $arrCat['category_name'] . $arrOutput[$cnt];
$parent_category_id = $arrCat['parent_category_id'];
}
}
}
$arrOutput[$cnt] .= CATEGORY_HEAD . $arrRet[$cnt]['category_name'];
}
return array($arrValue, $arrOutput);
}
示例5: lfGetCSV
function lfGetCSV($from, $where, $option, $arrval, $arrCsvOutputCols = "")
{
$cols = SC_Utils_Ex::sfGetCommaList($arrCsvOutputCols);
$objQuery = new SC_Query();
$objQuery->setoption($option);
$list_data = $objQuery->select($cols, $from, $where, $arrval);
$max = count($list_data);
if (!isset($data)) {
$data = "";
}
for ($i = 0; $i < $max; $i++) {
// 各項目をCSV出力用に変換する。
$data .= $this->lfMakeCSV($list_data[$i]);
}
return $data;
}