Changeset 17212
- Timestamp:
- 2008/04/04 19:41:33 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/class/pages/admin/total/LC_Page_Admin_Total.php
r16745 r17212 60 60 $this->arrWDAY = $masterData->getMasterData("mtb_wday"); 61 61 $this->arrSex = $masterData->getMasterData("mtb_sex"); 62 $this->arrJob = $masterData->getMasterData("mtb_job"); 62 63 // ページタイトル 63 64 $this->arrTitle[''] = "期間別集計"; … … 638 639 639 640 // 会員集計の取得 640 $col = "COUNT(*) AS order_count, SUM(total) AS total, (AVG(total)) AS total_average, order_sex";641 $col = "COUNT(*) AS order_count, SUM(total) AS total, trunc(AVG(total)) AS total_average, order_sex"; 641 642 $from = "dtb_order"; 642 643 $objQuery = new SC_Query(); … … 677 678 $where .= " and del_flg=0 and status <> " . ORDER_CANCEL; 678 679 679 $sql = "SELECT T1.product_id, T1.product_code, T1.product_name as name, T1.products_count, T1.order_count, T1.price, T1.total ";680 $sql = "SELECT T1.product_id, T1.product_code, T1.product_name, T1.products_count, T1.order_count, T1.price, T1.total "; 680 681 $sql.= "FROM ( "; 681 682 $sql.= "SELECT product_id, product_name, product_code, price, "; … … 698 699 if($graph) { 699 700 $image_key = "products_" . $type; 700 $objPage->tpl_image = $this->lfGetGraphPie($objPage->arrResults, " name", $image_key, "(売上比率)", $sdate, $edate);701 $objPage->tpl_image = $this->lfGetGraphPie($objPage->arrResults, "product_name", $image_key, "(売上比率)", $sdate, $edate); 701 702 } 702 703 } … … 704 705 /** 職業別集計 **/ 705 706 function lfGetOrderJob($type, $sdate, $edate, &$objPage, $graph = true) { 706 global $arrJob;707 708 707 list($where, $arrval) = $this->lfGetWhereMember('T2.create_date', $sdate, $edate, $type); 709 708 710 $sql = "SELECT job, count(*) AS order_count, SUM(total) AS total, (AVG(total)) AS total_average ";709 $sql = "SELECT job, count(*) AS order_count, SUM(total) AS total, trunc(AVG(total)) AS total_average "; 711 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; 712 711 $sql.= " GROUP BY job ORDER BY total DESC"; … … 719 718 $job_key = $objPage->arrResults[$i]['job']; 720 719 if($job_key != "") { 721 $objPage->arrResults[$i]['job_name'] = $ arrJob[$job_key];720 $objPage->arrResults[$i]['job_name'] = $this->arrJob[$job_key]; 722 721 } else { 723 722 $objPage->arrResults[$i]['job_name'] = "未回答";
Note: See TracChangeset
for help on using the changeset viewer.