Changeset 23569


Ignore:
Timestamp:
2014/07/11 00:40:35 (10 years ago)
Author:
shutta
Message:

#2581 (おすすめ商品管理> 最後尾のおすすめ商品の「下へ」ボタンが動作しない)
r23568 に関連して、削除時には上下を詰めないように変更。

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  
    141141    public function deleteBestProducts($best_id) 
    142142    { 
    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); 
    146150    } 
    147151 
     
    158162        foreach ($arrList as $recommend) { 
    159163            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']); 
    161165            } 
    162166        } 
  • branches/version-2_13-dev/tests/class/helper/SC_Helper_BestProducts/SC_Helper_BestProducts_deleteBestProductsTest.php

    r23546 r23569  
    5555    } 
    5656 
    57     // データが削除後、ランクが繰り上がることを確認 
    58     public function testDeleteBestProducts_データ削除後_ランクが繰り上がることを確認(){ 
     57    // データが削除後、ランクが変動しないことを確認 
     58    public function testDeleteBestProducts_データ削除後_ランクは変動しない(){ 
    5959 
    6060        SC_Helper_BestProducts_Ex::deleteBestProducts("1001"); 
    6161 
    62         $this->expected = "1"; 
     62        $this->expected = "2"; 
    6363 
    6464        $arrRet = SC_Helper_BestProducts_Ex::getBestProducts('1002',true); 
Note: See TracChangeset for help on using the changeset viewer.