Changeset 18040
- Timestamp:
- 2009/06/04 02:02:57 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/admin/total/LC_Page_Admin_Total.php
r17568 r18040 638 638 639 639 // 会員集計の取得 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"; 641 641 $from = "dtb_order"; 642 642 $objQuery = new SC_Query(); … … 683 683 $sql.= "SUM(quantity) AS products_count, "; 684 684 $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 ) "; 686 686 $sql.= "GROUP BY product_id, product_name, product_code, price "; 687 687 $sql.= ") AS T1 "; … … 706 706 list($where, $arrval) = $this->lfGetWhereMember('T2.create_date', $sdate, $edate, $type); 707 707 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 "; 709 709 $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; 710 710 $sql.= " GROUP BY job ORDER BY total DESC";
Note: See TracChangeset
for help on using the changeset viewer.