Exemple #1
0
     if ($this->bCheckLogin) {
         // 当前用户
         $aCookie = Util_Cookie::get(Yaf_G::getConf('authkey', 'cookie'));
         if (empty($aCookie)) {
             return $this->redirect('/admin/login');
         }
         $this->aCurrUser = $aCookie;
         // 当前城市
         $this->iCurrCityID = Util_Cookie::get('city');
         if (empty($this->iCurrCityID)) {
             $this->iCurrCityID = $this->aCurrUser['iCityID'];
         }
         $this->aCurrCity = Model_City::getDetail($this->iCurrCityID);
     }
     $this->assign('sStaticRoot', 'http://' . Yaf_G::getConf('static', 'domain'));
 }
 /**
  * 执行Action后的操作
  * 
  * @see Yaf_Controller::actionAfter()
  */
 public function actionAfter()
 {
     if ($this->autoRender() == true) {
         if (!empty($this->aCurrUser)) {
             $this->assign('aCurrUser', $this->aCurrUser);
Exemple #2
0
 /**
  * 执行Action后的操作
  * @see Yaf_Controller::actionAfter()
  */
 public function actionAfter()
 {
     if ($this->autoRender() == true) {
         if (!empty($this->aCurrUser)) {
         }
         $aDebug = Util_Common::getDebugData();
         if ($aDebug) {
             $this->assign('__showDebugInfo__', 'showDebugInfo(' . json_encode($aDebug) . ');');
         }
     } else {
     }
 }
Exemple #3
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 {
     }
 }
Exemple #4
0
 /**
  * Ajax或API请求时,返回json数据
  * @param unknown $mMsg
  * @param unknown $bRet
  */
 protected function showMsg($mMsg, $bRet)
 {
     $aData = array('data' => $mMsg, 'status' => $bRet);
     $sDebug = Util_Common::getDebugData();
     if ($sDebug) {
         $aData['debug'] = $sDebug;
     }
     $response = $this->getResponse();
     $response->appendBody(json_encode($aData, JSON_UNESCAPED_UNICODE));
     $this->autoRender(false);
     return false;
 }