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


PHP Model_Ad::getAll方法代码示例

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


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

示例1: explodeAction

    /**
     * 导出
     */
    public function explodeAction()
    {
        $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::getAll(array('where', $aWhere));
        foreach ($aList['aList'] as $key => $val) {
            //媒体类型
            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) {
//.........这里部分代码省略.........
开发者ID:pancke,项目名称:yyaf,代码行数:101,代码来源:Adsh.php

示例2: listAction

 /**
  * 资源订单列表
  */
 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;
     }
     $iAdID = '';
     if (!empty($aParam['sAdName'])) {
         $uWhere['sAdName LIKE'] = '%' . $aParam['sAdName'] . '%';
         $data_Ad = Model_Ad::getAll(array('where' => $uWhere));
         $iAdIDArr = array();
         foreach ($data_Ad as $val) {
             if ($val['iAdID'] != '') {
                 $iAdIDArr[] = $val['iAdID'];
             }
         }
         if (count($iAdIDArr) > 0) {
             $iAdID = implode(',', array_unique($iAdIDArr));
         }
     }
     if (!empty($aParam['iAdID'])) {
         $aWhere['iAdID'] = $aParam['iAdID'];
     }
     if ($iAdID != '') {
         $aWhere['iAdID IN'] = $iAdID;
     }
     if (!empty($aParam['iPayStatus']) && $aParam['iPayStatus'] != '') {
         $aWhere['iPayStatus'] = $aParam['iPayStatus'];
     }
     if (!empty($aParam['iStatus']) && $aParam['iStatus'] != '') {
         $aWhere['iStatus'] = $aParam['iStatus'];
     }
     $aList = Model_AdMedia::getList($aWhere, $iPage);
     $iAdIDArr = $useridArr = array();
     foreach ($aList['aList'] as $val) {
         if ($val['iUserID'] != '') {
             $useridArr[] = $val['iUserID'];
         }
         if ($val['iAdID'] != '') {
             $iAdIDArr[] = $val['iAdID'];
         }
     }
     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);
         }
     }
     $data = array();
     if (count($iAdIDArr) > 0) {
         $whereAd = array();
         $whereAd['iAdID IN'] = implode(',', array_unique($iAdIDArr));
         $AdData = Model_Ad::getAll(array('where' => $whereAd));
         if (count($AdData) > 0) {
             foreach ($AdData as $val) {
                 $row = array();
                 $row['iAdID'] = $val['iAdID'];
                 $row['sAdName'] = $val['sAdName'];
                 $row['iMediaType'] = $val['iMediaType'];
                 $data[$val['iAdID']] = $row;
             }
             $this->assign('AdData', $data);
         }
     }
     foreach ($aList['aList'] as $key => $val) {
         $iMediaType = '';
         if (count($data) > 0 && isset($data[$val['iAdID']]['iMediaType']) && $data[$val['iAdID']]['iMediaType'] != '') {
             $iMediaType = $data[$val['iAdID']]['iMediaType'];
//.........这里部分代码省略.........
开发者ID:pancke,项目名称:yyaf,代码行数:101,代码来源:Mediaorder.php


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