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


PHP Organization::all方法代码示例

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


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

示例1: run

 public function run()
 {
     DB::table('todos')->truncate();
     foreach (Organization::all() as $org) {
         Todo::create(['name' => 'First Todo', 'user_id' => $org->users[0]->id, 'organization_id' => $org->id, 'completed' => true]);
         Todo::create(['name' => 'Second Todo', 'user_id' => $org->users[0]->id, 'organization_id' => $org->id]);
         Todo::create(['name' => 'Todo from Second', 'user_id' => $org->users[1]->id, 'organization_id' => $org->id]);
         Todo::create(['name' => 'Third Todo', 'user_id' => $org->users[0]->id, 'organization_id' => $org->id]);
     }
 }
开发者ID:sonico999,项目名称:Multitenant-Apps-in-Laravel,代码行数:10,代码来源:TodoTableSeeder.php

示例2: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     DB::transaction(function () {
         Schema::table('organizations', function (Blueprint $table) {
             $table->string('slug', 255)->nullable()->index();
         });
         foreach (Organization::all() as $org) {
             $org->slug = Str::slug($org->name);
             $org->save();
         }
     });
 }
开发者ID:sonico999,项目名称:Multitenant-Apps-in-Laravel,代码行数:17,代码来源:2014_09_12_005935_AddSlugToOrganizationsTable.php

示例3: run

 public function run()
 {
     DB::table('users')->truncate();
     DB::table('organization_user')->truncate();
     $usernames = ['machuga', 'second', 'third', 'admin'];
     foreach (Organization::all() as $org) {
         foreach ($usernames as $username) {
             $username = $org->isVendor() ? $username : $username . $org->id;
             $user = User::create(['name' => ucfirst($username), 'email' => "{$username}@example.com", 'password' => $username, 'active' => true, 'admin' => starts_with($username, 'admin')]);
             $user->organizations()->attach($org->id);
         }
     }
 }
开发者ID:foxted,项目名称:Multitenant-Apps-in-Laravel,代码行数:13,代码来源:UserTableSeeder.php

示例4: getPlatforms

 /**
  * @test
  */
 public function getPlatforms()
 {
     $orgs = \Organization::all([], ['_id']);
     $results = [];
     foreach ($orgs as $o) {
         $platforms = \Platform::rssFeeds($o);
         $count = count($platforms);
         if ($count === 0) {
             continue;
         }
         $results = array_merge($results, $platforms);
     }
     $this->assertNotEquals(0, count($results));
     return $results;
 }
开发者ID:vNative,项目名称:vnative,代码行数:18,代码来源:RssTest.php

示例5: run

 public function run()
 {
     DB::table('users')->truncate();
     $usernames = ['tonetlds', 'demo', 'admin'];
     foreach (Organization::all() as $org) {
         foreach ($usernames as $username) {
             $username = $username . '-' . $org->name;
             User::create(['organization_id' => $org->id, 'username' => $username, 'email' => $username . '@lucianotonet.com', 'password' => $username, 'password_confirmation' => $username, 'confirmation_code' => NULL, 'remember_token' => NULL, 'confirmed' => TRUE, 'admin' => starts_with($username, 'admin')]);
         }
     }
     // User::create([
     // 	'id' 				=> 1,
     //           'username'          => 'tonetlds',
     //           'email'     		=> 'tonetlds@gmail.com',
     //           'password'          => Hash::make('254608'),
     //           'confirmation_code' => NULL,
     //           'remember_token'    => NULL,
     //           'confirmed'         => 1,
     // ]);
 }
开发者ID:waldenylson,项目名称:alfredapp,代码行数:20,代码来源:UsersTableSeeder.php

示例6: index

 function index()
 {
     $this->organizations = Organization::all();
 }
开发者ID:hugoabonizio,项目名称:BirdsPHP-scaffold,代码行数:4,代码来源:organizations_controller.php

示例7: index

 /**
  * Display a listing of organizations
  *
  * @return Response
  */
 public function index()
 {
     $organizations = Organization::all();
     return View::make('organizations.index', compact('organizations'));
 }
开发者ID:waldenylson,项目名称:alfredapp,代码行数:10,代码来源:OrganizationsController.php

示例8: edit

 function edit()
 {
     $this->user = User::find($this->params('id'));
     $this->organizations = Organization::all();
 }
开发者ID:hugoabonizio,项目名称:GaiaPDTI,代码行数:5,代码来源:users_controller.php

示例9: all

 /**
  * Manages all school registered
  * @before _secure, _school, _admin
  */
 public function all()
 {
     $this->setSEO(array("title" => "All Schools"));
     $view = $this->getActionView();
     $limit = RequestMethods::get("limit", 10);
     $page = RequestMethods::get("page", 1);
     $organizations = Organization::all(array(), array("name", "user_id", "created"), "created", "desc", $limit, $page);
     $view->set("organizations", $organizations);
 }
开发者ID:SwiftSchool,项目名称:School,代码行数:13,代码来源:school.php

示例10: add

 function add()
 {
     $this->organizations = Organization::all();
 }
开发者ID:hugoabonizio,项目名称:BirdsPHP-scaffold,代码行数:4,代码来源:users_controller.php

示例11: popularPackages

 public function popularPackages()
 {
     $this->seo(array("title" => "Popular Packages", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $organizations = Organization::all(array("live = ?" => true), array("id", "name"));
     $limit = RequestMethods::get("limit", 10);
     $page = RequestMethods::get("page", 1);
     $packages = Package::all(array("live = ?" => 1), array("title", "organization_id", "charge", "id"), "created", "desc", $limit, $page);
     $total = (int) Package::count(array("live = ?" => 1));
     $results = array();
     foreach ($packages as $p) {
         $data = array("title" => $p->title, "lab" => $organizations[$p->organization_id]->name, "lab_id" => $p->organization_id, "charge" => $p->charge, "id" => $p->id);
         $results[] = ArrayMethods::toObject($data);
     }
     $view->set("packages", $results)->set("total", $total);
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:16,代码来源:promotion.php

示例12: function

        $credentials['email'] = Input::get('email');
    }
    return Password::reset($credentials, function ($user, $password) {
        $user->setPassword($password);
        $user->save();
        return Redirect::route('login');
    });
});
// JSON VIEWS
Route::get('{object_name}/json', array('as' => 'json', function ($object_name) {
    switch ($object_name) {
        case 'users':
            $object = User::all();
            break;
        case 'organizations':
            $object = Organization::all();
            break;
        default:
            $object = '';
    }
    return Response::json($object);
}));
Route::get('{object_name}/{id}/json', array('as' => 'json', function ($object_name, $id) {
    switch ($object_name) {
        case 'user':
            $object = User::find($id);
            break;
        case 'organization':
            $object = Organization::find($id);
            break;
        default:
开发者ID:omusico,项目名称:lafayettehelps.com,代码行数:31,代码来源:routes.php

示例13: generateBills

 public function generateBills()
 {
     $orgs = Organization::all(["live = ?" => true]);
     foreach ($orgs as $org) {
         $imp_cost = 0;
         $click_cost = 0;
         $month_ini = new DateTime("first day of last month");
         $month_end = new DateTime("last day of last month");
         $start = $month_ini->format('Y-m-d');
         $end = $month_end->format('Y-m-d');
         $dateQuery = Utils::dateQuery(['start' => $start, 'end' => $end]);
         // find advertiser performances to get clicks and impressions
         $performances = \Performance::overall($dateQuery, User::all(['org_id' => $org->_id, 'type' => 'advertiser'], ['_id']));
         $clicks = $performances['total_clicks'];
         if ($clicks > 1000) {
             $click_cost = 0.001 * $clicks * $org->meta["bill"]["tcc"];
         }
         $impressions = $performances['total_impressions'];
         if ($impressions > 100000) {
             $imp_cost = 0.001 * 0.001 * $impressions * $org->meta["bill"]["mic"];
         }
         $total = $click_cost + $imp_cost;
         $bill = new Bill(["org_id" => $org->id, "impressions" => $impressions, "clicks" => $clicks, "mic" => $org->meta["bill"]["mic"], "tcc" => $org->meta["bill"]["tcc"], "start" => $start, "end" => $end, "amount" => $total, "live" => false, "created" => Db::time('-1 day')]);
         if ($total > 1) {
             $bill->save();
             $user = User::first(["org_id = ?" => $org->id, "type = ?" => "admin"]);
             Mail::send(['user' => $user, 'bill' => $bill, 'template' => 'adminBilling', 'subject' => 'Billing at vNative', 'click_cost' => $click_cost, 'imp_cost' => $imp_cost, 'org' => $org]);
         }
     }
 }
开发者ID:vNative,项目名称:vnative,代码行数:30,代码来源:cron.php


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