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


PHP Organization::find方法代码示例

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


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

示例1: signup

 /**
  * Signup a new account with the given parameters
  *
  * @param  array $input Array containing 'username', 'email' and 'password'.
  *
  * @return  User User object that may or may not be saved successfully. Check the id to make sure.
  */
 public function signup($input)
 {
     // $name = array_get($input, 'organization');
     $org = new Organization();
     $lcode = $org->encode($name);
     $organization = Organization::find(array_get($input, 'organization_id'));
     $organization->licensed = 100;
     $organization->license_code = $lcode;
     $organization->update();
     $user = new User();
     $user->username = array_get($input, 'username');
     $user->email = array_get($input, 'email');
     $user->password = array_get($input, 'password');
     $user->user_type = array_get($input, 'user_type');
     $user->username = array_get($input, 'username');
     $user->organization_id = '1';
     // The password confirmation will be removed from model
     // before saving. This field will be used in Ardent's
     // auto validation.
     $user->password_confirmation = array_get($input, 'password_confirmation');
     // Generate a random confirmation code
     $user->confirmation_code = md5(uniqid(mt_rand(), true));
     // Save if valid. Password field will be hashed before save
     $this->save($user);
     return $user;
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:33,代码来源:UserRepository.php

示例2: balanceSheet

 public static function balanceSheet($date)
 {
     $accounts = Account::all();
     $organization = Organization::find(1);
     $pdf = PDF::loadView('pdf.financials.balancesheet', compact('accounts', 'date', 'organization'))->setPaper('a4')->setOrientation('potrait');
     return $pdf->stream('Balance Sheet.pdf');
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:7,代码来源:Account.php

示例3: stock

 public function stock()
 {
     $items = Item::all();
     $organization = Organization::find(1);
     $pdf = PDF::loadView('erpreports.stockReport', compact('items', 'organization'))->setPaper('a4')->setOrientation('potrait');
     return $pdf->stream('Stock Report.pdf');
 }
开发者ID:arapmelly,项目名称:xaraerp,代码行数:7,代码来源:ErpReportsController.php

示例4: getOrgDocs

 public function getOrgDocs($id)
 {
     $organization = Organization::find($id);
     $user = Organization::find($id)->user();
     $documents = User::find($organization->user->id)->documents;
     return View::make('inspector.documents_view', ['organization' => $organization, 'user' => $user, 'documents' => $documents]);
 }
开发者ID:alexsynarchin,项目名称:Itnk,代码行数:7,代码来源:OssController.php

示例5: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $organization = Organization::find($id);
     $organization->delete();
     Session::flash('successMessage', 'Your delete was successful.');
     return Redirect::action('OrganizationsController@index');
 }
开发者ID:thehelpster,项目名称:helpster,代码行数:13,代码来源:OrganizationsController.php

示例6: payments

 public function payments()
 {
     $payments = Payment::all();
     $erporders = Erporder::all();
     $erporderitems = Erporderitem::all();
     $organization = Organization::find(1);
     $pdf = PDF::loadView('erpreports.paymentsReport', compact('payments', 'erporders', 'erporderitems', 'organization'))->setPaper('a4')->setOrientation('potrait');
     return $pdf->stream('Payment List.pdf');
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:9,代码来源:ErpReportsController.php

示例7: edit

 public function edit($id)
 {
     $organization = Organization::find($id);
     if (!Auth::user()->hasPermissionTo('edit', $organization)) {
         Session::put('status', 'error');
         Session::put('message', 'You do not have permission to edit this organization!');
         return Redirect::to('organization/' . $organization->id);
     } elseif (Input::has('_token')) {
         return $this->save($organization, array_except(Input::all(), '_token'));
     } else {
         return View::make('organization.edit', array('organization' => $organization));
     }
 }
开发者ID:omusico,项目名称:lafayettehelps.com,代码行数:13,代码来源:OrganizationController.php

示例8: postUpdate

 /**
  *
  **/
 public function postUpdate()
 {
     $organization = Organization::find(Input::get('id'));
     $organization->name = Input::get('name');
     $file = Input::file('image');
     if ($file != null) {
         $upload_success = Input::file('image')->move('public/uploads', $file->getClientOriginalName());
         $organization->logo = $file->getClientOriginalName();
     }
     $organization->address = Input::get('address');
     $organization->webPage = Input::get('webPage');
     $organization->save();
     return Redirect::to('organization/edit')->with('message', 'Registro actualizado con exito');
 }
开发者ID:josimarjimenez,项目名称:architects,代码行数:17,代码来源:OrganizationsController.php

示例9: addAction

 public function addAction($f3)
 {
     $data = json_decode($f3->get('BODY'));
     //allows to use one loop for both array and object input
     if (!is_array($data)) {
         $data = array($data);
     }
     $organization = new Organization();
     $is_error = false;
     $message = "";
     $result = array();
     foreach ($data as $item) {
         //create the data in local DB only if it is created in the API
         //attention - id's do not match
         $res = $this->checkDuplicateNamesLocal($item);
         if (max(array_count_values($res)) > 1) {
             $is_error = true;
             $message = "Your request data contains duplicate customer names";
             continue;
         }
         //if first step pass - check if new items already exist in database
         //(could be optimized into one query using IN() operator, depending on real data purpose )
         foreach ($res as $item2) {
             $organization->find(array('name = ?', $item2));
             if ($organization->loaded()) {
                 $is_error = true;
                 $message = "Organization {$organization->name} already added to the database";
                 continue;
             }
         }
         if (!$this->createAPIOrganizationRecursive($item)) {
             $is_error = true;
             $message = "Error while adding organization tree to the pipedrive API";
             continue;
         }
         $this->createOrganizationRecursive($item, $result);
     }
     if ($is_error) {
         $f3->set('content', $this->errorResponse($message));
     } else {
         $f3->set('content', $this->successResponse($result));
     }
 }
开发者ID:koza4ok,项目名称:pipedrive,代码行数:43,代码来源:organizations_controller.php

示例10: addNote

 public function addNote()
 {
     $user_id = Input::get('user_id');
     $org_id = Input::get('org_id');
     $body = Input::get('body');
     $flag = Input::get('flag');
     $user = User::find($user_id);
     $org = Organization::find($org_id);
     if (!$user or !$org) {
         err('Something went wrong with your submission');
         return Redirect::back();
     }
     if (!me()->isOrgAdmin($org)) {
         err('You do not have permission to leave organizational notes for that organization');
         return Redirect::back();
     }
     $note = new OrganizationNote();
     $note->organization_id = $org_id;
     $note->body = $body;
     $user->notes()->save($note);
     msg('Note left successfully');
     return Redirect::back();
 }
开发者ID:omusico,项目名称:lafayettehelps.com,代码行数:23,代码来源:UserController.php

示例11: getUserOrganization

 public static function getUserOrganization()
 {
     $organization_id = 1;
     $organization = Organization::find($organization_id);
     return $organization;
 }
开发者ID:kenkode,项目名称:xpose,代码行数:6,代码来源:Organization.php

示例12: postCalcDocs

 public function postCalcDocs($id)
 {
     $user = User::find($id);
     $documents = User::find($id)->documents;
     $sum_org_movables_carrying_amount = 0;
     $sum_org_value_movables_carrying_amount = 0;
     $sum_org_buildings_carrying_amount = 0;
     $sum_org_parcels_carrying_amount = 0;
     $sum_org_movables_residual_value = 0;
     $sum_org_value_movables_residual_value = 0;
     $sum_org_buildings_residual_value = 0;
     $sum_org_cars_carrying_amount = 0;
     $sum_org_cars_residual_value = 0;
     foreach ($documents as $document) {
         $type = $document->os_type;
         $items = Document::find($document->id)->items;
         $sum_carrying_amount = 0;
         $sum_residual_value = 0;
         foreach ($items as $item) {
             if (isset($item->carrying_amount)) {
                 $sum_carrying_amount = $sum_carrying_amount + $item->carrying_amount;
             } else {
                 $sum_carrying_amount = $sum_carrying_amount;
             }
             if ($type != 'parcels') {
                 $variable = Item::find($item->id)->variable;
                 if (isset($variable->residual_value)) {
                     $sum_residual_value = $sum_residual_value + $variable->residual_value;
                 }
                 $sum_residual_value = $sum_residual_value;
             }
         }
         $document->doc_carrying_amount = $sum_carrying_amount;
         if ($type != 'parcels') {
             $document->doc_residual_value = $sum_residual_value;
         }
         $document->save();
         if ($type == 'movables') {
             $sum_org_movables_carrying_amount = $sum_org_movables_carrying_amount + $document->doc_carrying_amount;
             $sum_org_movables_residual_value = $sum_org_movables_residual_value + $document->doc_residual_value;
         }
         if ($type == 'value_movables') {
             $sum_org_value_movables_carrying_amount = $sum_org_value_movables_carrying_amount + $document->doc_carrying_amount;
             $sum_org_value_movables_residual_value = $sum_org_value_movables_residual_value + $document->doc_residual_value;
         }
         if ($type == 'cars') {
             $sum_org_cars_carrying_amount = $sum_org_cars_carrying_amount + $document->doc_carrying_amount;
             $sum_org_cars_residual_value = $sum_org_cars_residual_value + $document->doc_residual_value;
         }
         if ($type == 'buildings') {
             $sum_org_buildings_carrying_amount = $sum_org_buildings_carrying_amount + $document->doc_carrying_amount;
             $sum_org_buildings_residual_value = $sum_org_buildings_residual_value + $document->doc_residual_value;
         }
         if ($type == 'parcels') {
             $sum_org_parcels_carrying_amount = $sum_org_parcels_carrying_amount + $document->doc_carrying_amount;
         }
     }
     $organization_id = $user->organization_id;
     $organization = Organization::find($organization_id);
     $organization->org_movables_carrying_amount = $sum_org_movables_carrying_amount;
     $organization->org_value_movables_carrying_amount = $sum_org_value_movables_carrying_amount;
     $organization->org_cars_carrying_amount = $sum_org_cars_carrying_amount;
     $organization->org_buildings_carrying_amount = $sum_org_buildings_carrying_amount;
     $organization->org_parcels_carrying_amount = $sum_org_parcels_carrying_amount;
     $organization->org_movables_residual_value = $sum_org_movables_residual_value;
     $organization->org_value_movables_residual_value = $sum_org_value_movables_residual_value;
     $organization->org_buildings_residual_value = $sum_org_buildings_residual_value;
     $organization->org_cars_residual_value = $sum_org_cars_residual_value;
     $organization->org_carrying_amount = $organization->org_movables_carrying_amount + $organization->org_value_movables_carrying_amount + $organization->org_buildings_carrying_amount + $organization->org_parcels_carrying_amount;
     $organization->org_residual_value = $organization->org_movables_residual_value + $organization->org_value_movables_residual_value + $organization->org_buildings_residual_value;
     $organization->save();
     return Redirect::action('AdminController@getOrgDocs', [$organization_id]);
 }
开发者ID:alexsynarchin,项目名称:Itnk,代码行数:73,代码来源:AdminController.php

示例13: importCampaigns

 /**
  * Process the Meta table for campaign urls and create the
  * campaign from the corresponding URL
  */
 protected function importCampaigns()
 {
     $metas = \Meta::all(['prop = ?' => 'campImport']);
     $users = [];
     $orgs = [];
     foreach ($metas as $m) {
         $user = Usr::find($users, $m->propid, ['_id', 'org_id', 'email', 'meta']);
         $org = \Organization::find($orgs, $user->org_id);
         $categories = \Category::all(['org_id' => $org->_id], ['_id', 'name']);
         $categories = array_values($categories);
         $category = $categories[array_rand($categories)];
         // fetch ad info foreach URL
         $advert_id = $m->value['advert_id'];
         $comm = $m->value['campaign'] ?? $org->meta;
         if (!isset($comm['model']) || !isset($comm['rate'])) {
             continue;
         }
         $urls = $m->value['urls'];
         foreach ($urls as $url) {
             $ad = \Ad::first(['org_id' => $org->_id, 'url' => $url]);
             if ($ad) {
                 continue;
             }
             // already crawled URL may be due to failed cron earlier
             $data = Utils::fetchCampaign($url);
             $image = Utils::downloadImage($data['image']);
             if (!$image) {
                 $image = '';
             }
             $ad = new \Ad(['user_id' => $advert_id, 'org_id' => $org->_id, 'title' => $data['title'], 'description' => $data['description'], 'url' => $url, 'image' => $image, 'category' => [$category->_id], 'type' => 'article', 'live' => false, 'device' => ['ALL']]);
             if ($ad->validate()) {
                 $ad->save();
                 $rev = $comm['revenue'] ?? 1.25 * (double) $comm['rate'];
                 $commission = new \Commission(['ad_id' => $ad->_id, 'model' => $comm['model'], 'rate' => $comm['rate'], 'revenue' => round($rev, 6), 'coverage' => ['ALL']]);
                 $commission->save();
             } else {
                 var_dump($ad->getErrors());
             }
         }
         $msg = 'Campaigns imported for the user: ' . $user->email;
         $this->log($msg);
         $m->delete();
     }
 }
开发者ID:vNative,项目名称:vnative,代码行数:48,代码来源:cron.php

示例14: financials

 public function financials()
 {
     $report = Input::get('report_type');
     $date = Input::get('date');
     $accounts = Account::all();
     $organization = Organization::find(1);
     if ($report == 'balancesheet') {
         $pdf = PDF::loadView('pdf.financials.balancesheet', compact('accounts', 'date', 'organization'))->setPaper('a4')->setOrientation('potrait');
         return $pdf->stream('Balance Sheet.pdf');
     }
     if ($report == 'income') {
         $pdf = PDF::loadView('pdf.financials.incomestatement', compact('accounts', 'date', 'organization'))->setPaper('a4')->setOrientation('potrait');
         return $pdf->stream('Income Statement.pdf');
     }
     if ($report == 'trialbalance') {
         $pdf = PDF::loadView('pdf.financials.trialbalance', compact('accounts', 'date', 'organization'))->setPaper('a4')->setOrientation('potrait');
         return $pdf->stream('Trial Balance.pdf');
     }
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:19,代码来源:ReportsController.php

示例15: array

            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:
            $object = '';
    }
    return Response::json($object);
}));
Route::post('{object_name}/search/json', array('as' => 'search', function ($object_name) {
    if (!Input::has('query')) {
        return Response::json(array());
    }
    $query = Input::get('query', '');
    $query = '%' . str_replace(' ', '%', $query) . '%';
    switch ($object_name) {
        case 'user':
            $results = User::where('email', 'LIKE', $query)->orWhere('first_name', 'LIKE', $query)->get()->toArray();
开发者ID:omusico,项目名称:lafayettehelps.com,代码行数:31,代码来源:routes.php


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