Changeset 23569
- Timestamp:
- 2014/07/11 00:40:35 (10 years ago)
- Location:
- branches/version-2_13-dev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/class/helper/SC_Helper_BestProducts.php
r23568 r23569 141 141 public function deleteBestProducts($best_id) 142 142 { 143 $objDb = new SC_Helper_DB_Ex(); 144 // ランク付きレコードの削除 145 $objDb->sfDeleteRankRecord('dtb_best_products', 'best_id', $best_id, '', TRUE); 143 $objQuery =& SC_Query_Ex::getSingletonInstance(); 144 145 $table = 'dtb_best_products'; 146 $arrVal = array('del_flg' => 1); 147 $where = 'best_id = ?'; 148 $arrWhereVal = array($best_id); 149 $objQuery->update($table, $arrVal, $where, $arrWhereVal); 146 150 } 147 151 … … 158 162 foreach ($arrList as $recommend) { 159 163 if (in_array($recommend['product_id'], $productIDs)) { 160 $ objDb->sfDeleteRankRecord('dtb_best_products', 'best_id', $recommend['best_id'], '', TRUE);164 $this->deleteBestProducts($recommend['best_id']); 161 165 } 162 166 } -
branches/version-2_13-dev/tests/class/helper/SC_Helper_BestProducts/SC_Helper_BestProducts_deleteBestProductsTest.php
r23546 r23569 55 55 } 56 56 57 // データが削除後、ランクが 繰り上がることを確認58 public function testDeleteBestProducts_データ削除後_ランク が繰り上がることを確認(){57 // データが削除後、ランクが変動しないことを確認 58 public function testDeleteBestProducts_データ削除後_ランクは変動しない(){ 59 59 60 60 SC_Helper_BestProducts_Ex::deleteBestProducts("1001"); 61 61 62 $this->expected = " 1";62 $this->expected = "2"; 63 63 64 64 $arrRet = SC_Helper_BestProducts_Ex::getBestProducts('1002',true);
Note: See TracChangeset
for help on using the changeset viewer.