Changeset 18040


Ignore:
Timestamp:
2009/06/04 02:02:57 (12 years ago)
Author:
Seasoft
Message:

merge r17776, r17926
・取得元: version-2_4
【取得元のログメッセージ】

  • EC-CUBE2.4改修 #408
  • 売上集計 MySQLのみで発生するバグ対応
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/pages/admin/total/LC_Page_Admin_Total.php

    r17568 r18040  
    638638 
    639639        // 会員集計の取得 
    640         $col = "COUNT(*) AS order_count, SUM(total) AS total, trunc(AVG(total)) AS total_average, order_sex"; 
     640        $col = "COUNT(*) AS order_count, SUM(total) AS total, trunc(AVG(total),0) AS total_average, order_sex"; 
    641641        $from = "dtb_order"; 
    642642        $objQuery = new SC_Query(); 
     
    683683        $sql.= "SUM(quantity) AS products_count, "; 
    684684        $sql.= "(price * sum(quantity)) AS total "; 
    685         $sql.= "FROM dtb_order_detail WHERE order_id IN (SELECT order_id FROM dtb_order WHERE $where ) "; 
     685        $sql.= "FROM dtb_order_detail AS T2 WHERE EXISTS (SELECT 1 FROM dtb_order AS T3 WHERE T2.order_id = T3.order_id AND $where ) "; 
    686686        $sql.= "GROUP BY product_id, product_name, product_code, price "; 
    687687        $sql.= ") AS T1 "; 
     
    706706        list($where, $arrval) = $this->lfGetWhereMember('T2.create_date', $sdate, $edate, $type); 
    707707 
    708         $sql = "SELECT job, count(*) AS order_count, SUM(total) AS total, trunc(AVG(total)) AS total_average "; 
     708        $sql = "SELECT job, count(*) AS order_count, SUM(total) AS total, trunc(AVG(total),0) AS total_average "; 
    709709        $sql.= "FROM dtb_customer AS T1 LEFT JOIN dtb_order AS T2 USING ( customer_id ) WHERE $where AND T2.del_flg = 0 and T2.status <> " . ORDER_CANCEL; 
    710710        $sql.= " GROUP BY job ORDER BY total DESC"; 
Note: See TracChangeset for help on using the changeset viewer.