예제 #1
0
 function actionDeliveryDetail()
 {
     //过滤语句
     $using = new class_using();
     $request = $using->safeUsing('get', 'controller:string,action:string');
     //设置查询语句
     $dbo =& FLEA::getDBO();
     $this->sql = 'select * from v_delivery';
     //查询条件-按日期查询
     $cond = new class_conditions();
     $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d");
     $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d");
     $cond->between($formdate, $todate, 'fdate', 'D', 2);
     //排序
     $order = new class_order($request);
     //获取SQL查询的全部记录
     $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder());
     $xls = new class_excel();
     $xls->addArray($this->gethead($alldata));
     $xls->addArray($this->getdata($alldata));
     $xls->addArray($this->getfoot($alldata));
     $xls->generateXML("DeliveryDetail");
 }
예제 #2
0
 function actionDeliveryDetail()
 {
     //过滤语句
     $using = new class_using();
     $request = $using->safeUsing('get', 'controller:string,action:string');
     //设置查询语句
     $dbo =& FLEA::getDBO();
     $this->sql = 'select FCustomerType,sum(FSaleAmountIncludeTax) as FSaleAmountIncludeTax ,sum(FSaleAmount) as FSaleAmount,sum(FAmount) as FAmount,sum(FProfit) as FProfit,case when sum(FSaleAmount) = 0 then 0 else sum(FProfit)/sum(FSaleAmount) end FProfitRate from v_salesdetail';
     //查询条件-按日期查询
     $cond = new class_conditions();
     $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d");
     $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d");
     $FCustomerType = isset($request['FCustomerType']) ? trim(rawurldecode($request['FCustomerType'])) : null;
     $cond->between($formdate, $todate, 'fdate', 'D', 2);
     $cond->equal($FCustomerType, 'FCustomerType', 'S', ' and ');
     //排序
     $order = new class_order($request);
     //获取SQL查询的全部记录
     $alldata = $dbo->getAll($this->sql . $cond->getWhere() . ' group by FCustomerType ' . $order->getOrder());
     $xls = new class_excel();
     $xls->addArray($this->gethead($alldata));
     $xls->addArray($this->getdata($alldata));
     $xls->addArray($this->getfoot($alldata));
     $xls->generateXML("DeliveryDetail");
 }