/** * 微信内容 */ public function addAction() { if ($this->_request->isPost()) { $aWeiXin = $this->_checkData('add'); if (empty($aWeiXin)) { return null; } if (Model_CrawlWeixin::addData($aWeiXin) > 0) { return $this->showMsg('微信增加成功!', true); } else { return $this->showMsg('微信增加失败!', false); } } }
/** * 公众号认证 */ public function verifyaccountAction() { $iType = max(1, (int) $this->getParam('type')); $iPage = max(1, intval($this->getParam('page'))); $aData = Model_CrawlWeixin::getList(array(), $iPage); $this->assign('aData', $aData); $this->assign('iType', $iType); $this->setMeta('mcenter_page', array('sTitle' => '自媒体中心 - 公众号认证')); }
/** * 自媒体详情 */ public function detailAction() { $iMediaID = max(1, intval($this->getParam('id'))); $iPage = intval($this->getParam('page')); $aMedia = Model_Media::getDetail($iMediaID); if (empty($aMedia)) { return $this->show404('微信公众号未找到!'); } $aMedia['sTags'] = Model_Media::getTagNames($aMedia['iMediaID']); $aWeixin = Model_CrawlWeixin::getWeixinByAccount($aMedia['sOpenName']); if (empty($aWeixin)) { return $this->show404('微信公众号信息未匹配到!'); } $bTop10 = (bool) $this->getParam('top10'); $aWhere = array('iWeixinID' => $aWeixin['iWeixinID'], 'iStatus' => 1); if ($bTop10) { $aData = Model_CrawlWeixinArticle::getList($aWhere, 1, 'iReadNum DESC', 10); $aData['aPager'] = null; } else { $iPage = max(1, $this->getParam('page')); $aData = Model_CrawlWeixinArticle::getList($aWhere, $iPage, 'iPublishTime DESC', 10); } $this->assign('bTop10', $bTop10); $this->assign('aMedia', $aMedia); $this->assign('aWeixin', $aWeixin); $this->assign('aData', $aData); $this->assign('sTopMenu', 'media'); $this->setMeta('media_detail', array('sTitle' => '媒体详情')); }