当前位置: 首页>>代码示例>>PHP>>正文


PHP Model_Category::getPairCategorys方法代码示例

本文整理汇总了PHP中Model_Category::getPairCategorys方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Category::getPairCategorys方法的具体用法?PHP Model_Category::getPairCategorys怎么用?PHP Model_Category::getPairCategorys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model_Category的用法示例。


在下文中一共展示了Model_Category::getPairCategorys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addAction

 /**
  * 增加资讯
  *
  * @return boolean
  */
 public function addAction()
 {
     if ($this->isPost()) {
         $aNews = $this->_checkData();
         if (empty($aNews)) {
             return null;
         }
         $sAction = '保存';
         if ($this->getParam('iOptype') > 0) {
             $aNews['iPublishStatus'] = 1;
             //发布需要将该字段改为1
             $sAction = '发布';
         }
         //增加需要加上当前添加人ID
         $aCurrUserInfo = $this->aCurrUser;
         $aNews['iUpdateUserID'] = $aCurrUserInfo['iUserID'];
         $aNews['iCreateUserID'] = $aCurrUserInfo['iUserID'];
         $iNewsID = Model_News::addData($aNews);
         if ($iNewsID > 0) {
             return $this->showMsg(['sMsg' => '资讯信息' . $sAction . '成功!', 'iNewsID' => $iNewsID], true);
         } else {
             return $this->showMsg('资讯信息' . $sAction . '失败!', false);
         }
     } else {
         $this->_response->setHeader('Access-Control-Allow-Origin', '*.*');
         $aCategory = Model_Category::getPairCategorys($this->_getTypeCategory());
         $aTag = $this->_getTagList();
         //Model_Tag::getPairTags($this->_getTypeTag());
         $this->assign('iTypeID', $this->_getTypeID());
         $this->assign('iCityID', $this->_getCityID());
         $this->assign('aCategory', $aCategory);
         $this->assign('aTag', $aTag);
         $this->assign('sUploadUrl', Yaf_G::getConf('upload', 'url'));
         $this->assign('sFileBaseUrl', 'http://' . Yaf_G::getConf('file', 'domain'));
     }
 }
开发者ID:nicevoice,项目名称:yhtx,代码行数:41,代码来源:Index.php

示例2: editAction

 /**
  * 编辑资讯
  *
  * @return boolean
  */
 public function editAction()
 {
     if ($this->isPost()) {
         $aNews = $this->_checkData('edit');
         if (empty($aNews)) {
             return null;
         }
         $sAction = '保存';
         if ($this->getParam('iOptype') > 0) {
             $aNews['iPublishStatus'] = 1;
             //发布需要将该字段改为1
             $sAction = '发布';
         }
         $aNews['iNewsID'] = intval($this->getParam('iNewsID'));
         //修改需要加上当前修改人ID
         $aCurrUserInfo = $this->aCurrUser;
         $aNews['iUpdateUserID'] = $aCurrUserInfo['iUserID'];
         if (1 == Model_News::updData($aNews)) {
             return $this->showMsg(['sMsg' => '资讯信息' . $sAction . '成功!', 'iNewsID' => $aNews['iNewsID']], true);
         } else {
             return $this->showMsg('资讯信息' . $sAction . '失败!', false);
         }
     } else {
         $this->_response->setHeader('Access-Control-Allow-Origin', '*');
         $iNewsID = intval($this->getParam('id'));
         $aNews = Model_News::getDetail($iNewsID);
         /**
                     Model_News::changeNewsLouName($aNews);
                     print_r($aNews);
                     die
         */
         if ($aNews['sTag']) {
             $aNews['aTag'] = explode(',', $aNews['sTag']);
         }
         if ($aNews['iAuthorID'] == 0) {
             //处理老数据的作者问题
             $aAuthor = Model_Author::getAll(['where' => ['sAuthorName' => $aNews['sAuthor']]]);
             if ($aAuthor) {
                 foreach ($aAuthor as $author) {
                     $aNews['iAuthorID'] = $author['iAuthorID'];
                     if ($author['iCityID'] == $aNews['iCityID']) {
                         break;
                     }
                 }
             }
         }
         $this->assign('aNews', $aNews);
         $aCategory = Model_Category::getPairCategorys($this->_getTypeCategory());
         $aTag = $this->_getTagList();
         //Model_Tag::getPairTags($this->_getTypeTag());
         $aLoupan = Model_CricUnit::getLoupanNames($aNews['sLoupanID']);
         $this->assign('iTypeID', $this->_getTypeID());
         $this->assign('iCityID', $this->_getCityID());
         $this->assign('aCategory', $aCategory);
         $this->assign('aTag', $aTag);
         $this->assign('aLoupan', $aLoupan);
         $this->assign('sUploadUrl', Yaf_G::getConf('upload', 'url'));
         $this->assign('sFileBaseUrl', 'http://' . Yaf_G::getConf('file', 'domain'));
     }
 }
开发者ID:nicevoice,项目名称:yhtx,代码行数:65,代码来源:Index.php


注:本文中的Model_Category::getPairCategorys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。