Changeset 22833
- Timestamp:
- 2013/05/21 12:01:24 (11 years ago)
- Location:
- branches/version-2_13-dev/data/class
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/class/SC_Product.php
r22736 r22833 773 773 return $sql; 774 774 } 775 776 function getProductDispConditions($tablename = null) { 777 $tablename = ($tablename) ? $tablename . '.' : null; 778 return $tablename . 'del_flg = 0 AND ' . $tablename . 'status = 1 '; 779 } 780 775 781 } -
branches/version-2_13-dev/data/class/helper/SC_Helper_DB.php
r22735 r22833 29 29 * @version $Id:SC_Helper_DB.php 15532 2007-08-31 14:39:46Z nanasess $ 30 30 */ 31 class SC_Helper_DB 31 class SC_Helper_DB 32 32 { 33 33 … … 91 91 return false; 92 92 } 93 93 94 94 function sfColumnAdd($tableName, $colName, $colType) { 95 95 $objQuery =& SC_Query_Ex::getSingletonInstance($dsn); … … 185 185 * 基本情報のキャッシュデータファイルを生成する 186 186 * データはsfGetBasisDataより取得。 187 * 187 * 188 188 * このメソッドが直接呼ばれるのは、 189 189 *「基本情報管理>SHOPマスター」の更新完了後。 … … 726 726 727 727 //共通のfrom/where文の構築 728 $sql_where = 'alldtl.del_flg = 0 AND alldtl.status = 1';728 $sql_where = SC_Product_Ex::getProductDispConditions('alldtl'); 729 729 // 在庫無し商品の非表示 730 730 if (NOSTOCK_HIDDEN) { … … 1161 1161 1162 1162 $max = $objQuery->max('rank', $tableName, $where); 1163 1163 1164 1164 // 更新するランク値を取得 1165 1165 $newRank = $this->getNewRank($pos, $max); 1166 // 他のItemのランクを調整する 1166 // 他のItemのランクを調整する 1167 1167 $ret = $this->moveOtherItemRank($newRank, $oldRank, $objQuery, $tableName, $where); 1168 1168 if (!$ret) { … … 1184 1184 $objQuery->commit(); 1185 1185 } 1186 1186 1187 1187 /** 1188 1188 * 指定された位置の値をDB用のRANK値に変換する 1189 1189 * 指定位置が1番目に移動なら、newRankは最大値 1190 1190 * 指定位置が1番下へ移動なら、newRankは1 1191 * 1191 * 1192 1192 * @param int $position 指定された位置 1193 1193 * @param int $maxRank 現在のランク最大値 1194 1194 * @return int $newRank DBに登録するRANK値 1195 */ 1195 */ 1196 1196 function getNewRank($position, $maxRank) { 1197 1197 1198 1198 if ($position > $maxRank) { 1199 1199 $newRank = 1; … … 1208 1208 /** 1209 1209 * 指定した順位の商品から移動させる商品までのrankを1つずらす 1210 * 1210 * 1211 1211 * @param int $newRank 1212 1212 * @param int $oldRank 1213 1213 * @param object $objQuery 1214 1214 * @param string $where 1215 * @return boolean 1215 * @return boolean 1216 1216 */ 1217 1217 function moveOtherItemRank($newRank, $oldRank, &$objQuery, $tableName, $addWhere) { 1218 1218 1219 1219 $sqlval = array(); 1220 1220 $arrRawSql = array(); … … 1235 1235 return false; 1236 1236 } 1237 1237 1238 1238 return $objQuery->update($tableName, $sqlval, $where, $arrWhereVal, $arrRawSql); 1239 1240 } 1241 1239 1240 } 1241 1242 1242 1243 1243 /** … … 1324 1324 /** 1325 1325 * カテゴリ変更時の移動処理を行う. 1326 * 1326 * 1327 1327 * ※この関数って、どこからも呼ばれていないのでは?? 1328 1328 * … … 1622 1622 /** 1623 1623 * レコード件数を計算. 1624 * 1624 * 1625 1625 * @param string $table 1626 1626 * @param string $where -
branches/version-2_13-dev/data/class/pages/LC_Page_Sitemap.php
r22567 r22833 51 51 * :TODO: filemtime 関数を使えば、静的なページの更新時間も取得できそう 52 52 */ 53 class LC_Page_Sitemap extends LC_Page_Ex 53 class LC_Page_Sitemap extends LC_Page_Ex 54 54 { 55 55 … … 240 240 { 241 241 $objQuery = SC_Query_Ex::getSingletonInstance(); 242 $sql = 'SELECT product_id, update_date FROM dtb_products WHERE del_flg = 0 AND status = 1';242 $sql = 'SELECT product_id, update_date FROM dtb_products WHERE ' . SC_Product_Ex::getProductDispConditions(); 243 243 $result = $objQuery->getAll($sql); 244 244 -
branches/version-2_13-dev/data/class/pages/products/LC_Page_Products_List.php
r22735 r22833 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Products_List extends LC_Page_Ex 34 class LC_Page_Products_List extends LC_Page_Ex 35 35 { 36 36 … … 362 362 // ▼対象商品IDの抽出 363 363 // 商品検索条件の作成(未削除、表示) 364 $searchCondition['where'] = 'alldtl.del_flg = 0 AND alldtl.status = 1 ';364 $searchCondition['where'] = SC_Product_Ex::getProductDispConditions('alldtl'); 365 365 366 366 if (strlen($searchCondition['where_category']) >= 1) { … … 483 483 /** 484 484 * 485 * @param type $objProduct 485 * @param type $objProduct 486 486 * @return void 487 487 */ -
branches/version-2_13-dev/data/class/pages/products/LC_Page_Products_Review.php
r22567 r22833 32 32 * @version $Id:LC_Page_Products_Review.php 15532 2007-08-31 14:39:46Z nanasess $ 33 33 */ 34 class LC_Page_Products_Review extends LC_Page_Ex 34 class LC_Page_Products_Review extends LC_Page_Ex 35 35 { 36 36 … … 203 203 $objQuery =& SC_Query_Ex::getSingletonInstance(); 204 204 205 return $objQuery->get('name', 'dtb_products', 'product_id = ? AND del_flg = 0 AND status = 1', array($product_id));205 return $objQuery->get('name', 'dtb_products', 'product_id = ? AND ' . SC_Product_Ex::getProductDispConditions(), array($product_id)); 206 206 } 207 207 -
branches/version-2_13-dev/data/class/pages/rss/LC_Page_Rss_Products.php
r22567 r22833 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Rss_Products extends LC_Page_Ex 34 class LC_Page_Rss_Products extends LC_Page_Ex 35 35 { 36 36 … … 296 296 { 297 297 // --- 商品一覧の取得 298 $objQuery->setWhere('del_flg = 0 AND status = 1'); 298 $objProduct = new SC_Product_Ex(); 299 $objQuery->setWhere($objProduct->getProductDispConditions()); 299 300 $objQuery->setOrder('product_id'); 300 $objProduct = new SC_Product_Ex();301 301 $arrProductLsit = $objProduct->lists($objQuery); 302 302 // 各商品のカテゴリIDとランクの取得
Note: See TracChangeset
for help on using the changeset viewer.