Exemple #1
0
 /**
  * 微信文章内容
  */
 public function addAction()
 {
     if ($this->_request->isPost()) {
         $aWeiXin = $this->_checkData('add');
         if (empty($aWeiXin)) {
             return null;
         }
         if (Model_CrawlWeixinArticle::addData($aWeiXin) > 0) {
             return $this->showMsg('微信文章增加成功!', true);
         } else {
             return $this->showMsg('微信文章增加失败!', false);
         }
     }
 }
Exemple #2
0
 /**
  * 自媒体详情
  */
 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' => '媒体详情'));
 }