Esempio n. 1
0
 /**
  * 导出自媒体
  */
 public function exportAction()
 {
     $iType = $this->getParam('type', 1);
     $sCookieKey = 'media_choose_' . $iType;
     $aData['aChooseID'] = !empty($_COOKIE[$sCookieKey]) ? explode(',', $_COOKIE[$sCookieKey]) : array();
     $aData['aChoose'] = array();
     foreach ($aData['aChooseID'] as $k => $v) {
         $aRow = Model_Media::getDetail($v);
         $aRow['sTags'] = Model_Media::getTagNames($v['iMediaID']);
         $aRow['sCitys'] = Model_Media::getCityNames($v['iMediaID']);
         $aData['aChoose'][] = $aRow;
     }
     $aTitle = array(Model_Media::TYPE_WEIXIN => array('sMediaName' => '帐号名称', 'sOpenName' => '公众号', 'iFollowerNum' => '粉丝量', 'iPrice1' => '单图文价格', 'iPrice2' => '第一条价格', 'iPrice3' => '第二条价格', 'iPrice4' => '其它位置价格', 'iReadNum' => '阅读数', 'sIntroduction' => '简介', 'sTags' => '标签', 'sCertifiedText' => '认证', 'sCitys' => '地区'), Model_Media::TYPE_FRIEND => array('sMediaName' => '微信号', 'iFollowerNum' => '好友数', 'iPrice1' => '直发价格', 'iPrice2' => '转发价格'), Model_Media::TYPE_WEIBO => array('sMediaName' => '微博名', 'iFollowerNum' => '好友数', 'iPrice1' => '直发价格', 'iPrice2' => '转发价格'));
     Util_File::exportCsv('自媒体表-' . date('Ymd') . '.csv', $aData['aChoose'], $aTitle[$iType]);
     return false;
 }
Esempio n. 2
0
 /**
  * 导出流水
  */
 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;
 }