本文整理汇总了PHP中SC_Query::setorder方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Query::setorder方法的具体用法?PHP SC_Query::setorder怎么用?PHP SC_Query::setorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Query
的用法示例。
在下文中一共展示了SC_Query::setorder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRanking
function getRanking()
{
$objQuery = new SC_Query();
$col = "T1.product_id, T1.product_name as name,COUNT(*) AS order_count ";
$from = "dtb_order_detail AS T1\r\n INNER JOIN dtb_order AS T2 ON T1.order_id = T2.order_id\r\n INNER JOIN dtb_products AS T3 ON T1.product_id = T3.product_id";
$objQuery->setgroupby("T1.product_id,T1.product_name");
$objQuery->setorder("order_count DESC");
$objQuery->setlimit(10);
//var_dump($objQuery->setorder("order_count DESC"));
return $objQuery->select($col, $from, 'T2.status = ?', array('5'));
}
示例2: testGetMasterData
/**
* SC_DB_MasterData::getMasterData() のテストケース
*/
function testGetMasterData()
{
$columns = array('id', 'name', 'rank');
$masterData = new SC_DB_MasterData_Ex();
$actual = $masterData->getMasterData('mtb_pref', $columns);
$objQuery = new SC_Query();
$objQuery->setorder($columns[2]);
$results = $objQuery->select($columns[0] . ", " . $columns[1], 'mtb_pref');
$expected = array();
foreach ($results as $result) {
$expected[$result[$columns[0]]] = $result[$columns[1]];
}
$this->assertEquals($expected, $actual);
}
示例3: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$objView = new SC_SiteView();
$objQuery = new SC_Query();
$objCustomer = new SC_Customer();
// レイアウトデザインを取得
$objLayout = new SC_Helper_PageLayout_Ex();
$objLayout->sfGetPageLayout($this, false, "mypage/index.php");
// ログインチェック
if (!$objCustomer->isLoginSuccess()) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
} else {
//マイページトップ顧客情報表示用
$this->CustomerName1 = $objCustomer->getvalue('name01');
$this->CustomerName2 = $objCustomer->getvalue('name02');
$this->CustomerPoint = $objCustomer->getvalue('point');
}
// お気に入り削除
if ($_POST['mode'] == 'delete_favorite') {
$customer_id = $objCustomer->getValue('customer_id');
$this->lfDeleteFavoriteProduct($customer_id, $_POST['product_id']);
}
//ページ送り用
if (isset($_POST['pageno'])) {
$this->tpl_pageno = htmlspecialchars($_POST['pageno'], ENT_QUOTES, CHAR_CODE);
}
$col = "*";
$from = " (SELECT\r\n T2.product_id AS product_id_main,\r\n T2.del_flg ,\r\n T2.status ,\r\n T2.name ,\r\n T2.main_list_image ,\r\n T1.create_date ,\r\n T1.customer_id\r\n FROM\r\n (SELECT\r\n product_id AS product_id_c ,\r\n create_date ,\r\n customer_id\r\n FROM\r\n dtb_customer_favorite_products\r\n ) AS T1 INNER JOIN dtb_products AS T2 ON T1.product_id_c = T2.product_id\r\n ) AS T3 INNER JOIN\r\n (SELECT\r\n product_id ,\r\n MIN(price02) AS price02_min ,\r\n MAX(price02) AS price02_max ,\r\n MAX(stock) AS stock_max ,\r\n MAX(stock_unlimited) AS stock_unlimited_max\r\n FROM\r\n dtb_products_class\r\n GROUP BY\r\n product_id\r\n ) AS T4 ON T3.product_id_main = T4.product_id";
$where = "customer_id = ? AND del_flg = 0 AND status = 1";
// 在庫無し商品の非表示
if (NOSTOCK_HIDDEN === true) {
$where .= " AND (stock_max >= 1 OR stock_unlimited_max = 1)";
}
$order = "create_date DESC";
$arrval = array($objCustomer->getvalue('customer_id'));
//お気に入りの数を取得
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
// ページ送りの取得
$objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset(SEARCH_PMAX, $startno);
// 表示順序
$objQuery->setorder($order);
//お気に入りの取得
$this->arrFavorite = $objQuery->select($col, $from, $where, $arrval);
// パラメータ管理クラス
$this->objFormParam = new SC_FormParam();
// POST値の取得
$this->objFormParam->setParam($_POST);
// 入力情報を渡す
$this->arrForm = $this->objFormParam->getFormParamList();
$objView->assignobj($this);
//$objpage内の全てのテンプレート変数をsmartyに格納
$objView->display(SITE_FRAME);
//パスとテンプレート変数の呼び出し、実行
}
示例4: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objSess = new SC_Session();
$objDb = new SC_Helper_DB_Ex();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
if ($_POST['mode'] == "search") {
// POST値の引き継ぎ
$this->arrForm = $_POST;
// 入力文字の強制変換
$this->lfConvertParam();
$where = "del_flg = 0 AND status = 1";
/* 入力エラーなし */
foreach ($this->arrForm as $key => $val) {
if ($val == "") {
continue;
}
switch ($key) {
case 'search_name':
$where .= " AND name ILIKE ?";
$arrval[] = "%{$val}%";
break;
case 'search_category_id':
list($tmp_where, $tmp_arrval) = $objDb->sfGetCatWhere($val);
if ($tmp_where != "") {
$where .= " AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")";
$arrval = array_merge((array) $arrval, (array) $tmp_arrval);
}
break;
case 'search_product_code':
$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code LIKE ? GROUP BY product_id)";
$arrval[] = "{$val}%";
break;
default:
break;
}
}
$order = "update_date DESC, product_id DESC";
// 読み込む列とテーブルの指定
$col = "product_id, name, category_id, main_list_image, status, product_code, price01, stock, stock_unlimited";
$from = "vw_products_nonclass AS noncls ";
$objQuery = new SC_Query();
// 行数の取得
if (empty($arrval)) {
$arrval = array();
}
$linemax = $objQuery->count("dtb_products", $where, $arrval);
$this->tpl_linemax = $linemax;
// 何件が該当しました。表示用
// ページ送りの処理
if (isset($_POST['search_page_max']) && is_numeric($_POST['search_page_max'])) {
$page_max = $_POST['search_page_max'];
} else {
$page_max = SEARCH_PMAX;
}
// ページ送りの取得
$objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
// 表示順序
$objQuery->setorder($order);
// 検索結果の取得
$this->arrProducts = $objQuery->select($col, $from, $where, $arrval);
}
// カテゴリ取得
$this->arrCatList = $objDb->sfGetCategoryList();
//---- ページ表示
$objView->assignobj($this);
$objView->display($this->tpl_mainpage);
}
示例5: lfGetOrderDetail
function lfGetOrderDetail($order_id)
{
$objQuery = new SC_Query();
$col = "product_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate";
$where = "order_id = ?";
$objQuery->setorder("classcategory_id1, classcategory_id2");
$arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
return $arrRet;
}
示例6: lfGetNews
/**
* 新着情報を取得する
*
* @param SC_Query $objQuery DB操作クラス
* @return array $arrNews 取得結果を配列で返す
*/
function lfGetNews(&$objQuery)
{
$col = "";
$col .= " news_id ";
//新着情報ID
$col .= " ,news_title ";
//新着情報タイトル
$col .= " ,news_comment ";
//新着情報本文
if (DB_TYPE == "pgsql") {
$col .= " ,to_char(news_date, 'YYYY') AS YEAR ";
//日付(年)
$col .= " ,to_char(news_date, 'MM') AS MONTH ";
//日付(月)
$col .= " ,to_char(news_date, 'DD') AS DAY ";
//日付(日)
$col .= " ,to_char(news_date, 'HH24') AS HOUR ";
//日付(時間)
$col .= " ,to_char(news_date, 'MI') AS MINUTE ";
//日付(分)
$col .= " ,to_char(news_date, 'SS') AS SECOND ";
//日付(秒)
} else {
if (DB_TYPE == "mysql") {
$col .= " ,DATE_FORMAT(news_date, '%Y') AS YEAR ";
//日付(年)
$col .= " ,DATE_FORMAT(news_date, '%m') AS MONTH ";
//日付(月)
$col .= " ,DATE_FORMAT(news_date, '%d') AS DAY ";
//日付(日)
$col .= " ,DATE_FORMAT(news_date, '%H') AS HOUR ";
//日付(時間)
$col .= " ,DATE_FORMAT(news_date, '%i') AS MINUTE ";
//日付(分)
$col .= " ,DATE_FORMAT(news_date, '%s') AS SECOND ";
//日付(秒)
}
}
$col .= " ,news_url ";
//新着情報URL
$col .= " ,news_select ";
//新着情報の区分(1:URL、2:本文)
$col .= " ,(SELECT shop_name FROM dtb_baseinfo limit 1) AS shop_name ";
//店名
$col .= " ,(SELECT email04 FROM dtb_baseinfo limit 1) AS email ";
//代表Emailアドレス
$from = "dtb_news";
$where = "del_flg = '0'";
$order = "rank DESC";
$objQuery->setorder($order);
$arrNews = $objQuery->select($col, $from, $where);
return $arrNews;
}
示例7: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objQuery = new SC_Query();
$objDb = new SC_Helper_DB_Ex();
// 認証可否の判定
$objSess = new SC_Session();
SC_Utils_Ex::sfIsSuccess($objSess);
$get_check = false;
// 規格IDのチェック
if (SC_Utils_Ex::sfIsInt($_GET['class_id'])) {
// 規格名の取得
$this->tpl_class_name = $objQuery->get("dtb_class", "name", "class_id = ?", array($_GET['class_id']));
if ($this->tpl_class_name != "") {
// 規格IDの引き継ぎ
$this->arrHidden['class_id'] = $_GET['class_id'];
$get_check = true;
}
}
if (!$get_check) {
// 規格登録ページに飛ばす。
$this->sendRedirect($this->getLocation(URL_CLASS_REGIST));
exit;
}
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
if (isset($_POST['class_id'])) {
if (!SC_Utils_Ex::sfIsInt($_POST['class_id'])) {
SC_Utils_Ex::sfDispError("");
}
}
// 新規作成 or 編集
switch ($_POST['mode']) {
// 登録ボタン押下
case 'edit':
// POST値の引き継ぎ
$this->arrForm = $_POST;
// 入力文字の変換
$_POST = $this->lfConvertParam($_POST);
// エラーチェック
$this->arrErr = $this->lfErrorCheck();
if (count($this->arrErr) <= 0) {
if ($_POST['classcategory_id'] == "") {
$this->lfInsertClass();
// DBへの書き込み
} else {
$this->lfUpdateClass();
// DBへの書き込み
}
// 再表示
$this->reload($_GET['class_id']);
//sfReload("class_id=" . $_GET['class_id']);
} else {
// POSTデータを引き継ぐ
$this->tpl_classcategory_id = $_POST['classcategory_id'];
}
break;
// 削除
// 削除
case 'delete':
// ランク付きレコードの削除
$where = "class_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['class_id']);
$objDb->sfDeleteRankRecord("dtb_classcategory", "classcategory_id", $_POST['classcategory_id'], $where, true);
break;
// 編集前処理
// 編集前処理
case 'pre_edit':
// 編集項目をDBより取得する。
$where = "classcategory_id = ?";
$name = $objQuery->get("dtb_classcategory", "name", $where, array($_POST['classcategory_id']));
// 入力項目にカテゴリ名を入力する。
$this->arrForm['name'] = $name;
// POSTデータを引き継ぐ
$this->tpl_classcategory_id = $_POST['classcategory_id'];
break;
case 'down':
$where = "class_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['class_id']);
$objDb->sfRankDown("dtb_classcategory", "classcategory_id", $_POST['classcategory_id'], $where);
break;
case 'up':
$where = "class_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['class_id']);
$objDb->sfRankUp("dtb_classcategory", "classcategory_id", $_POST['classcategory_id'], $where);
break;
default:
break;
}
// 規格分類の読込
$where = "del_flg <> 1 AND class_id = ?";
$objQuery->setorder("rank DESC");
$this->arrClassCat = $objQuery->select("name, classcategory_id", "dtb_classcategory", $where, array($_GET['class_id']));
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例8: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objSess = new SC_Session();
$objQuery = new SC_Query();
$objDb = new SC_Helper_DB_Ex();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
// 要求判定
switch ($_POST['mode']) {
// 編集処理
case 'edit':
// POST値の引き継ぎ
$this->arrForm = $_POST;
// 入力文字の変換
$this->arrForm = $this->lfConvertParam($this->arrForm);
// エラーチェック
$this->arrErr = $this->lfErrorCheck();
if (count($this->arrErr) <= 0) {
if ($_POST['class_id'] == "") {
$this->lfInsertClass($this->arrForm);
// 新規作成
} else {
$this->lfUpdateClass($this->arrForm);
// 既存編集
}
// 再表示
$this->reload();
} else {
// POSTデータを引き継ぐ
$this->tpl_class_id = $_POST['class_id'];
}
break;
// 削除
// 削除
case 'delete':
$objDb->sfDeleteRankRecord("dtb_class", "class_id", $_POST['class_id'], "", true);
$objQuery = new SC_Query();
$objQuery->delete("dtb_classcategory", "class_id = ?", $_POST['class_id']);
// 再表示
$this->reload();
break;
// 編集前処理
// 編集前処理
case 'pre_edit':
// 編集項目をDBより取得する。
$where = "class_id = ?";
$class_name = $objQuery->get("dtb_class", "name", $where, array($_POST['class_id']));
// 入力項目にカテゴリ名を入力する。
$this->arrForm['name'] = $class_name;
// POSTデータを引き継ぐ
$this->tpl_class_id = $_POST['class_id'];
break;
case 'down':
$objDb->sfRankDown("dtb_class", "class_id", $_POST['class_id']);
// 再表示
$this->reload();
break;
case 'up':
$objDb->sfRankUp("dtb_class", "class_id", $_POST['class_id']);
// 再表示
$this->reload();
break;
default:
break;
}
// 規格の読込
$where = "del_flg <> 1";
$objQuery->setorder("rank DESC");
$this->arrClass = $objQuery->select("name, class_id", "dtb_class", $where);
$this->arrClassCatCount = SC_Utils_Ex::sfGetClassCatCount();
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例9: lfGetPayment
function lfGetPayment($total_pretax)
{
$objQuery = new SC_Query();
$objQuery->setorder("rank DESC");
//削除されていない支払方法を取得
$arrRet = $objQuery->select("payment_id, payment_method, rule, upper_rule, note, payment_image", "dtb_payment", "del_flg = 0 AND deliv_id IN (SELECT deliv_id FROM dtb_deliv WHERE del_flg = 0) ");
//利用条件から支払可能方法を判定
foreach ($arrRet as $data) {
//下限と上限が設定されている
if ($data['rule'] > 0 && $data['upper_rule'] > 0) {
if ($data['rule'] <= $total_pretax && $data['upper_rule'] >= $total_pretax) {
$arrPayment[] = $data;
}
//下限のみ設定されている
} elseif ($data['rule'] > 0) {
if ($data['rule'] <= $total_pretax) {
$arrPayment[] = $data;
}
//上限のみ設定されている
} elseif ($data['upper_rule'] > 0) {
if ($data['upper_rule'] >= $total_pretax) {
$arrPayment[] = $data;
}
//設定なし
} else {
$arrPayment[] = $data;
}
}
return $arrPayment;
}
示例10: lfGetProduct
function lfGetProduct($category_id)
{
$objQuery = new SC_Query();
$col = "T2.product_id, name, main_list_image, T2.rank, product_code";
$table = "vw_products_nonclass AS noncls " . " LEFT JOIN dtb_product_categories AS T2 USING (product_id)";
$where = "del_flg = 0 AND T2.category_id = ?";
// 行数の取得
$linemax = $objQuery->count($table, $where, array($category_id));
// 該当件数表示用
$this->tpl_linemax = $linemax;
$objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX);
$startno = $objNavi->start_row;
$this->tpl_start_row = $objNavi->start_row;
$this->tpl_strnavi = $objNavi->strnavi;
// Navi表示文字列
$this->tpl_pagemax = $objNavi->max_page;
// ページ最大数(「上へ下へ」表示判定用)
$this->tpl_disppage = $objNavi->now_page;
// 表示ページ番号(「上へ下へ」表示判定用)
// 取得範囲の指定(開始行番号、行数のセット)
if (DB_TYPE != "mysql") {
$objQuery->setlimitoffset(SEARCH_PMAX, $startno);
}
$objQuery->setorder("rank DESC");
$arrRet = $objQuery->select($col, $table, $where, array($category_id));
return $arrRet;
}
示例11: process
//.........这里部分代码省略.........
}
$arrval[] = $element;
}
}
if ($tmp_where != "") {
$tmp_where .= ")";
$where .= " {$tmp_where}";
$view_where .= " {$tmp_where}";
}
break;
default:
break;
}
}
$order = "update_date DESC, product_id DESC";
$objQuery = new SC_Query();
switch ($_POST['mode']) {
case 'csv':
require_once CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php";
$objCSV = new SC_Helper_CSV_Ex();
// オプションの指定
$option = "ORDER BY {$order}";
// CSV出力タイトル行の作成
$arrOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput(1, " WHERE csv_id = 1 AND status = 1"));
if (count($arrOutput) <= 0) {
break;
}
$arrOutputCols = $arrOutput['col'];
$arrOutputTitle = $arrOutput['disp_name'];
$head = SC_Utils_Ex::sfGetCSVList($arrOutputTitle);
$data = $objCSV->lfGetProductsCSV($where, $option, $arrval, $arrOutputCols);
// CSVを送信する。
SC_Utils_Ex::sfCSVDownload($head . $data);
exit;
break;
case 'delete_all':
// 検索結果の取得
$col = "product_id";
$from = "vw_products_nonclass AS noncls ";
$arrProducts = $objQuery->select($col, $from, $where, $arrval);
// 検索結果をすべて削除
$sqlval['del_flg'] = 1;
$where = "product_id = ?";
if (count($arrProducts) > 0) {
foreach ($arrProducts as $key => $val) {
$objQuery->update("dtb_products", $sqlval, $where, array($arrProducts[$key]["product_id"]));
}
}
break;
default:
// 読み込む列とテーブルの指定
$col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited";
$from = "vw_products_nonclass AS noncls ";
// 行数の取得
$linemax = $objQuery->count("dtb_products", $view_where, $arrval);
$this->tpl_linemax = $linemax;
// 何件が該当しました。表示用
// ページ送りの処理
if (is_numeric($_POST['search_page_max'])) {
$page_max = $_POST['search_page_max'];
} else {
$page_max = SEARCH_PMAX;
}
// ページ送りの取得
$objNavi = new SC_PageNavi($this->arrHidden['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
$startno = $objNavi->start_row;
$this->arrPagenavi = $objNavi->arrPagenavi;
//キャンペーン商品検索時は、全結果の商品IDを変数に格納する
if (isset($_POST['search_mode']) && $_POST['search_mode'] == 'campaign') {
$arrRet = $objQuery->select($col, $from, $where, $arrval);
if (count($arrRet) > 0) {
$arrRet = sfSwapArray($arrRet);
$pid = implode("-", $arrRet['product_id']);
$this->arrHidden['campaign_product_id'] = $pid;
}
}
// 取得範囲の指定(開始行番号、行数のセット)
// if(DB_TYPE != "mysql") $objQuery->setlimitoffset($page_max, $startno);
$objQuery->setlimitoffset($page_max, $startno);
// 表示順序
$objQuery->setorder($order);
// 検索結果の取得
$this->arrProducts = $objQuery->select($col, $from, $where, $arrval);
// 各商品ごとのカテゴリIDを取得
if (count($this->arrProducts) > 0) {
foreach ($this->arrProducts as $key => $val) {
$this->arrProducts[$key]["categories"] = $objDb->sfGetCategoryId($val["product_id"]);
$objDb->g_category_on = false;
}
}
}
}
}
// カテゴリの読込
list($this->arrCatKey, $this->arrCatVal) = $objDb->sfGetLevelCatList(false);
$this->arrCatList = $this->lfGetIDName($this->arrCatKey, $this->arrCatVal);
// 画面の表示
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例12: lfStatusDisp
function lfStatusDisp($status, $pageno)
{
$objQuery = new SC_Query();
$select = "*";
$from = "dtb_order";
$where = "del_flg = 0 AND status = ?";
$arrval[] = $status;
$order = "order_id DESC";
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
// ページ送りの処理
$page_max = ORDER_STATUS_MAX;
// ページ送りの取得
$objNavi = new SC_PageNavi($pageno, $linemax, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
$this->tpl_pageno = $pageno;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
//表示順序
$objQuery->setorder($order);
//検索結果の取得
$this->arrStatus = $objQuery->select($select, $from, $where, $arrval);
}
示例13: lfGetRecommendProducts
/**
* デストラクタ.
*
* @return void
*/
function lfGetRecommendProducts($product_id)
{
$objQuery = new SC_Query();
$cols = '*, (SELECT COUNT(*) FROM dtb_order_detail WHERE product_id = alldtl.product_id) AS cnt';
$from = 'vw_products_allclass_detail AS alldtl';
$where = <<<__EOS__
del_flg = 0
AND status = 1
AND product_id IN (
SELECT product_id
FROM
dtb_order_detail
INNER JOIN dtb_order
ON dtb_order_detail.order_id = dtb_order.order_id
WHERE 0=0
AND dtb_order.del_flg = 0
AND dtb_order.order_id IN (
SELECT order_id
FROM dtb_order_detail
WHERE 0=0
AND product_id = ?
)
AND dtb_order_detail.product_id <> ?
)
__EOS__;
$objQuery->setorder('cnt DESC, RANDOM()');
$objQuery->setlimit($this->max);
$recommendProducts = $objQuery->select($cols, $from, $where, array($product_id, $product_id));
return $recommendProducts;
}
示例14: lfGetHoliday
function lfGetHoliday()
{
$objQuery = new SC_Query();
$objQuery->setorder("rank DESC");
$where = "del_flg <> 1";
$arrRet = $objQuery->select("month, day", "dtb_holiday", $where);
foreach ($arrRet as $key => $val) {
$arrHoliday[$val['month']][] = $val['day'];
}
return $arrHoliday;
}
示例15: lfGetOrderDetail
function lfGetOrderDetail($order_id)
{
$objQuery = new SC_Query();
$objCustomer = new SC_Customer();
//customer_idを検証
$customer_id = $objCustomer->getValue("customer_id");
$order_count = $objQuery->count("dtb_order", "order_id = ? and customer_id = ?", array($order_id, $customer_id));
if ($order_count != 1) {
return array();
}
$col = "product_id, classcategory_id1, classcategory_id2, quantity";
$where = "order_id = ?";
$objQuery->setorder("classcategory_id1, classcategory_id2");
$arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
return $arrRet;
}