Exemplo n.º 1
0
 /**
  * 自媒体列表
  */
 public function listAction()
 {
     $iPage = intval($this->getParam('page'));
     $aWhere = array();
     $aParam = $this->getParams();
     if (!empty($aParam['iUserID'])) {
         $aWhere['iUserID'] = $aParam['iUserID'];
     }
     if (!empty($aParam['iMediaType'])) {
         $aWhere['iMediaType'] = $aParam['iMediaType'];
     }
     if (!empty($aParam['sMediaName'])) {
         $aWhere['sMediaName LIKE'] = '%' . $aParam['sMediaName'] . '%';
     }
     if (!empty($aParam['iStatus'])) {
         $aWhere['iStatus'] = $aParam['iStatus'];
     } else {
         $aWhere['iStatus IN'] = '1,2,3';
     }
     if (!empty($aParam['iPut'])) {
         $aWhere['iPut'] = $aParam['iPut'];
     } else {
         $aWhere['iPut IN'] = '0,1';
     }
     $aList = Model_Media::getList($aWhere, $iPage, 'iStatus desc ,iMediaID desc');
     $useridArr = array();
     foreach ($aList['aList'] as $key => $val) {
         if ($val['iUserID'] > 0) {
             $useridArr[] = $val['iUserID'];
         }
     }
     if (count($useridArr) > 0) {
         $sUserid = '';
         $useridArr = array_unique($useridArr);
         $sUserid = implode(',', $useridArr);
         $sUserid = trim($sUserid, ',');
         $userData = Model_User::getAll(array('where' => array('iUserID IN' => $sUserid)));
         if (count($userData) > 0) {
             $data = array();
             foreach ($userData as $key => $value) {
                 $data[$value['iUserID']] = array('iUserID' => $value['iUserID'], 'sEmail' => $value['sEmail']);
             }
             $this->assign('userData', $data);
         }
     }
     $this->assign('aList', $aList);
     $this->assign('MediaType', Model_Media::$aType);
     $this->assign('aParam', $aParam);
 }
Exemplo n.º 2
0
 /**
  * 账号中心
  */
 public function accountAction()
 {
     $iType = max(1, (int) $this->getParam('type'));
     $iPage = max(1, intval($this->getParam('page')));
     $aData = Model_Media::getList(array('iStatus > ' => 0, 'iUserID' => $this->aCurrUser['iUserID'], 'iMediaType' => $iType), $iPage);
     $this->assign('aData', $aData);
     $this->assign('iType', $iType);
     $this->setMeta('mcenter_page', array('sTitle' => '自媒体中心 - 财号中心'));
 }