function actionDeliveryDetailList() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('request', 'controller:string,action:string'); $this->_model =& FLEA::getSingleton('model_rep'); //出货表 $rep = $this->_model->find(array('ID' => $request['kcreport'], 'ID' => $request['actionDeliveryDetailList'])); if ($rep) { $this->_model =& FLEA::getSingleton('model_grid'); //表字段 $grid = $this->_model->findAll(array('RepID' => $rep['ID'])); //设置查询语句 $dbo =& FLEA::getDBO(); $this->sql = $rep['select FCustomerCode,FCustomerName,FDate,FSODate 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"); $FCustomer = isset($request['FCustomer']) ? trim($this->u2gbk($request['FCustomer'])) : null; $cond->between($formdate, $todate, 'FDate', 'D', 2); $cond->equal($FCustomer, 'FCustomerCode', 'S', ' and '); ///此处可修改<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //排序 $order = new class_order($request); //获取当前页 $page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1; $page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20; echo $this->sql; //获取SQL查询的全部记录 $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder()); //获取SQL查询的记录总数 $page['count'] = count($alldata); //$allFProfit =$this->_count($alldata,'FProfit'); //$allFSaleAmount =$this->_count($alldata,'FSaleAmount'); //记录偏移量 $page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size']; $data = array_slice($alldata, $page['offset'], $page['size'], true); //处理查询结果 if (isset($data)) { ///此处可修改>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $this->_smarty->assign('formdate', $formdate); $this->_smarty->assign('todate', $todate); $this->_smarty->assign('FCustomer', $FCustomer); ///此处可修改<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $this->_smarty->assign('orderField', $order->getField()); $this->_smarty->assign('orderDirection', $order->getDirection()); $this->_smarty->assign('page', $page); $this->_smarty->assign('data', $data); $this->_smarty->assign('grid', $grid); $this->_smarty->assign('alldata', $alldata); $this->_smarty->assign('allFProfit', $allFProfit); $this->_smarty->assign('allFSaleAmount', $allFSaleAmount); $this->_smarty->display('kc.DeliveryDetailList.htm'); } } else { $this->_smarty->display('norepinfo.htm'); } }
function actionrepsaledeList() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('get', 'controller:string,action:string'); //设置查询语句 $dbo =& FLEA::getDBO(); $this->sql = 'select * from v_salesdetail'; //查询条件-按日期查询 $cond = new class_conditions(); $formdate = isset($request['formdate']) ? $request['formdate'] : null; $todate = isset($request['todate']) ? $request['todate'] : null; $FA = isset($request['FA']) ? rawurldecode($request['FA']) : ''; $FAV = isset($request['FAV']) ? rawurldecode($request['FAV']) : null; $FB = isset($request['FB']) ? rawurldecode($request['FB']) : ''; $FBV = isset($request['FBV']) ? rawurldecode($request['FBV']) : null; $FCustomerType = isset($request['FCustomerType']) ? rawurldecode($request['FCustomerType']) : null; $FBrand = isset($request['FBrand']) ? rawurldecode($request['FBrand']) : null; $FType = isset($request['FType']) ? rawurldecode($request['FType']) : null; $FArea = isset($request['FArea']) ? rawurldecode($request['FArea']) : null; $FDeptName = isset($request['FDeptName']) ? rawurldecode($request['FDeptName']) : null; $FEmpIDName = isset($request['FEmpIDName']) ? rawurldecode($request['FEmpIDName']) : null; $FSaleStyleName = isset($request['FSaleStyleName']) ? rawurldecode($request['FSaleStyleName']) : null; if ($FA != '') { $FCustomerType = $FA == 'FCustomerType' ? $FAV : $FCustomerType; $FBrand = $FA == 'FBrand' ? $FAV : $FBrand; $FType = $FA == 'FType' ? $FAV : $FType; $FArea = $FA == 'FArea' ? $FAV : $FArea; $FDeptName = $FA == 'FDeptName' ? $FAV : $FDeptName; $FEmpIDName = $FA == 'FEmpIDName' ? $FAV : $FEmpIDName; } if ($FB != '' && $FA != $FB) { $FCustomerType = $FB == 'FCustomerType' ? $FBV : $FCustomerType; $FBrand = $FB == 'FBrand' ? $FBV : $FBrand; $FType = $FB == 'FType' ? $FBV : $FType; $FArea = $FB == 'FArea' ? $FBV : $FArea; $FDeptName = $FB == 'FDeptName' ? $FBV : $FDeptName; $FEmpIDName = $FB == 'FEmpIDName' ? $FBV : $FEmpIDName; } $cond->between($formdate, $todate, 'fdate', 'D', 2); $cond->equal($FCustomerType, 'FCustomerType', 'S', ' and '); $cond->equal($FBrand, 'FBrand', 'S', ' and '); $cond->equal($FType, 'FType', 'S', ' and '); $cond->equal($FArea, 'FArea', 'S', ' and '); $cond->equal($FDeptName, 'FDeptName', 'S', ' and '); $cond->equal($FEmpIDName, 'FEmpIDName', 'S', ' and '); $cond->equal($FSaleStyleName, 'FSaleStyleName', 'S', ' and '); //排序 $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("repsaledeList"); }
function actionDeliveryDetail() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('post', '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"); $FCustomers = isset($request['FCustomers']) ? trim($this->u2gbk($request['FCustomers'])) : ''; $FCustomercode = isset($request['FCustomercode']) ? trim($this->u2gbk($request['FCustomercode'])) : ''; if (!strpos($FCustomers, ',')) { $FCustomercode = $FCustomers; } else { if (strlen($FCustomercode) == 0) { $pos = strpos($FCustomers, ','); $FCustomercode = substr($FCustomers, 0, $pos); } else { $start = strpos($FCustomers, $FCustomercode); $start = $start + strlen($FCustomercode) + 1; if ($start >= strlen($FCustomers)) { $pos = strpos($FCustomers, ','); $FCustomercode = substr($FCustomers, 0, $pos); } else { $pos = strpos($FCustomers, ',', $start); if (!$pos) { $FCustomercode = substr($FCustomers, $start); } else { $FCustomercode = substr($FCustomers, $start, $pos - $start); } } } } $cond->between($formdate, $todate, 'fdate', 'D', 2); $cond->equal($FCustomercode, 'FCustomercode', 'S', ' and '); //排序 $order = new class_order($request); //获取当前页 $page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1; $page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20; //获取SQL查询的全部记录 $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder()); foreach ($alldata as $row) { $FCustomername = $row['FCustomerName']; $FAddress = $row['FAddress']; $FProvince = $row['FProvince']; $FCity = $row['FCity']; $FTel = $row['FTel']; $FFax = $row['FFax']; $FMobile = $row['FMobile']; $FRMB = 'RMB'; break; } //获取SQL查询的记录总数 $page['count'] = count($alldata); //记录偏移量 $page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size']; $data = array_slice($alldata, $page['offset'], $page['size'], true); //处理查询结果 if (isset($data)) { $this->_smarty->assign('formdate', $formdate); $this->_smarty->assign('todate', $todate); $this->_smarty->assign('FCustomers', $FCustomers); $this->_smarty->assign('FCustomercode', $FCustomercode); $this->_smarty->assign('FCustomername', $FCustomername); $this->_smarty->assign('FAddress', $FAddress); $this->_smarty->assign('FProvince', $FProvince); $this->_smarty->assign('FCity', $FCity); $this->_smarty->assign('FTel', $FTel); $this->_smarty->assign('FFax', $FFax); $this->_smarty->assign('FMobile', $FMobile); $this->_smarty->assign('FRMB', $FRMB); $this->_smarty->assign('orderField', $order->getField()); $this->_smarty->assign('orderDirection', $order->getDirection()); $this->_smarty->assign('page', $page); $this->_smarty->assign('data', $data); $this->_smarty->assign('alldata', $alldata); $this->_smarty->display('kc.DeliveryDetail.htm'); } }
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"); }
function actionDeliveryDetail() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('get', 'controller:string,action:string'); //设置查询语句 $dbo =& FLEA::getDBO(); $this->sql = 'select FCustomerCode,FCustomerName,FDate,FAmount,FAllAmount 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"); $FCustomer = isset($request['FCustomer']) ? trim(rawurldecode($request['FCustomer'])) : null; $cond->equal($FCustomer, 'FCustomerCode', 'S', ' and '); $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"); }
function actionrepsaledeList() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('request', 'controller:string,action:string'); //设置查询语句 $dbo =& FLEA::getDBO(); $this->sql = 'select * from v_salesdetail'; //查询条件-按日期查询 $cond = new class_conditions(); $formdate = isset($request['formdate']) ? $request['formdate'] : null; $todate = isset($request['todate']) ? $request['todate'] : null; $FA = isset($request['FA']) ? rawurldecode($request['FA']) : ''; $FAV = isset($request['FAV']) ? rawurldecode($request['FAV']) : null; $FB = isset($request['FB']) ? rawurldecode($request['FB']) : ''; $FBV = isset($request['FBV']) ? rawurldecode($request['FBV']) : null; $FCustomerType = isset($request['FCustomerType']) ? rawurldecode($request['FCustomerType']) : null; $FBrand = isset($request['FBrand']) ? rawurldecode($request['FBrand']) : null; $FType = isset($request['FType']) ? rawurldecode($request['FType']) : null; $FArea = isset($request['FArea']) ? rawurldecode($request['FArea']) : null; $FDeptName = isset($request['FDeptName']) ? rawurldecode($request['FDeptName']) : null; $FEmpIDName = isset($request['FEmpIDName']) ? rawurldecode($request['FEmpIDName']) : null; $FSaleStyleName = isset($request['FSaleStyleName']) ? rawurldecode($request['FSaleStyleName']) : null; if ($FA != '') { $FCustomerType = $FA == 'FCustomerType' ? $FAV : $FCustomerType; $FBrand = $FA == 'FBrand' ? $FAV : $FBrand; $FType = $FA == 'FType' ? $FAV : $FType; $FArea = $FA == 'FArea' ? $FAV : $FArea; $FDeptName = $FA == 'FDeptName' ? $FAV : $FDeptName; $FEmpIDName = $FA == 'FEmpIDName' ? $FAV : $FEmpIDName; } if ($FB != '' && $FA != $FB) { $FCustomerType = $FB == 'FCustomerType' ? $FBV : $FCustomerType; $FBrand = $FB == 'FBrand' ? $FBV : $FBrand; $FType = $FB == 'FType' ? $FBV : $FType; $FArea = $FB == 'FArea' ? $FBV : $FArea; $FDeptName = $FB == 'FDeptName' ? $FBV : $FDeptName; $FEmpIDName = $FB == 'FEmpIDName' ? $FBV : $FEmpIDName; } $cond->between($formdate, $todate, 'fdate', 'D', 2); $cond->equal($FCustomerType, 'FCustomerType', 'S', ' and '); $cond->equal($FBrand, 'FBrand', 'S', ' and '); $cond->equal($FType, 'FType', 'S', ' and '); $cond->equal($FArea, 'FArea', 'S', ' and '); $cond->equal($FDeptName, 'FDeptName', 'S', ' and '); $cond->equal($FEmpIDName, 'FEmpIDName', 'S', ' and '); $cond->equal($FSaleStyleName, 'FSaleStyleName', 'S', ' and '); //排序 $order = new class_order($request); //获取当前页 $page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1; $page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20; //获取SQL查询的全部记录 $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder()); //获取SQL查询的记录总数 $page['count'] = count($alldata); $allFProfit = $this->_count($alldata, 'FProfit'); $allFSaleAmount = $this->_count($alldata, 'FSaleAmount'); //记录偏移量 $page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size']; $data = array_slice($alldata, $page['offset'], $page['size'], true); //处理查询结果 if (isset($data)) { $this->_smarty->assign('formdate', $formdate); $this->_smarty->assign('todate', $todate); $this->_smarty->assign('FCustomerType', $FCustomerType); $this->_smarty->assign('FBrand', $FBrand); $this->_smarty->assign('FType', $FType); $this->_smarty->assign('FArea', $FArea); $this->_smarty->assign('FDeptName', $FDeptName); $this->_smarty->assign('FEmpIDName', $FEmpIDName); $this->_smarty->assign('FSaleStyleName', $FSaleStyleName); $this->_smarty->assign('orderField', $order->getField()); $this->_smarty->assign('orderDirection', $order->getDirection()); $this->_smarty->assign('page', $page); $this->_smarty->assign('data', $data); $this->_smarty->assign('alldata', $alldata); $this->_smarty->assign('allFProfit', $allFProfit); $this->_smarty->assign('allFSaleAmount', $allFSaleAmount); $this->_smarty->display('repsaledeList.htm'); } }