Changeset 17212


Ignore:
Timestamp:
2008/04/04 19:41:33 (16 years ago)
Author:
satou
Message:

#264 【管理画面>売上集計】各種バグを改修。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2/data/class/pages/admin/total/LC_Page_Admin_Total.php

    r16745 r17212  
    6060        $this->arrWDAY = $masterData->getMasterData("mtb_wday"); 
    6161        $this->arrSex = $masterData->getMasterData("mtb_sex"); 
     62        $this->arrJob = $masterData->getMasterData("mtb_job"); 
    6263        // ページタイトル 
    6364        $this->arrTitle[''] = "期間別集計"; 
     
    638639 
    639640        // 会員集計の取得 
    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"; 
    641642        $from = "dtb_order"; 
    642643        $objQuery = new SC_Query(); 
     
    677678        $where .= " and del_flg=0 and status <> " . ORDER_CANCEL; 
    678679 
    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 "; 
    680681        $sql.= "FROM ( "; 
    681682        $sql.= "SELECT product_id, product_name, product_code, price, "; 
     
    698699        if($graph) { 
    699700            $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); 
    701702        } 
    702703    } 
     
    704705    /** 職業別集計 **/ 
    705706    function lfGetOrderJob($type, $sdate, $edate, &$objPage, $graph = true) { 
    706         global $arrJob; 
    707  
    708707        list($where, $arrval) = $this->lfGetWhereMember('T2.create_date', $sdate, $edate, $type); 
    709708 
    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 "; 
    711710        $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; 
    712711        $sql.= " GROUP BY job ORDER BY total DESC"; 
     
    719718            $job_key = $objPage->arrResults[$i]['job']; 
    720719            if($job_key != "") { 
    721                 $objPage->arrResults[$i]['job_name'] = $arrJob[$job_key]; 
     720                $objPage->arrResults[$i]['job_name'] = $this->arrJob[$job_key]; 
    722721            } else { 
    723722                $objPage->arrResults[$i]['job_name'] = "未回答"; 
Note: See TracChangeset for help on using the changeset viewer.