- Timestamp:
- 2012/01/17 16:15:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/class/helper/SC_Helper_DB.php
r21376 r21402 99 99 * @param string $where データを検索する WHERE 句 100 100 * @param string $dsn データソース名 101 * @param string $sql @deprecatedデータの追加を行う場合の SQL文102 * @param bool $add @deprecatedデータの追加も行う場合 true101 * @param string $sql データの追加を行う場合の SQL文 102 * @param bool $add データの追加も行う場合 true 103 103 * @return bool データが存在する場合 true, データの追加に成功した場合 true, 104 104 * $add == false で, データが存在しない場合 false … … 109 109 110 110 $objQuery =& SC_Query_Ex::getSingletonInstance(); 111 $exists = $objQuery->exists($table_name, $where, $arrval); 112 111 $count = $objQuery->count($table_name, $where, $arrval); 112 113 if($count > 0) { 114 $ret = true; 115 } else { 116 $ret = false; 117 } 113 118 // データを追加する 114 if(!$ exists&& $add) {119 if(!$ret && $add) { 115 120 $objQuery->exec($sql); 116 121 } … … 153 158 * 154 159 * @return int 155 * @deprecated156 160 */ 157 161 function sfGetBasisCount() { … … 159 163 160 164 return $objQuery->count("dtb_baseinfo"); 161 }162 163 /**164 * 基本情報の登録有無を取得する165 *166 * @return boolean 有無167 */168 function sfGetBasisExists() {169 $objQuery =& SC_Query_Ex::getSingletonInstance();170 171 return $objQuery->exists('dtb_baseinfo');172 165 } 173 166 … … 1438 1431 $objQuery =& SC_Query_Ex::getSingletonInstance(); 1439 1432 $where = 'product_id = ? AND del_flg = 0 AND class_combination_id IS NOT NULL'; 1440 $ exists = $objQuery->exists('dtb_products_class', $where, array($product_id));1441 1442 return $ exists;1433 $count = $objQuery->count('dtb_products_class', $where, array($product_id)); 1434 1435 return $count >= 1; 1443 1436 } 1444 1437 }
Note: See TracChangeset
for help on using the changeset viewer.