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


PHP Domain::where方法代码示例

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


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

示例1: attemptDetails

 public function attemptDetails($id)
 {
     $attempt = Attempt::find($id);
     $category = Category::find($attempt->category_id) ? Category::find($attempt->category_id)->name : 'N/A';
     $similar_domains = Domain::where('url', 'LIKE', '%' . $attempt->url . '%')->get();
     return View::make('admin.attempt_details')->with(compact('attempt', 'category', 'similar_domains'));
 }
开发者ID:CalinB,项目名称:web-directory,代码行数:7,代码来源:AdminController.php

示例2: searchAjax

    public function searchAjax()
    {
        $response = '';
        $search_term = trim(e(Input::get('search_term')));
        $domains = Domain::where('status', 1)->where('name', 'LIKE', '%' . $search_term . '%')->orWhere('url', 'LIKE', '%' . $search_term . '%')->orWhere('description', 'LIKE', '%' . $search_term . '%')->take(5)->get(['id', 'name', 'thumb']);
        if (count($domains)) {
            foreach ($domains as $domain) {
                $domain_name = strlen($domain->name) > 30 ? substr($domain->name, 0, 30) . '...' : $domain->name;
                $response .= '<div class="search-box">
					<a class="search-result-row" href="' . Domain::seoURL($domain->id) . '">
						<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5">
							<img class="img img-responsive thumbnail" 
								src="' . URL::asset('assets/thumbs/' . $domain->thumb) . '" alt="site preview" />
						</div>			
						<div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
							' . $domain_name . '	
						</div>	
						<div class="clearfix"></div>
					</a>	
					</div>';
            }
        } else {
            $response .= '<p>' . Lang::get('general.no_results', ['serch_term' => $search_term]) . '</p>';
        }
        print $response;
    }
开发者ID:CalinB,项目名称:web-directory,代码行数:26,代码来源:HomeController.php

示例3: insertSkipDupes

 public static function insertSkipDupes($domains)
 {
     $query = sprintf('INSERT INTO domains (name) VALUES ("%s") ON DUPLICATE KEY UPDATE name=name', implode('"),("', $domains));
     $status = DB::statement($query);
     Domain::where('created_at', '0000-00-00 00:00:00')->update(['created_at' => DB::raw('NOW()')]);
     Domain::where('created_at', '0000-00-00 00:00:00')->update(['updated_at' => DB::raw('NOW()')]);
     return $status;
 }
开发者ID:nch7,项目名称:domain-metrics-checker,代码行数:8,代码来源:Domain.php

示例4: getAdd

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getAdd()
 {
     $users = array();
     if (Auth::user()->status == 2) {
         foreach (User::whereStatus(3)->get() as $user) {
             $users[$user['id']] = $user['username'];
         }
     }
     foreach (explode(",", str_replace(" ", "", Config::get('settings.available_css'))) as $css) {
         $available_css[$css] = $css;
     }
     if (Domain::where('user_id', Auth::user()->id)->count() >= Config::get('settings.domain_limit')) {
         return Output::push(array('path' => 'domain', 'messages' => array('fail' => _('You have reached limit domain'))));
     }
     return View::make('domain.create')->with('users', $users)->with('available_css', $available_css);
 }
开发者ID:digideskio,项目名称:voip-id,代码行数:21,代码来源:DomainController.php

示例5: action_query

 public function action_query($domain)
 {
     $domain = strtolower($domain);
     $index_alpha = Sitemap::get_filters();
     Log::write('check', 'whois: ' . $domain);
     //Cache::forget('whois.'.$domain);
     $whois = Cache::remember('whois.' . $domain, function () use($domain) {
         return new Whois\Whois($domain);
     }, 60 * 24);
     $data = $whois->get_all_data();
     if ($data === 0) {
         $valid = 0;
     } else {
         $valid = $data[0]->valid();
     }
     if (!$valid) {
         return View::make('whois.index')->with('valid', 0)->with('type', 'whois')->with('title', 'WHOIS Search')->with('index_alpha', $index_alpha);
     }
     $data = $whois->email_mask($data);
     $available = $whois->available();
     $domain = $data[sizeof($data) - 1];
     $domain = $domain->get_query_domain();
     $meta = array('title' => '', 'ip' => '');
     if ($valid && !$available) {
         if (!Domain::where('name', '=', $domain)->first()) {
             @Domain::create(array('name' => $domain));
         }
         $meta['title'] = Domain::get_domain_title($domain);
         $ip = gethostbyname($domain);
         if ($ip != $domain) {
             $meta['ip'] = $ip;
         }
     }
     $expires_on = $whois->expires_on();
     $created_on = $whois->created_on();
     $updated_on = $whois->updated_on();
     if (is_numeric(end($data)->get_body())) {
         Cache::forget('whois.' . $domain);
     }
     return View::make('whois.query', array('i' => 1, 'data' => $data, 'meta' => $meta, 'type' => 'whois', 'valid' => $valid, 'domain' => $domain, 'available' => $available, 'expires_on' => $expires_on, 'created_on' => $created_on, 'updated_on' => $updated_on, 'index_alpha' => $index_alpha, 'title' => $domain . '\'s whois info'));
 }
开发者ID:jinguanio,项目名称:whois,代码行数:41,代码来源:whois.php

示例6: approveHandle

 public function approveHandle($id)
 {
     $domain = Domain::find($id);
     $domain->status = 1;
     $domain->save();
     $next_domain = Domain::where('status', 0)->first();
     if ($next_domain) {
         $name = Domain::seoURL($next_domain->id);
         return $this->details($name, $next_domain->id);
     }
     return Redirect::route('home')->with('success', 'Yoohoo you\'re done!');
 }
开发者ID:CalinB,项目名称:web-directory,代码行数:12,代码来源:DomainsController.php

示例7: foreach

<?php

echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:xhtml="http://www.w3.org/1999/xhtml">
<?php 
$domains = Domain::where('status', 1)->orderBy('updated_at', 'DESC')->get(['id', 'updated_at']);
if ($domains) {
    foreach ($domains as $domain) {
        $ro_url = LaravelLocalization::getLocalizedURL('ro', Domain::seoURL($domain->id), 'ro');
        $en_url = LaravelLocalization::getLocalizedURL('en', Domain::seoURL($domain->id), 'en');
        ?>
			<url>
				<loc><?php 
        echo $ro_url;
        ?>
</loc>
				<xhtml:link rel="alternate" hreflang="ro" href="<?php 
        echo $ro_url;
        ?>
" />
				<xhtml:link rel="alternate" hreflang="en" href="<?php 
        echo $en_url;
        ?>
" />
				<priority>1</priority>
				<lastmod><?php 
        echo date('c', strtotime($domain->updated_at));
        ?>
</lastmod>
开发者ID:CalinB,项目名称:web-directory,代码行数:31,代码来源:sitemap.blade.php

示例8: trans

				{{ $format_anchor($last_visited->name) }}
			</a>
		</p>	
		<p>{{ trans('directory.domains_statistics_all') }}: {{ count(Domain::all()) }}</p>		
		<p>{{ trans('directory.pending_domains') }}: {{ count(Domain::where('status', 0)->get()) }}</p>
		<p>{{ trans('directory.categories') }}: {{ count(Category::all()) }}</p>
	</div>
	<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
		<?php 
$prefered_domain = Domain::where('status', 1)->where('created_at', '>', \Carbon\Carbon::today())->orderBy('created_at')->first();
//		if('5.2.200.90' == $_SERVER['REMOTE_ADDR'])
//		{
//			var_dump($prefered_domain->name);
//		}
if (!$prefered_domain) {
    $prefered_domain = Domain::where('status', 1)->orderBy('created_at', 'DESC')->first();
}
?>
		<h4>Promovat</h4>
		<a class="a-no-dec" href="{{ Domain::seoURL($prefered_domain->id) }}">
			<div class="weekly-promoted">	
				<p>{{ $prefered_domain->name }}</p>
				<p class="grey">{{ substr($prefered_domain->description, 0, 150) }} {{ trans('general.more') }}</p>
			</div>	
		</a>	
	</div>	
	<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
		Copyright &copy; {{ date('Y'), '&nbsp;', Lang::get('general.main-url') }}		
	</div>	
	<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
		<a href="{{ URL::route('terms') }}">{{ trans('general.terms') }}</a>
开发者ID:CalinB,项目名称:web-directory,代码行数:31,代码来源:footer.blade.php

示例9: _e

<?php

include __DIR__ . '/../start.php';
use Illuminate\Database\Capsule\Manager as DB;
$total = Domain::count();
$totalCompleted = Domain::where('status', 'finished')->count();
$page = isset($_GET['page']) == true ? $_GET['page'] : 1;
$perPage = 100;
$totalPages = floor($total / $perPage);
$sortBy = isset($_GET['sortBy']) == true ? $_GET['sortBy'] : 'tf';
$sortType = isset($_GET['sortType']) == true ? $_GET['sortType'] : 'desc';
$domains = Domain::take($perPage)->skip($perPage * ($page - 1))->orderBy($sortBy, $sortType)->get();
$newSortType = $sortType == 'desc' ? 'asc' : 'desc';
?>

<!DOCTYPE html>
<html>
	<head>
		<title>Domain Metrics Checker</title>
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
		<link rel="stylesheet" href="assets/style.css">
	</head>
	<body>
		<?php 
include __DIR__ . '/menu.php';
?>
		<div class='container'>
			<div class='clearfix'>
				<h2 class='pull-left'>Total <?php 
echo _e($total);
开发者ID:nch7,项目名称:domain-metrics-checker,代码行数:31,代码来源:index.php

示例10: function

        Route::get('domains/pending', ['as' => 'domains-pending', 'uses' => 'AdminController@getPendingDomains']);
        Route::get('domains/attempts', ['as' => 'domains-attempts', 'uses' => 'AdminController@getAttempts']);
        Route::get('attempt/{id}', ['as' => 'attempt.details', 'uses' => 'AdminController@attemptDetails']);
        Route::get('attempt-add/{id}', ['as' => 'attempt.add', 'uses' => 'AdminController@attemptAdd']);
        Route::get('attempt/delete/{id}', ['as' => 'attempt.delete', 'uses' => 'AdminController@attemptDelete']);
        Route::get('comments-all', ['before' => 'auth', 'uses' => 'AdminController@allComments', 'as' => 'comments-all']);
    });
});
Route::post('vote', ['as' => 'vote.site', 'uses' => 'DomainsController@vote']);
Route::get('get/site/votes/{type}/{id}', ['as' => 'get.site.votes', function ($type, $id) {
    return Domain::find($id)->{$type};
}]);
Route::post('search', ['as' => 'search.post', 'uses' => 'HomeController@searchAjax']);
Route::get('generate-sitemap', function () {
    ini_set('memory_limit', '2048M');
    $domains = Domain::where('status', 1)->get(['id', 'updated_at']);
    $categories = Category::where('status', 1)->get(['path', 'updated_at']);
    $langs = LaravelLocalization::getSupportedLocales();
    // create new sitemap object
    $sitemap = App::make("sitemap");
    // set cache (key (string), duration in minutes
    // (Carbon|Datetime|int), turn on/off (boolean))
    // by default cache is disabled
    //$sitemap->setCache('laravel.sitemap', 3600);
    $i = 0;
    $ci = 0;
    foreach ($domains as $domain) {
        $translations = array(array('url' => LaravelLocalization::getLocalizedURL('ro', Domain::seoURL($domain->id), 'ro'), 'language' => 'ro'), array('url' => LaravelLocalization::getLocalizedURL('en', Domain::seoURL($domain->id), 'en'), 'language' => 'en'));
        foreach ($langs as $lang_code => $lang_details) {
            $sitemap->add(LaravelLocalization::getLocalizedURL($lang_code, Domain::seoURL($domain->id)), date('c', strtotime($domain->updated_at)), 1.0, 'daily', null, null, $translations);
        }
开发者ID:CalinB,项目名称:web-directory,代码行数:31,代码来源:routes.php

示例11: Bot

<?php

include __DIR__ . '/../../start.php';
use Illuminate\Database\Capsule\Manager as DB;
$config = (include __DIR__ . '/../../config/bots.php');
$bot = new Bot($config['majestic']['cookie']);
if (!isset($argv[1]) or !($domainList = json_decode($argv[1]))) {
    die('Invalid argument!' . PHP_EOL);
}
$domains = [];
foreach ($domainList as $key => $domain) {
    $domains[$domain->name] = $domain->id;
    $domainList[$key] = $domain->name;
}
$results = $bot->check($domainList);
foreach ($results as $name => $metrics) {
    if (isset($domains[$name]) && isset($metrics['tf']) && isset($metrics['cf']) && $metrics['tf'] >= 0 && $metrics['cf'] >= 0) {
        if ($metrics['niche'] == '') {
            $metrics['niche'] = 'N/A';
        }
        Domain::where('id', $domains[$name])->update(['tf' => $metrics['tf'], 'cf' => $metrics['cf'], 'rd' => $metrics['rd'], 'tf' => $metrics['tf'], 'topical' => $metrics['niche'], 'status' => 'finished']);
    }
}
echo PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL . 'Finish' . PHP_EOL;
开发者ID:nch7,项目名称:domain-metrics-checker,代码行数:24,代码来源:worker.php

示例12: _getUserId

 private function _getUserId($email)
 {
     $domain = Domain::where('domain', Request::getHttpHost())->first();
     $user = User::where('email', $email)->where('domain_id', $domain['id'])->first();
     return $user['id'];
 }
开发者ID:digideskio,项目名称:voip-id,代码行数:6,代码来源:PasswordController.php

示例13: getFilterori

 public function getFilterori()
 {
     if (Request::segment(2) == 'filter') {
         $input = Session::get('search') && !Input::get('search_category') ? Session::get('search') : Input::only(array('search_category', 'search_keyword'));
         switch ($input['search_category']) {
             case '0':
                 return Redirect::to('domain');
                 break;
             case 'owner':
                 $domains = Domain::whereHas('user', function ($q) {
                     $q->where('username', 'LIKE', '%' . Input::get('search_keyword') . '%');
                 })->get();
                 break;
             default:
                 if (Auth::user()->status == 2) {
                     $domains = Domain::where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
                 } else {
                     $domains = Domain::where('user_id', Auth::user()->id)->where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
                 }
                 break;
         }
         Session::set('search', $input);
     } else {
         Session::remove('search');
         $input = array('search_category' => '', 'search_keyword' => '');
         $domains = Auth::user()->status == 2 ? Domain::all() : Domain::where('user_id', Auth::user()->id)->get();
     }
     return View::make('domain.index')->with('domains', $domains)->with('selected', $input);
 }
开发者ID:digideskio,项目名称:voip-id,代码行数:29,代码来源:CallDetailReportsController.php

示例14: _getDomainsId

 private function _getDomainsId($user_id)
 {
     if (Domain::where('user_id', $user_id)->exists()) {
         $domains = Domain::where('user_id', $user_id)->get(['id']);
         $domains_temp = $domains->toArray();
         $domainids = [];
         foreach ($domains_temp as $doms) {
             array_push($domainids, $doms['id']);
         }
         return $domainids;
     } else {
         return false;
     }
 }
开发者ID:digideskio,项目名称:voip-id,代码行数:14,代码来源:ApiController.php


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