- Timestamp:
- 2009/05/15 16:30:40 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/class/pages/admin/total/LC_Page_Admin_Total.php
r17213 r18007 639 639 640 640 // 会員集計の取得 641 $col = "COUNT(*) AS order_count, SUM(total) AS total, trunc(AVG(total) ) AS total_average, order_sex";641 $col = "COUNT(*) AS order_count, SUM(total) AS total, trunc(AVG(total),0) AS total_average, order_sex"; 642 642 $from = "dtb_order"; 643 643 $objQuery = new SC_Query(); … … 684 684 $sql.= "SUM(quantity) AS products_count, "; 685 685 $sql.= "(price * sum(quantity)) AS total "; 686 $sql.= "FROM dtb_order_detail WHERE order_id IN (SELECT order_id FROM dtb_order WHERE$where ) ";686 $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 ) "; 687 687 $sql.= "GROUP BY product_id, product_name, product_code, price "; 688 688 $sql.= ") AS T1 "; … … 707 707 list($where, $arrval) = $this->lfGetWhereMember('T2.create_date', $sdate, $edate, $type); 708 708 709 $sql = "SELECT job, count(*) AS order_count, SUM(total) AS total, trunc(AVG(total) ) AS total_average ";709 $sql = "SELECT job, count(*) AS order_count, SUM(total) AS total, trunc(AVG(total),0) AS total_average "; 710 710 $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; 711 711 $sql.= " GROUP BY job ORDER BY total DESC";
Note: See TracChangeset
for help on using the changeset viewer.