Ignore:
Timestamp:
2011/12/26 17:11:08 (12 years ago)
Author:
Seasoft
Message:

#1582 (SC_Query 一致レコードの有無を返す機能を追加 (パフォーマンス改善))
#1526 (typo修正・ソース整形・ソースコメントの改善)
#1449 (不要な関数・処理の整理)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/pages/mypage/LC_Page_Mypage_Favorite.php

    r21368 r21376  
    177177    // お気に入り商品削除 
    178178    function lfDeleteFavoriteProduct($customer_id, $product_id) { 
    179         $objQuery       =& SC_Query_Ex::getSingletonInstance(); 
    180         $count      = $objQuery->count("dtb_customer_favorite_products", "customer_id = ? AND product_id = ?", array($customer_id, $product_id)); 
     179        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    181180 
    182         if ($count > 0) { 
    183             $objQuery->begin(); 
     181        $exists = $objQuery->exists("dtb_customer_favorite_products", "customer_id = ? AND product_id = ?", array($customer_id, $product_id)); 
     182 
     183        if ($exists) { 
    184184            $objQuery->delete('dtb_customer_favorite_products', "customer_id = ? AND product_id = ?", array($customer_id, $product_id)); 
    185             $objQuery->commit(); 
    186185        } 
    187186    } 
Note: See TracChangeset for help on using the changeset viewer.