- Timestamp:
- 2011/03/07 15:23:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
r20507 r20538 215 215 $customer_id = $arrRet[0]['customer_id']; 216 216 if($customer_id != "" && $customer_id >= 1) { 217 $arrRet = $objQuery->select( "point", "dtb_customer", "customer_id = ?", array($customer_id));217 $arrRet = $objQuery->select('point', "dtb_customer", "customer_id = ?", array($customer_id)); 218 218 $point = $arrRet[0]['point']; 219 219 $rollback_point = $arrRet[0]['point'] + $use_point - $add_point; … … 549 549 } 550 550 // 最上位ランクを取得 551 $max = ($max < $val[ "rank"]) ? $val["rank"] : $max;552 } 553 $sqlval[ "rank"] = $max + 1;551 $max = ($max < $val['rank']) ? $val['rank'] : $max; 552 } 553 $sqlval['rank'] = $max + 1; 554 554 $objQuery->insert("dtb_product_categories", $sqlval); 555 555 } … … 581 581 } 582 582 // 最下位ランクを取得 583 $min = ($min < $val[ "rank"]) ? $val["rank"] : $min;584 } 585 $sqlval[ "rank"] = $min;583 $min = ($min < $val['rank']) ? $val['rank'] : $min; 584 } 585 $sqlval['rank'] = $min; 586 586 $objQuery->insert("dtb_product_categories", $sqlval); 587 587 } … … 984 984 } 985 985 // 対象項目のランクを取得 986 $rank = $objQuery->get( "rank", $table, $where, array($id));986 $rank = $objQuery->get('rank', $table, $where, array($id)); 987 987 // ランクの最大値を取得 988 $maxrank = $objQuery->max( "rank", $table, $andwhere);988 $maxrank = $objQuery->max('rank', $table, $andwhere); 989 989 // ランクが最大値よりも小さい場合に実行する。 990 990 if($rank < $maxrank) { … … 1024 1024 } 1025 1025 // 対象項目のランクを取得 1026 $rank = $objQuery->get( "rank", $table, $where, array($id));1026 $rank = $objQuery->get('rank', $table, $where, array($id)); 1027 1027 1028 1028 // ランクが1(最小値)よりも大きい場合に実行する。 … … 1066 1066 $getWhere = "$keyIdColumn = ?"; 1067 1067 } 1068 $rank = $objQuery->get( "rank", $tableName, $getWhere, array($keyId));1069 1070 $max = $objQuery->max( "rank", $tableName, $where);1068 $rank = $objQuery->get('rank', $tableName, $getWhere, array($keyId)); 1069 1070 $max = $objQuery->max('rank', $tableName, $where); 1071 1071 1072 1072 // 値の調整(逆順) … … 1086 1086 1087 1087 // XXX 入れ替え先の順位が入れ替え元の順位と同じ場合 1088 if (!isset($term)) $term = "rank";1088 if (!isset($term)) $term = 'rank'; 1089 1089 1090 1090 // 指定した順位の商品から移動させる商品までのrankを1つずらす … … 1129 1129 $where.= " AND $andwhere"; 1130 1130 } 1131 $rank = $objQuery->get( "rank", $table, $where, array($id));1131 $rank = $objQuery->get('rank', $table, $where, array($id)); 1132 1132 1133 1133 if(!$delete) { … … 1174 1174 } 1175 1175 1176 $objQuery->setOrder( "level");1176 $objQuery->setOrder('level'); 1177 1177 $arrRet = $objQuery->select($col, $table, $where, $arrId); 1178 1178 return $arrRet; … … 1198 1198 // 移動レコードのランクを取得する。 1199 1199 $where = "$id_name = ?"; 1200 $rank = $objQuery->get( "rank", $table, $where, array($id));1200 $rank = $objQuery->get('rank', $table, $where, array($id)); 1201 1201 // 削除レコードのランクより上のレコードを一つ下にずらす。 1202 1202 $where = "rank > ? AND $cat_name = ?"; … … 1205 1205 // 新カテゴリでの登録処理 1206 1206 // 新カテゴリの最大ランクを取得する。 1207 $max_rank = $objQuery->max( "rank", $table, "$cat_name = ?", array($new_catid)) + 1;1207 $max_rank = $objQuery->max('rank', $table, "$cat_name = ?", array($new_catid)) + 1; 1208 1208 $where = "$id_name = ?"; 1209 1209 $sqlup = "UPDATE $table SET rank = ? WHERE $where";
Note: See TracChangeset
for help on using the changeset viewer.
