Changeset 21259


Ignore:
Timestamp:
2011/09/27 01:04:48 (9 years ago)
Author:
tao
Message:

#1248 会員情報の受注を更新する様に修正

Location:
branches/version-2_11-dev/data/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/SC_Customer.php

    r21118 r21259  
    300300        } 
    301301    } 
     302     
     303    //受注関連の顧客情報を更新 
     304    function updateOrderSummary($customer_id){ 
     305        $objQuery = new SC_Query_Ex(); 
     306        $arrOrderSummary =  $objQuery->getRow("SUM( payment_total ) as buy_total, COUNT(order_id) as buy_times,MAX( create_date ) as last_buy_date, MIN(create_date) as first_buy_date","dtb_order","customer_id = ? AND del_flg = 0 AND status <> ?",array($customer_id,ORDER_CANCEL)); 
     307        $objQuery->update("dtb_customer",$arrOrderSummary,"customer_id = ?",array($customer_id)); 
     308    } 
    302309} 
    303310?> 
  • branches/version-2_11-dev/data/class/helper/SC_Helper_Purchase.php

    r21251 r21259  
    8484        $this->registerShipping($orderId, $shippingTemp); 
    8585        $objQuery->commit(); 
     86 
     87        //会員情報の最終購入日、購入合計を更新 
     88        if($customerId > 0){ 
     89            SC_Customer_Ex::updateOrderSummary($customerId); 
     90        } 
     91 
    8692        $this->cleanupSession($orderId, $objCartSession, $objCustomer, $cartkey); 
    8793 
     
    804810                          "order_temp_id = ?", 
    805811                          array(SC_SiteSession_Ex::getUniqId())); 
    806  
     812         
     813         
     814         
    807815        return $orderParams['order_id']; 
    808816    } 
     
    10701078    function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddPoint = null, $newUsePoint = null, &$sqlval) { 
    10711079        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    1072  
    10731080        $arrOrderOld = $objQuery->getRow('status, add_point, use_point, customer_id', 'dtb_order', 'order_id = ?', array($orderId)); 
    10741081 
     
    11631170        $objQuery->update('dtb_order', $dest, 'order_id = ?', array($orderId)); 
    11641171        // ▲受注テーブルの更新 
     1172 
     1173        //会員情報の最終購入日、購入合計を更新 
     1174        if($arrOrderOld['customer_id'] > 0 and $arrOrderOld['status'] != $newStatus){ 
     1175            SC_Customer_Ex::updateOrderSummary($arrOrderOld['customer_id']); 
     1176        } 
    11651177    } 
    11661178 
Note: See TracChangeset for help on using the changeset viewer.