当前位置: 首页>>代码示例>>PHP>>正文


PHP SC_Query::getCol方法代码示例

本文整理汇总了PHP中SC_Query::getCol方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Query::getCol方法的具体用法?PHP SC_Query::getCol怎么用?PHP SC_Query::getCol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SC_Query的用法示例。


在下文中一共展示了SC_Query::getCol方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: findProductIdsOrder

 /**
  * SC_Queryインスタンスに設定された検索条件を元に並び替え済みの検索結果商品IDの配列を取得する。
  *
  * 検索条件は, SC_Query::setWhere() 関数で設定しておく必要があります.
  *
  * @param  SC_Query $objQuery SC_Query インスタンス
  * @param  array    $arrVal   検索パラメーターの配列
  * @return array    商品IDの配列
  */
 public function findProductIdsOrder(&$objQuery, $arrVal = array())
 {
     $table = 'dtb_products AS alldtl';
     if (is_array($this->arrOrderData) and $objQuery->order == '') {
         $o_col = $this->arrOrderData['col'];
         $o_table = $this->arrOrderData['table'];
         $o_order = $this->arrOrderData['order'];
         $objQuery->setOrder("T2.{$o_col} {$o_order}");
         $sub_sql = $objQuery->getSql($o_col, "{$o_table} AS T2", 'T2.product_id = alldtl.product_id');
         $sub_sql = $objQuery->dbFactory->addLimitOffset($sub_sql, 1);
         $objQuery->setOrder("({$sub_sql}) {$o_order}, product_id");
     }
     $arrReturn = $objQuery->getCol('alldtl.product_id', $table, '', $arrVal);
     return $arrReturn;
 }
开发者ID:ryoogata,项目名称:eccube-SQLAzureSupport-plugin,代码行数:24,代码来源:SC_Product.php

示例2: search

 static function search(LC_Page $objPage, SC_FormParam $objFormParam, SC_Query $objQuery)
 {
     // edit_** を除外する
     $objSql = new SC_DeviceAndroidSelect_Ex($objFormParam->getSearchArray(), "master");
     $objPage->tpl_linemax = $objSql->getCount();
     if ($objPage->tpl_linemax == 0) {
         return;
     }
     $objPage->page_max = $objFormParam->getValue("search_page_max", SEARCH_PMAX);
     $objPage->page = $objFormParam->getValue("search_pageno", 1);
     $objPage->objPageNavi = new SC_PageNavi_Ex($objPage->page, $objPage->tpl_linemax, $objPage->page_max, 'eccube.moveSearchPage', NAVI_PMAX);
     $objPage->arrPagenavi = $objPage->objPageNavi->arrPagenavi;
     $objSql->setOrder("device_name ASC");
     $objPage->arrData = $objSql->getList($objPage->objPageNavi, $objPage->page_max);
     $objPage->arrData = SC_Utils_Ex::makeArrayIDToKey("device_id", $objPage->arrData);
     foreach ($objPage->arrData as $device_id => &$arrData) {
         $arrData["category_id"] = $objQuery->getCol("category_id", "cp_dtb_device_categories", "device_id=?", (array) $device_id);
         $release_date = SC_Utils_Ex::sfDispDBDate($arrData["release_date"], false);
         if ($release_date) {
             $arrData["release_date"] = str_replace("1970/01/01", "", $release_date);
         }
         $last_access_date = SC_Utils_Ex::sfDispDBDate($arrData["last_access_date"], false);
         if ($last_access_date) {
             $arrData["last_access_date"] = str_replace("1970/01/01", "", $last_access_date);
         }
         $device_name = trim($arrData["device_name"]);
         $arrData["disp_device_name"] = str_replace("(", "\n(", $device_name);
     }
 }
开发者ID:alice-asahina,项目名称:support_device,代码行数:29,代码来源:SC_Helper_Device.php

示例3: lfGetURL

 function lfGetURL()
 {
     $objQuery = new SC_Query();
     $list_id = array();
     $list_id = $objQuery->getCol('product_id', 'dtb_videoplayer');
     foreach ($list_id as $value) {
         if ($value == $this->product_id) {
             $this->arrVideo = $objQuery->getRow('video_url,disp_width,disp_height', 'dtb_videoplayer', 'product_id = ?', array($this->product_id));
             //var_dump($this->video_url);
         }
     }
 }
开发者ID:nassos9090,项目名称:plugin,代码行数:12,代码来源:LC_Page_FrontParts_Bloc_VideoPlayer.php

示例4: listTables

 /**
  * テーブル一覧を取得する
  *
  * MDB2_Driver_Manager_pgsql#listTables の不具合回避を目的として独自実装している。
  * @return array テーブル名の配列
  */
 public function listTables(SC_Query &$objQuery)
 {
     $col = 'tablename';
     $from = 'pg_tables';
     $where = "schemaname NOT IN ('pg_catalog', 'information_schema', 'sys')";
     return $objQuery->getCol($col, $from, $where);
 }
开发者ID:ryoogata,项目名称:eccube-SQLAzureSupport-plugin,代码行数:13,代码来源:SC_DB_DBFactory_PGSQL.php

示例5: lfGetProduct

 function lfGetProduct($product_id)
 {
     $objQuery = new SC_Query();
     $col = "*";
     $table = "vw_products_nonclass AS noncls ";
     $where = "product_id = ?";
     $arrRet = $objQuery->select($col, $table, $where, array($product_id));
     // カテゴリID を取得
     $arrRet[0]['category_id'] = $objQuery->getCol("dtb_product_categories", "category_id", "product_id = ?", array($product_id));
     //編集時に規格IDが変わってしまうのを防ぐために規格が登録されていなければ規格IDを取得する
     if ($this->lfCheckNonClass($_POST['product_id'])) {
         $arrRet[0]['product_class_id'] = SC_Utils::sfGetProductClassId($product_id, "0", "0");
     }
     return $arrRet[0];
 }
开发者ID:RyotaKaji,项目名称:eccube-2.4.1,代码行数:15,代码来源:LC_Page_Admin_Products_Product.php

示例6: lfGetURL

 function lfGetURL($objPage)
 {
     $objQuery = new SC_Query();
     $list_id = array();
     $list_id = $objQuery->getCol('product_id', 'dtb_videoplayer');
     foreach ($list_id as $value) {
         if ($value == $objPage->arrProduct["product_id"]) {
             return $objQuery->getRow('video_url,disp_width,disp_height', 'dtb_videoplayer', 'product_id = ?', array($objPage->arrProduct["product_id"]));
         }
     }
 }
开发者ID:nassos9090,项目名称:plugin,代码行数:11,代码来源:VideoPlayer.php

示例7: sfGetCategoryId

 /**
  * 選択中の商品のカテゴリを取得する.
  *
  * @param integer $product_id プロダクトID
  * @param integer $category_id カテゴリID
  * @return array 選択中の商品のカテゴリIDの配列
  *
  */
 function sfGetCategoryId($product_id, $category_id = 0, $closed = false)
 {
     if ($closed) {
         $status = "";
     } else {
         $status = "status = 1";
     }
     if (!$this->g_category_on) {
         $this->g_category_on = true;
         $category_id = (int) $category_id;
         $product_id = (int) $product_id;
         if (SC_Utils_Ex::sfIsInt($category_id) && $this->sfIsRecord("dtb_category", "category_id", $category_id)) {
             $this->g_category_id = array($category_id);
         } else {
             if (SC_Utils_Ex::sfIsInt($product_id) && $this->sfIsRecord("dtb_products", "product_id", $product_id, $status)) {
                 $objQuery = new SC_Query();
                 $where = "product_id = ?";
                 $category_id = $objQuery->getCol("dtb_product_categories", "category_id", "product_id = ?", array($product_id));
                 $this->g_category_id = $category_id;
             } else {
                 // 不正な場合は、空の配列を返す。
                 $this->g_category_id = array();
             }
         }
     }
     return $this->g_category_id;
 }
开发者ID:RyotaKaji,项目名称:eccube-2.4.1,代码行数:35,代码来源:SC_Helper_DB.php

示例8: lfGetProductsCSV

 function lfGetProductsCSV($where, $option, $arrval, $arrOutputCols)
 {
     $objDb = new SC_Helper_DB_Ex();
     $from = "vw_product_class AS prdcls";
     $cols = SC_Utils_Ex::sfGetCommaList($arrOutputCols, true, array('category_id'));
     $objQuery = new SC_Query();
     $objQuery->setoption($option);
     $list_data = $objQuery->select($cols, $from, $where, $arrval);
     $max = count($list_data);
     // 規格分類名一覧
     if (in_array('classcategory_id1', $arrOutputCols) || in_array('classcategory_id2', $arrOutputCols)) {
         $arrClassCatName = $objDb->sfGetIDValueList("dtb_classcategory", "classcategory_id", "name");
     }
     if (!isset($data)) {
         $data = "";
     }
     for ($i = 0; $i < $max; $i++) {
         // 関連商品情報の付与
         if (in_array('classcategory_id1', $arrOutputCols)) {
             $list_data[$i]['classcategory_id1'] = $arrClassCatName[$list_data[$i]['classcategory_id1']];
         }
         if (in_array('classcategory_id2', $arrOutputCols)) {
             $list_data[$i]['classcategory_id2'] = $arrClassCatName[$list_data[$i]['classcategory_id2']];
         }
         if (in_array('category_id', $arrOutputCols)) {
             $arrCategory_id = $objQuery->getCol("dtb_product_categories", "category_id", "product_id = ?", array($list_data[$i]['product_id']));
             // カテゴリID 付与
             for ($j = 0; $j < count($arrCategory_id); $j++) {
                 $list_data[$i]['category_id'] .= $arrCategory_id[$j];
                 if ($j < count($arrCategory_id) - 1) {
                     $list_data[$i]['category_id'] .= "|";
                 }
             }
         }
         // 各項目をCSV出力用に変換する。
         $data .= $this->lfMakeProductsCSV($list_data[$i]);
     }
     return $data;
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:39,代码来源:SC_Helper_CSV.php


注:本文中的SC_Query::getCol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。