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


PHP Channel::model方法代码示例

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


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

示例1: getData

 public function getData()
 {
     $view = $this->view;
     $data = array();
     switch ($view) {
         case $view == 'adlist':
             $data = Advertisement::model()->getAdvertisements();
             break;
         case $view == 'channel':
             foreach (Channel::model()->generateChannelList() as $channel => $v) {
                 $data[] = Channel::model()->getChannels(0, $channel);
             }
             break;
         case $view == 'message':
             $data = Advertisement::model()->getValidateAdvertisements(4);
             break;
         case $view == 'register':
             $data = User::model()->findAll(array('order' => 'lastlogin DESC', 'limit' => 10));
             break;
         case $view == 'adrelated':
             $_model = Advertisement::model()->getAdvertisementModel($_GET['id']);
             $data = Advertisement::model()->findAll(array('condition' => 'cid = :cid', 'order' => 'id DESC', 'limit' => 10, 'params' => array(':cid' => $_model->cid)));
             unset($_model);
             break;
         case $view = 'infolist':
             $_model = Advertisement::model()->getAdvertisementModel($_GET['id']);
             $data = Advertisement::model()->findAll(array('condition' => 'uid = :uid', 'order' => 'id DESC', 'limit' => 10, 'params' => array(':uid' => $_model->uid)));
             unset($_model);
             break;
     }
     return $data;
 }
开发者ID:yunsite,项目名称:my-advertise,代码行数:32,代码来源:sidebarWidget.php

示例2: actionAjaxGetChannels

 public function actionAjaxGetChannels()
 {
     $pointId = Yii::app()->request->getPost('pointId');
     $pointDateStr = date('Y-m-d');
     $requestTime = date('H:i:s');
     $pointDatetimeStr = $pointDateStr . " 23:59:59";
     $pointDateTimestamp = strtotime($pointDateStr);
     $weekDay = strtolower(date('D', $pointDateTimestamp));
     $Playlist = new Playlists();
     $pointChannels = Channel::model()->findAll('id_point=:id_point AND window_id IS NOT NULL', array(':id_point' => $pointId));
     $resp = array();
     foreach ($pointChannels as $pointChannel) {
         $pointChannelId = $pointChannel->internalId;
         $windowId = $pointChannel->window_id;
         if (!is_null($windowId)) {
             $bg = $Playlist->GetBGContentArr($pointId, $pointChannelId, $pointDatetimeStr, $weekDay);
             $adv = $Playlist->GetAdvContentArr($pointId, $pointChannelId, $pointDatetimeStr, $weekDay);
             $blockStructedContent = $Playlist->BuildBlockStructedContent($bg, $adv);
             $straightTimeContent = $Playlist->ConverBlockStructedToStraightTimeContent($blockStructedContent);
             $straightTimeContentHisToSecs = $this->ConvertHisToSecsInStraightTime($straightTimeContent, $requestTime);
             $url = Yii::app()->request->getBaseUrl(true) . '/spool/points/' . $pointId . '/' . $pointChannelId;
             $straightTimeContentWithURLPath = $this->UpdateContentPathes($straightTimeContentHisToSecs, $url);
             $window = Window::model()->findByPK($windowId);
             $widgetToChannel = WidgetToChannel::model()->find("channel_id = :channel_id", array("channel_id" => $pointChannel->id));
             $widget = '';
             if (count($widgetToChannel) > 0) {
                 $widgetModel = Widget::model()->findByPk($widgetToChannel['widget_id']);
                 $widget = $widgetModel['content'];
             }
             $resp[] = array('width' => $window->width, 'height' => $window->height, 'top' => $window->top, 'left' => $window->left, 'content' => $straightTimeContentWithURLPath, 'widget' => $widget);
         }
     }
     echo json_encode($resp);
     exit;
 }
开发者ID:AlexanderKosianchuk,项目名称:rtvgroup,代码行数:35,代码来源:PreviewController.php

示例3: actionSearch

 public function actionSearch()
 {
     $channel = Channel::model();
     $channelList = $channel->getAllData();
     foreach ($channelList as $val) {
         $result[] = $val['name'];
     }
     echo json_encode($result);
 }
开发者ID:qyt1988528,项目名称:union,代码行数:9,代码来源:NoticeController.php

示例4: getChannelOptions

 private function getChannelOptions()
 {
     $options = array();
     $criteria = new CDbCriteria();
     $criteria->order = 'ctime desc';
     foreach (Channel::model()->findAll($criteria) as $channel) {
         $options[$channel->id] = $channel->name;
     }
     return $options;
 }
开发者ID:qyt1988528,项目名称:union,代码行数:10,代码来源:UserController.php

示例5: getFormAttributes

 /**
  *
  * 返回组成表单所需要的字段
  *
  */
 public function getFormAttributes()
 {
     $attrs = array();
     foreach (Channel::model()->attributeLabels() as $field => $label) {
         if (!in_array($field, array('id', 'mtime', 'ctime', 'status'))) {
             $attrs[$field] = array('type' => 'input');
         }
     }
     unset($attrs['adv_number']);
     return $attrs;
 }
开发者ID:qyt1988528,项目名称:union,代码行数:16,代码来源:ChannelController.php

示例6: categoryItem

 public function categoryItem($model)
 {
     $id = $model->id;
     echo "<div class=\"" . $category->item . "\">";
     echo "<h4>" . $model->name . "</h4>";
     $item = Channel::model()->getChildrenArray($id);
     $item = Channel::model()->getChannelList($item, $id);
     foreach ($item as $child) {
         $id = $child['id'];
         $nodeType = Channel::model()->nodeType($id);
         self::categoryItemChildren($child, $nodeType);
     }
 }
开发者ID:yunsite,项目名称:my-advertise,代码行数:13,代码来源:Category.php

示例7: getChannelId

 private function getChannelId($name)
 {
     $name = trim($name);
     static $cache = array();
     if (!isset($cache[$name])) {
         $channel = Channel::model()->findByAttributes(array('name' => $name));
         if ($channel == null) {
             $channel = new Channel();
             $channel->name = $name;
             $channel->save();
         }
         $cache[$name] = $channel->id;
     }
     return $cache[$name];
 }
开发者ID:qyt1988528,项目名称:union,代码行数:15,代码来源:ImportCommand.php

示例8: actionMerge

 public function actionMerge()
 {
     $ids = array('100040', '100039', '100022', '100046');
     $adv_data = AdvData::model();
     $advertice_channel = AdvertiseChannel::model();
     $channel = Channel::model();
     foreach ($ids as $channel_id) {
         if ($channel_id != 100046) {
             $adv_data->updateRelatedChannelId(array('channel_id' => 100043), $channel_id);
             $advertice_channel->updateRelatedChannelId(array('channel_id' => 100043), $channel_id);
         } else {
             $adv_data->updateRelatedChannelId(array('channel_id' => 100123), $channel_id);
             $advertice_channel->updateRelatedChannelId(array('channel_id' => 100123), $channel_id);
         }
         $channel->deleteOneRow($channel_id);
     }
 }
开发者ID:qyt1988528,项目名称:union,代码行数:17,代码来源:MergeChannelCommand.php

示例9: array

echo Yii::app()->theme->baseUrl;
?>
/css/index.css"/>
<?php 
$this->renderPartial('//common/banner');
?>
<div class="site-focus" pbid="众筹制造">
    <div class="wrap">
        <div class="mod-title clearfix">
            <h2>众筹项目</h2>
            <div class="title-sub">
                <?php 
#获得项目下的分类项目
$project = Channel::model()->find("cl_en_name=:cl_en_name", array(":cl_en_name" => 'project'));
if ($project) {
    $projectlist = Channel::model()->findAll("cl_class=:cl_class AND cl_status=1 order by cl_left asc ", array(":cl_class" => $project->id));
    if ($projectlist) {
        foreach ($projectlist as $key => $value) {
            echo '<a href="' . Yii::app()->createUrl('/project/' . $value->id) . '" title="' . QCHtml::encode($value->cl_name) . '">' . QCHtml::encode($value->cl_name) . '</a>';
        }
    }
}
?>
                <a href="http://www.10000rmb.com" alt="中国网赚平台" title="中国网赚平台" pbtag="hangye,hangye_zuzhou">中国网赚平台</a>
            </div>
        </div>
        <div class="focus-box" style="overflow:hidden;">
            <ul id="JS-recommend_ul" class="focus-con clearfix" style="width:980px;">
                <!--Deal Card Module-->
                <li>
                    <div class="list-item">
开发者ID:bfyang5130,项目名称:zzl,代码行数:31,代码来源:index.php

示例10: array

                            <span class="sr-only">切换导航</span>
                            <span class="icon-bar qys_icon_bar"></span>
                            <span class="icon-bar qys_icon_bar"></span>
                            <span class="icon-bar qys_icon_bar"></span>
                        </a> 
                    </div>
                    <div class="collapse navbar-collapse" id="top-navbar-collapse">
                        <ul class="nav navbar-nav">
                            <?php 
#获得主菜单
$main_menu = Menu::model()->find("menu_ename='main_menu'");
$main_menu_id = 1;
if ($main_menu) {
    $main_menu_id = $main_menu->menu_id;
}
$mainmenulist = Channel::model()->findAll("cl_menu_id=:menu_id AND cl_status=1 order by cl_left asc", array(":menu_id" => $main_menu_id));
if ($mainmenulist) {
    foreach ($mainmenulist as $key => $value) {
        ?>
                                    <li 
                                    <?php 
        if ($key == 0) {
            echo 'class="active"';
        }
        ?>
>
                                            <?php 
        if ($value->cl_exturl) {
            ?>
                                            <a target="_blank" href="<?php 
            echo $value->cl_exturl;
开发者ID:bfyang5130,项目名称:zzl,代码行数:31,代码来源:html5_top_main.php

示例11: getTableName

 public function getTableName()
 {
     $filters = $this->getFilterCondition();
     $conditions = array();
     if (isset($filters['cp_id'])) {
         $model = CP::model()->findByPk($filters['cp_id']);
         if ($model) {
             $conditions[] = "CP:{$model->name}";
         }
     }
     if (isset($filters['adv_id'])) {
         $model = Advertise::model()->findByPk($filters['adv_id']);
         if ($model) {
             $conditions[] = "业务:{$model->name}";
         }
     }
     if (isset($filters['channel_id'])) {
         $model = Channel::model()->findByPk($filters['channel_id']);
         if ($model) {
             $conditions[] = "渠道:{$model->name}";
         }
     }
     /*2014-11-17包名*/
     if (isset($filters['adv_channel_id'])) {
         $model = AdvertiseChannel::model()->findByPk($filters['adv_channel_id']);
         if ($model) {
             $conditions[] = "包名:{$model->tag}";
         }
     }
     /*end*/
     if (isset($filters['begin_date']) && isset($filters['end_date'])) {
         $conditions[] = "从{$filters['begin_date']}到{$filters['end_date']}";
     }
     if (isset($filters['date'])) {
         $conditions[] = "日期:{$filters['date']}";
     }
     if (count($conditions)) {
         return $this->getTableBaseName() . '-(' . join('-', $conditions) . ')';
     } else {
         return $this->getTableBaseName() . '-全部';
     }
 }
开发者ID:qyt1988528,项目名称:union,代码行数:42,代码来源:ReportController.php

示例12: AddChannelToPoint

 public function AddChannelToPoint($pointId)
 {
     $_pointId = $pointId;
     $model = new Channel();
     $res = Channel::model()->findAll('id_point=:id_point ORDER BY internalId ASC', array(':id_point' => $_pointId));
     $internalId = 1;
     if (count($res) > 0) {
         $internalId = $res[count($res) - 1]['internalId'] + 1;
     }
     $model->attributes = array('id_point' => $_pointId, 'internalId' => $internalId);
     if ($model->validate() && $model->save()) {
         $id = $model->getPrimaryKey();
         return array("status" => true, "id" => $id, "internalId" => $internalId);
     } else {
         return array("status" => false, "error" => json_encode($model->getErrors()));
     }
 }
开发者ID:AlexanderKosianchuk,项目名称:rtvgroup,代码行数:17,代码来源:Channel.php

示例13:

 </div>
     
<div class="content">      
	<div class="panel">      
		<div class="tab_box">
			<?php 
Channel::model()->showCategories(1, false, true, 'channelItem');
?>
		</div> 
		<div class="tab_box">
			<?php 
Channel::model()->showCategories(2, false, true, 'channelItem');
?>
		</div>
		<div class="tab_box">
			<?php 
Channel::model()->showCategories(3, false, true, 'channelItem');
?>
		</div>
		<div class="tab_box">
			<?php 
Channel::model()->showCategories(4, false, true, 'channelItem');
?>
		</div>
  	</div>

</div> 

</div>

开发者ID:yunsite,项目名称:my-advertise,代码行数:29,代码来源:tabs.php

示例14: generatePageTitle

 /**
  * @todo 根据广告ID生成页面标题 
  * @param unknown_type $id
  */
 public function generatePageTitle($id, $isListPage = false)
 {
     $result = array();
     //列表页面
     if ($isListPage) {
         $channel = Channel::model()->findParent($id);
         foreach ($channel as $item) {
             $result[$item['name']] = array('/info/list', 'id' => $item['id'], 't' => urlencode($item['name']));
         }
         $result = array_reverse($result);
     } else {
         $model = self::getAdvertisementModel($id);
         $channel = Channel::model()->findParent($model->cid);
         foreach ($channel as $item) {
             $result[$item['name']] = array('/info/list', 'id' => $item['id'], 't' => urlencode($item['name']));
         }
         $result = array_reverse($result);
         $result[$model->title] = array('/info/view', 'id' => $model->id, 't' => urlencode($model->title));
     }
     //		$ad = array(
     //			'id'=>$model->id,
     //			'pid'=>$model->cid,
     //			'name'=>$model->title
     //		);
     //
     //		array_unshift($result, $ad);
     return $result;
 }
开发者ID:yunsite,项目名称:my-advertise,代码行数:32,代码来源:Advertisement.php

示例15: getChannel

 public static function getChannel($id, $returnType = 'array', $data = null)
 {
     $types = empty($data) ? self::getChannels() : $data;
     return BCacheHelper::find($id, $types, $returnType, Channel::model());
 }
开发者ID:touzilk,项目名称:yii2-advanced,代码行数:5,代码来源:CacheHelper.php


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