/** * 导出流水 */ public function exportAction() { $iType = (int) $this->getParam('type'); $iPage = max(1, intval($this->getParam('page'))); $aWhere = array('iUserID' => $this->aCurrUser['iUserID'], 'iStatus' => 1); if ($iType > 0 && $iType < 3) { $aWhere['iPayment'] = $iType; } $aList = Model_Finance::getAll(array('where' => $aWhere, 'order' => 'iAutoID DESC')); $aSource = Model_Finance::getSources(); $aPayment = Model_Finance::getPayments(); $aData = array(); foreach ($aList as $v) { $aData[] = array('iAutoID' => $v['iAutoID'], 'iTime' => date('Y-m-d H:i:s', $v['iCreateTime']), 'sType' => $aPayment[$v['iPayment']], 'iPayMoney' => $v['iPayMoney'], 'iUserMoney' => $v['iUserMoney'], 'sSource' => $aSource[$v['iSource']], 'sRemark' => $v['sRemark']); } $aTitle = array('iAutoID' => '订单编号', 'iTime' => '时间', 'sType' => '分类', 'iPayMoney' => '金额', 'iUserMoney' => '当前余额', 'sSource' => '账单明细', 'sRemark' => '备注'); Util_File::exportCsv('财务流水-' . date('Ymd') . '.csv', $aData, $aTitle); return false; }
/** * 财务中心 */ public function financeAction() { $iType = (int) $this->getParam('type'); $iPage = max(1, intval($this->getParam('page'))); $aWhere = array('iUserID' => $this->aCurrUser['iUserID'], 'iStatus' => 1, 'iPut' => 1); if ($iType > 0 && $iType < 3) { $aWhere['iPayment'] = $iType; } $aData = Model_Finance::getList($aWhere, $iPage, 'iAutoID DESC'); $this->assign('aData', $aData); $this->assign('aUser', Model_User::getDetail($this->aCurrUser['iUserID'])); $this->assign('aSource', Model_Finance::getSources()); $this->assign('aPayment', Model_Finance::getPayments()); $this->assign('iType', $iType); $this->setMeta('mcenter_page', array('sTitle' => '自媒体中心 - 财务中心')); }