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


PHP Executor::model方法代码示例

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


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

示例1: buildLeads

 public function buildLeads()
 {
     $leads = array();
     $keywords = Keyword::model()->findAll('deleted_at IS NULL AND status = \'' . Keyword::STATUS_CHECKED . '\'');
     foreach ($keywords as $k) {
         $domain = '';
         $executorCriteria = new CDbCriteria();
         $executorCriteria->addCondition('keyword_id = :keyword_id');
         $executorCriteria->addCondition('status = :status');
         $executorCriteria->params = array(':keyword_id' => $k->id, ':status' => Executor::STATUS_DONE);
         $executorCriteria->order = 'id DESC';
         $executor = Executor::model()->find($executorCriteria);
         if ($executor) {
             $site = Site::model()->findAll('executor_id = :executor_id', array(':executor_id' => $executor->id));
             $domain .= $site[0]->domain;
         } else {
             $domain = 'This task has never been checked';
         }
         array_push($leads, array('id' => $k->id, 'keyword' => $k->name, 'domain' => strlen($domain) > 0 ? $domain : 'No results ' . $executor->id, 'search_engine' => $k->search_engine, 'updated' => $executor->deleted_at));
     }
     return new CArrayDataProvider($leads, array('sort' => array('attributes' => array('*')), 'pagination' => array('pageSize' => 50)));
 }
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:22,代码来源:Keyword.php

示例2: getActiveSearchEngines

 public static function getActiveSearchEngines()
 {
     $currentExecutors = Executor::model()->findAll('deleted_at IS NULL');
     $activeSearchEngines = array();
     foreach ($currentExecutors as $e) {
         if (!$e->keyword_id) {
             continue;
         }
         $searchEngnie = '';
         if ($dotPos = strpos($e->keyword->search_engine, '.')) {
             $searchEngnie = substr($e->keyword->search_engine, 0, $dotPos);
         } else {
             $searchEngnie = $e->keyword->search_engine;
         }
         if (!in_array($searchEngnie, $activeSearchEngines)) {
             $activeSearchEngines[] = $searchEngnie;
         }
     }
     return $activeSearchEngines;
 }
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:20,代码来源:Executor.php

示例3: array

<?php

/* @var $this SiteController */
$this->pageTitle = Yii::app()->name;
?>

<p>Tasks done: <?php 
echo Executor::model()->count('status = \'' . Executor::STATUS_DONE . '\'');
?>
</p>
<p>Tasks in total: <?php 
echo Executor::model()->count();
?>
</p>
<p>Pending keywords: <?php 
echo Keyword::model()->count('status = \'' . Keyword::STATUS_PENDING . '\'');
?>
</p>

<h3>Active Executors</h3>

<div>
    <?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'grvKeywords', 'dataProvider' => $executor->searchActive(), 'htmlOptions' => array(), 'columns' => array(array('name' => 'id', 'header' => 'ID', 'value' => function ($e) {
    return $e->id;
}), array('name' => 'keyword_id', 'header' => 'Keyword', 'value' => function ($e) {
    return String::build('{keyword_id}: {keyword}', array('keyword' => $e->keyword->name, 'keyword_id' => $e->keyword_id));
}), array('header' => 'Search Engine', 'value' => function ($e) {
    return ucwords($e->keyword->search_engine);
}), array('name' => 'status', 'header' => 'Status', 'value' => function ($e) {
    return ucwords($e->status);
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:31,代码来源:statistics.php

示例4: actionTerminateExecutor

 public function actionTerminateExecutor($executorId)
 {
     $executor = Executor::model()->findByPk($executorId);
     $executor->stop();
     $this->redirect(Yii::app()->createUrl('site/statistics'));
 }
开发者ID:evgeniys-hyuna,项目名称:leadsite,代码行数:6,代码来源:SiteController.php


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