Beispiel #1
0
 /**
  * 执行Action后的操作
  *
  * @see Yaf_Controller::actionAfter()
  */
 public function actionAfter()
 {
     if ($this->autoRender() == true) {
         $aDebug = Util_Common::getDebugData();
         if ($aDebug) {
             $this->assign('__showDebugInfo__', 'showDebugInfo(' . json_encode($aDebug) . ');');
         }
         $this->assign('_iMediaTotal', Model_Media::getCnt(array('where' => array('iStatus' => 1))));
         $this->assign('_iYAdTotal', Model_Ad::getYesterdayAdCnt());
         $this->assign('_iYUserTotal', Model_Ad::getYesterdayUserCnt());
         if (empty($this->aCurrUser)) {
             $this->aCurrUser = $this->getCurrUser(Model_User::TYPE_AD, false);
             if (empty($this->aCurrUser)) {
                 $this->aCurrUser = $this->getCurrUser(Model_User::TYPE_MEDIA, false);
             }
         }
         $this->assign('_aCurrUser', $this->aCurrUser);
     } else {
     }
 }
Beispiel #2
0
 /**
  * 检测是否存在
  */
 public function checkAction()
 {
     $iMediaType = (int) $this->getParam('iMediaType');
     $sField = $this->getParam('field');
     $sValue = $this->getParam('value');
     $aErr['sOpenName'] = '该自媒体名已经存在!';
     $aErr['sMediaName'] = '该自媒体账号已经存在!';
     if (!isset($aErr[$sField])) {
         $this->showMsg('操作错误!', false);
     }
     $iCnt = Model_Media::getCnt(array($sField => $sValue, 'iMediaType' => $iMediaType, 'iStatus !=' => 0));
     if ($iCnt > 0) {
         return $this->showMsg($aErr[$sField], false);
     } else {
         return $this->showMsg('OK', true);
     }
 }