Changeset 12163


Ignore:
Timestamp:
2007/04/18 15:31:53 (15 years ago)
Author:
kakinaka
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/html/admin/total/index.php

    r12162 r12163  
    200200        // ¥Ð¥Ã¥Á¥â¡¼¥É¤Î¾ì¹ç¤Î¤ß¼Â¹Ô¤¹¤ë 
    201201        if(DAILY_BATCH_MODE) { 
    202             // 3ÆüÁ°¤Þ¤Ç¤Î½¸·× 
    203             lfStartDailyTotal(3,0); 
     202            // 1¥ö·îʬ¤Î½¸·× 
     203            lfStartDailyTotal(31,0); 
    204204        } 
    205205    } 
     
    617617    list($where, $arrval) = lfGetWhereMember('create_date', $sdate, $edate, $type); 
    618618     
    619     $sql = "SELECT T1.product_id, T1.product_code, T1.product_name, T1.products_count, T1.order_count, T1.price, T1.total "; 
     619    $sql = "SELECT T1.product_id, T1.product_code, T2.name, T1.products_count, T1.order_count, T1.price, T1.total "; 
    620620    $sql.= "FROM ( "; 
    621     $sql.= "SELECT product_id, product_name, product_code, price, "; 
     621    $sql.= "SELECT product_id, product_code, price, "; 
    622622    $sql.= "COUNT(*) AS order_count, "; 
    623623    $sql.= "SUM(quantity) AS products_count, "; 
    624624    $sql.= "(price * sum(quantity)) AS total "; 
    625625    $sql.= "FROM dtb_order_detail WHERE order_id IN (SELECT order_id FROM dtb_order WHERE $where ) "; 
    626     $sql.= "GROUP BY product_id, product_name, product_code, price "; 
    627     $sql.= ") AS T1 "; 
    628     $sql.= "ORDER BY T1.total DESC "; 
     626    $sql.= "GROUP BY product_id, product_code, price "; 
     627    $sql.= ") "; 
     628    $sql.= "AS T1 LEFT JOIN dtb_products AS T2 USING (product_id) WHERE T2.name IS NOT NULL AND status = 1 ORDER BY T1.total DESC "; 
    629629     
    630630    if($mode != "csv") { 
Note: See TracChangeset for help on using the changeset viewer.