Пример #1
0
 /**
  * 审核失败
  */
 public function istatusAction()
 {
     $iAdID = $this->getParam('id');
     $iPage = max(1, intval($this->getParam('page')));
     $aData = Model_Ad::getList(array('iAdID' => $iAdID), $iPage);
     $this->assign('aData', $aData);
     $this->assign('iAdID', $iAdID);
     $this->setMeta('mcenter_page', array('sTitle' => '审核失败'));
 }
Пример #2
0
 /**
  * 广告列表
  */
 public function listAction()
 {
     $iPage = intval($this->getParam('page'));
     $uWhere = array();
     $aParam = $this->getParams();
     $userid = '';
     if (!empty($aParam['sUserRealName'])) {
         $uWhere['sRealName LIKE'] = '%' . $aParam['sUserRealName'] . '%';
         $data_user = Model_User::getAll(array('where' => $uWhere));
         $useridArr = array();
         foreach ($data_user as $val) {
             if ($val['iUserID'] != '') {
                 $useridArr[] = $val['iUserID'];
             }
         }
         if (count($useridArr) > 0) {
             $userid = implode(',', array_unique($useridArr));
         }
     }
     $aWhere = array();
     if (!empty($aParam['iUserID'])) {
         $aWhere['iUserID'] = $aParam['iUserID'];
     }
     if ($userid != '') {
         $aWhere['iUserID IN'] = $userid;
     }
     if (!empty($aParam['sAdName']) && $aParam['sAdName'] != '') {
         $aWhere['sAdName LIKE'] = '%' . $aParam['sAdName'] . '%';
     }
     if (!empty($aParam['iMediaType']) && $aParam['iMediaType'] != '') {
         $aWhere['iMediaType'] = $aParam['iMediaType'];
     }
     if (!empty($aParam['iAdType']) && $aParam['iAdType'] != '') {
         $aWhere['iAdType'] = $aParam['iAdType'];
     }
     if (!empty($aParam['iPayStatus']) && $aParam['iPayStatus'] != '') {
         $aWhere['iPayStatus'] = $aParam['iPayStatus'];
     }
     if (!empty($aParam['iStatus']) && $aParam['iStatus'] != '') {
         $aWhere['iStatus'] = $aParam['iStatus'];
     } else {
         $aWhere['iStatus IN'] = '1,2,3,4,5';
     }
     $aList = Model_Ad::getList($aWhere, $iPage, 'iStatus asc,iCreateTime desc,iPayStatus asc');
     $useridArr = array();
     foreach ($aList['aList'] as $val) {
         if ($val['iUserID'] != '') {
             $useridArr[] = $val['iUserID'];
         }
     }
     if (count($useridArr) > 0) {
         $whereU = array();
         $whereU['iUserID IN'] = implode(',', array_unique($useridArr));
         $userData = Model_User::getAll(array('where' => $whereU));
         if (count($userData) > 0) {
             $data = array();
             foreach ($userData as $val) {
                 $row = array();
                 $row['iUserID'] = $val['iUserID'];
                 $row['sRealName'] = $val['sRealName'];
                 $data[$val['iUserID']] = $row;
             }
             $this->assign('aData', $data);
         }
     }
     foreach ($aList['aList'] as $key => $val) {
         //媒体类型
         $aList['aList'][$key]['iMoney'] = Model_AdMedia::getDetail($val['iAdID'])['iMoney'];
         if ($val['iMediaType'] == '1') {
             $aList['aList'][$key]['iMediaType'] = '公众号';
         } elseif ($val['iMediaType'] == '2') {
             $aList['aList'][$key]['iMediaType'] = '朋友圈';
         } elseif ($val['iMediaType'] == '3') {
             $aList['aList'][$key]['iMediaType'] = '新浪微博';
         } elseif ($val['iMediaType'] == '4') {
             $aList['aList'][$key]['iMediaType'] = '新闻论坛';
         }
         //广告类型
         if ($val['iAdType'] == '1') {
             $aList['aList'][$key]['iAdType'] = '硬广';
         } elseif ($val['iAdType'] == '2') {
             $aList['aList'][$key]['iAdType'] = '软广';
         } elseif ($val['iAdType'] == '3') {
             $aList['aList'][$key]['iAdType'] = '全部';
         }
         //支付状态
         if ($val['iPayStatus'] == '0') {
             $aList['aList'][$key]['iPayStatus'] = '未付款';
         } elseif ($val['iPayStatus'] == '1') {
             $aList['aList'][$key]['iPayStatus'] = '已付款';
         }
         //状态
         if ($val['iStatus'] == '1') {
             $aList['aList'][$key]['iStatus'] = '待审核';
         } elseif ($val['iStatus'] == '2') {
             $aList['aList'][$key]['iStatus'] = '审核通过';
         } elseif ($val['iStatus'] == '3') {
             $aList['aList'][$key]['iStatus'] = '审核未通过';
         } elseif ($val['iStatus'] == '4') {
             $aList['aList'][$key]['iStatus'] = '完成';
         } elseif ($val['iStatus'] == '5') {
             $aList['aList'][$key]['iStatus'] = '未填写完成';
         }
         //城市
         if ($val['sCityID'] != '') {
             $data_City = Model_City::getAll(array('where' => array('iCityID IN' => $val['sCityID'])));
             $sCityID = '';
             if (count($data_City) > 0) {
                 foreach ($data_City as $val_City) {
                     $sCityID .= ',' . $val_City['sCityName'];
                 }
             }
             $aList['aList'][$key]['sCityID'] = $sCityID;
         }
         //媒体分类
         if ($val['sCatID'] != '') {
             $data_Cat = Model_Domain::getAll(array('where' => array('iAutoID IN' => $val['sCatID'])));
             $sCatID = '';
             if (count($data_Cat) > 0) {
                 foreach ($data_Cat as $val_City) {
                     $sCatID .= ',' . $val_City['sName'];
                 }
             }
             $aList['aList'][$key]['sCatID'] = $sCatID;
         }
     }
     $this->assign('aList', $aList);
     $this->assign('aParam', $aParam);
 }