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


PHP Currency::remember方法代码示例

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


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

示例1: showSection

 public function showSection($section = ACCOUNT_DETAILS, $subSection = false)
 {
     if ($section == ACCOUNT_DETAILS) {
         $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'timezones' => Timezone::remember(DEFAULT_QUERY_CACHE)->orderBy('location')->get(), 'dateFormats' => DateFormat::remember(DEFAULT_QUERY_CACHE)->get(), 'datetimeFormats' => DatetimeFormat::remember(DEFAULT_QUERY_CACHE)->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'languages' => Language::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'taxRates' => TaxRate::orderBy('name')->get()];
         return View::make('accounts.details', $data);
     } else {
         if ($section == ACCOUNT_NOTIFICATIONS) {
             $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id)];
             return View::make('accounts.notifications', $data);
         } else {
             if ($section == ACCOUNT_IMPORT_EXPORT) {
                 return View::make('accounts.import_export');
             } else {
                 if ($section == ACCOUNT_ADVANCED_SETTINGS) {
                     $data = ['account' => Auth::user()->account, 'feature' => $subSection];
                     return View::make("accounts.{$subSection}", $data);
                 } else {
                     if ($section == ACCOUNT_PRODUCTS) {
                         $data = ['account' => Auth::user()->account];
                         return View::make('accounts.products', $data);
                     } else {
                         if ($section == ACCOUNT_BRANCHES) {
                             $data = ['account' => Auth::user()->account];
                             return View::make('accounts.branches', $data);
                         } else {
                             if ($section == ACCOUNT_GROUPS) {
                                 $data = ['account' => Auth::user()->account];
                                 return View::make('accounts.groups', $data);
                             } else {
                                 if ($section == ACCOUNT_USERS) {
                                     $data = ['account' => Auth::user()->account];
                                     return View::make('accounts.user_management', $data);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:Vrian7ipx,项目名称:cascadadev,代码行数:41,代码来源:AccountController.php

示例2: formatMoney

 public static function formatMoney($value, $currencyId = false)
 {
     if (!$currencyId) {
         $currencyId = Session::get(SESSION_CURRENCY);
     }
     $currency = Currency::remember(DEFAULT_QUERY_CACHE)->find($currencyId);
     if (!$currency) {
         $currency = Currency::remember(DEFAULT_QUERY_CACHE)->find(1);
     }
     return $currency->symbol . number_format($value, $currency->precision, $currency->decimal_separator, $currency->thousand_separator);
 }
开发者ID:stewartadam,项目名称:invoice-ninja,代码行数:11,代码来源:utils.php

示例3: getViewModel

 private static function getViewModel()
 {
     return ['account' => Auth::user()->account, 'branches' => Branch::where('account_id', '=', Auth::user()->account_id)->where('id', Auth::user()->branch_id)->orderBy('public_id')->get(), 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'frequencies' => array(1 => 'Semanal', 2 => 'Cada 2 semanas', 3 => 'Cada 4 semanas', 4 => 'Mensual', 5 => 'Trimestral', 6 => 'Semestral', 7 => 'Anual')];
 }
开发者ID:aleguisf,项目名称:fvdev1,代码行数:4,代码来源:InvoiceController.php

示例4: getViewModel

 private static function getViewModel()
 {
     return ['entityType' => ENTITY_QUOTE, 'account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels()];
 }
开发者ID:Vrian7ipx,项目名称:cascadadev,代码行数:4,代码来源:QuoteController.php

示例5: getViewModel

 private static function getViewModel()
 {
     return ['sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'customLabel1' => Auth::user()->account->custom_client_label1, 'customLabel2' => Auth::user()->account->custom_client_label2];
 }
开发者ID:stewartadam,项目名称:invoice-ninja,代码行数:4,代码来源:ClientController.php

示例6: getViewModel

 private static function getViewModel()
 {
     $recurringHelp = '';
     foreach (preg_split("/((\r?\n)|(\r\n?))/", trans('texts.recurring_help')) as $line) {
         $parts = explode("=>", $line);
         if (count($parts) > 1) {
             $line = $parts[0] . ' => ' . Utils::processVariables($parts[0]);
             $recurringHelp .= '<li>' . strip_tags($line) . '</li>';
         } else {
             $recurringHelp .= $line;
         }
     }
     return ['account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE, 'invoice_designs_cache_' . Auth::user()->maxInvoiceDesignId())->where('id', '<=', Auth::user()->maxInvoiceDesignId())->orderBy('id')->get(), 'frequencies' => array(1 => 'Weekly', 2 => 'Two weeks', 3 => 'Four weeks', 4 => 'Monthly', 5 => 'Three months', 6 => 'Six months', 7 => 'Annually'), 'recurringHelp' => $recurringHelp];
 }
开发者ID:stewartadam,项目名称:invoice-ninja,代码行数:14,代码来源:InvoiceController.php

示例7: showSection

 public function showSection($section = ACCOUNT_DETAILS, $subSection = false)
 {
     if ($section == ACCOUNT_DETAILS) {
         $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'timezones' => Timezone::remember(DEFAULT_QUERY_CACHE)->orderBy('location')->get(), 'dateFormats' => DateFormat::remember(DEFAULT_QUERY_CACHE)->get(), 'datetimeFormats' => DatetimeFormat::remember(DEFAULT_QUERY_CACHE)->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'languages' => Language::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'showUser' => Auth::user()->id === Auth::user()->account->users()->first()->id];
         return View::make('accounts.details', $data);
     } else {
         if ($section == ACCOUNT_PAYMENTS) {
             $account = Account::with('account_gateways')->findOrFail(Auth::user()->account_id);
             $accountGateway = null;
             $config = null;
             $configFields = null;
             $selectedCards = 0;
             if (count($account->account_gateways) > 0) {
                 $accountGateway = $account->account_gateways[0];
                 $config = $accountGateway->config;
                 $selectedCards = $accountGateway->accepted_credit_cards;
                 $configFields = json_decode($config);
                 foreach ($configFields as $configField => $value) {
                     $configFields->{$configField} = str_repeat('*', strlen($value));
                 }
             } else {
                 $accountGateway = AccountGateway::createNew();
                 $accountGateway->gateway_id = GATEWAY_MOOLAH;
             }
             $recommendedGateways = Gateway::remember(DEFAULT_QUERY_CACHE)->where('recommended', '=', '1')->orderBy('sort_order')->get();
             $recommendedGatewayArray = array();
             foreach ($recommendedGateways as $recommendedGateway) {
                 $arrayItem = array('value' => $recommendedGateway->id, 'other' => 'false', 'data-imageUrl' => asset($recommendedGateway->getLogoUrl()), 'data-siteUrl' => $recommendedGateway->site_url);
                 $recommendedGatewayArray[$recommendedGateway->name] = $arrayItem;
             }
             $creditCardsArray = unserialize(CREDIT_CARDS);
             $creditCards = [];
             foreach ($creditCardsArray as $card => $name) {
                 if ($selectedCards > 0 && ($selectedCards & $card) == $card) {
                     $creditCards[$name['text']] = ['value' => $card, 'data-imageUrl' => asset($name['card']), 'checked' => 'checked'];
                 } else {
                     $creditCards[$name['text']] = ['value' => $card, 'data-imageUrl' => asset($name['card'])];
                 }
             }
             $otherItem = array('value' => 1000000, 'other' => 'true', 'data-imageUrl' => '', 'data-siteUrl' => '');
             $recommendedGatewayArray['Other Options'] = $otherItem;
             $gateways = Gateway::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get();
             foreach ($gateways as $gateway) {
                 $paymentLibrary = $gateway->paymentlibrary;
                 $gateway->fields = $gateway->getFields();
                 if ($accountGateway && $accountGateway->gateway_id == $gateway->id) {
                     $accountGateway->fields = $gateway->fields;
                 }
             }
             $data = ['account' => $account, 'accountGateway' => $accountGateway, 'config' => $configFields, 'gateways' => $gateways, 'dropdownGateways' => Gateway::remember(DEFAULT_QUERY_CACHE)->where('recommended', '=', '0')->orderBy('name')->get(), 'recommendedGateways' => $recommendedGatewayArray, 'creditCardTypes' => $creditCards];
             return View::make('accounts.payments', $data);
         } else {
             if ($section == ACCOUNT_NOTIFICATIONS) {
                 $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id)];
                 return View::make('accounts.notifications', $data);
             } else {
                 if ($section == ACCOUNT_IMPORT_EXPORT) {
                     return View::make('accounts.import_export');
                 } else {
                     if ($section == ACCOUNT_ADVANCED_SETTINGS) {
                         $data = ['account' => Auth::user()->account, 'feature' => $subSection];
                         if ($subSection == ACCOUNT_INVOICE_DESIGN) {
                             $invoice = new stdClass();
                             $client = new stdClass();
                             $invoiceItem = new stdClass();
                             $client->name = 'Sample Client';
                             $client->address1 = '';
                             $client->city = '';
                             $client->state = '';
                             $client->postal_code = '';
                             $client->work_phone = '';
                             $client->work_email = '';
                             $invoice->invoice_number = Auth::user()->account->getNextInvoiceNumber();
                             $invoice->invoice_date = date_create()->format('Y-m-d');
                             $invoice->account = json_decode(Auth::user()->account->toJson());
                             $invoice->amount = $invoice->balance = 100;
                             $invoiceItem->cost = 100;
                             $invoiceItem->qty = 1;
                             $invoiceItem->notes = 'Notes';
                             $invoiceItem->product_key = 'Item';
                             $invoice->client = $client;
                             $invoice->invoice_items = [$invoiceItem];
                             $data['invoice'] = $invoice;
                             $data['invoiceDesigns'] = InvoiceDesign::remember(DEFAULT_QUERY_CACHE, 'invoice_designs_cache_' . Auth::user()->maxInvoiceDesignId())->where('id', '<=', Auth::user()->maxInvoiceDesignId())->orderBy('id')->get();
                         }
                         return View::make("accounts.{$subSection}", $data);
                     } else {
                         if ($section == ACCOUNT_PRODUCTS) {
                             $data = ['account' => Auth::user()->account];
                             return View::make('accounts.products', $data);
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:stewartadam,项目名称:invoice-ninja,代码行数:97,代码来源:AccountController.php

示例8: getViewModel

 private static function getViewModel()
 {
     return ['account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels(), 'frequencies' => array(1 => 'Weekly', 2 => 'Two weeks', 3 => 'Four weeks', 4 => 'Monthly', 5 => 'Three months', 6 => 'Six months', 7 => 'Annually')];
 }
开发者ID:poseidonjm,项目名称:invoice-ninja,代码行数:4,代码来源:InvoiceController.php

示例9: showSection

 public function showSection($section = ACCOUNT_DETAILS, $subSection = false)
 {
     if ($section == ACCOUNT_DETAILS) {
         $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'timezones' => Timezone::remember(DEFAULT_QUERY_CACHE)->orderBy('location')->get(), 'dateFormats' => DateFormat::remember(DEFAULT_QUERY_CACHE)->get(), 'datetimeFormats' => DatetimeFormat::remember(DEFAULT_QUERY_CACHE)->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'languages' => Language::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get()];
         return View::make('accounts.details', $data);
     } else {
         if ($section == ACCOUNT_PAYMENTS) {
             $account = Account::with('account_gateways')->findOrFail(Auth::user()->account_id);
             $accountGateway = null;
             $config = null;
             $configFields = null;
             $selectedCards = 0;
             if (count($account->account_gateways) > 0) {
                 $accountGateway = $account->account_gateways[0];
                 $config = $accountGateway->config;
                 $selectedCards = $accountGateway->accepted_credit_cards;
                 $configFields = json_decode($config);
                 foreach ($configFields as $configField => $value) {
                     $configFields->{$configField} = str_repeat('*', strlen($value));
                 }
             }
             $recommendedGateways = Gateway::remember(DEFAULT_QUERY_CACHE)->where('recommended', '=', '1')->orderBy('sort_order')->get();
             $recommendedGatewayArray = array();
             foreach ($recommendedGateways as $recommendedGateway) {
                 $arrayItem = array('value' => $recommendedGateway->id, 'other' => 'false', 'data-imageUrl' => asset($recommendedGateway->getLogoUrl()), 'data-siteUrl' => $recommendedGateway->site_url);
                 $recommendedGatewayArray[$recommendedGateway->name] = $arrayItem;
             }
             $creditCardsArray = unserialize(CREDIT_CARDS);
             $creditCards = [];
             foreach ($creditCardsArray as $card => $name) {
                 if ($selectedCards > 0 && ($selectedCards & $card) == $card) {
                     $creditCards[$name['text']] = ['value' => $card, 'data-imageUrl' => asset($name['card']), 'checked' => 'checked'];
                 } else {
                     $creditCards[$name['text']] = ['value' => $card, 'data-imageUrl' => asset($name['card'])];
                 }
             }
             $otherItem = array('value' => 1000000, 'other' => 'true', 'data-imageUrl' => '', 'data-siteUrl' => '');
             $recommendedGatewayArray['Other Options'] = $otherItem;
             $data = ['account' => $account, 'accountGateway' => $accountGateway, 'config' => $configFields, 'gateways' => Gateway::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'dropdownGateways' => Gateway::remember(DEFAULT_QUERY_CACHE)->where('recommended', '=', '0')->orderBy('name')->get(), 'recommendedGateways' => $recommendedGatewayArray, 'creditCardTypes' => $creditCards];
             foreach ($data['gateways'] as $gateway) {
                 $paymentLibrary = $gateway->paymentlibrary;
                 $gateway->fields = $gateway->getFields();
                 if ($accountGateway && $accountGateway->gateway_id == $gateway->id) {
                     $accountGateway->fields = $gateway->fields;
                 }
             }
             return View::make('accounts.payments', $data);
         } else {
             if ($section == ACCOUNT_NOTIFICATIONS) {
                 $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id)];
                 return View::make('accounts.notifications', $data);
             } else {
                 if ($section == ACCOUNT_IMPORT_EXPORT) {
                     return View::make('accounts.import_export');
                 } else {
                     if ($section == ACCOUNT_ADVANCED_SETTINGS) {
                         $data = ['account' => Auth::user()->account, 'feature' => $subSection];
                         return View::make("accounts.{$subSection}", $data);
                     } else {
                         if ($section == ACCOUNT_PRODUCTS) {
                             $data = ['account' => Auth::user()->account];
                             return View::make('accounts.products', $data);
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:poseidonjm,项目名称:invoice-ninja,代码行数:69,代码来源:AccountController.php

示例10: getViewModel

 private static function getViewModel()
 {
     return ['industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'business_types' => BusinessType::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'groups' => Group::orderBy('name')->get(), 'zones' => Zone::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'customLabel1' => Auth::user()->account->custom_client_label1, 'customLabel2' => Auth::user()->account->custom_client_label2];
 }
开发者ID:Vrian7ipx,项目名称:cascadadev,代码行数:4,代码来源:ClientController.php


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