• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP base_lang函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中base_lang函数的典型用法代码示例。如果您正苦于以下问题:PHP base_lang函数的具体用法?PHP base_lang怎么用?PHP base_lang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: createCustomRecord

 public function createCustomRecord($parameters)
 {
     $parameters['services'] = Service::where('lang_id_153', $parameters['lang']->id_001)->get();
     $parameters['environments'] = Environment::where('lang_id_150', $parameters['lang']->id_001)->get();
     $parameters['decorations'] = Decoration::where('lang_id_151', $parameters['lang']->id_001)->get();
     $parameters['relationships'] = Relationship::where('lang_id_152', $parameters['lang']->id_001)->get();
     $parameters['publications'] = Publication::all();
     $parameters['restaurantTypes'] = array_map(function ($object) {
         $object->name = trans($object->name);
         return $object;
     }, config('hotels.restaurantTypes'));
     $parameters['attachmentFamilies'] = AttachmentFamily::getAttachmentFamilies(['resource_id_015' => 'hotels-hotel']);
     $parameters['customFieldGroups'] = CustomFieldGroup::where('resource_id_025', 'hotels-hotel')->get();
     $parameters['attachmentsInput'] = json_encode([]);
     $parameters['hotelProductsIds'] = json_encode([]);
     $parameters['products'] = Product::builder()->where('active_111', true)->where('lang_id_112', $parameters['lang']->id_001)->get();
     // get attachments products with photo list
     $parameters['attachmentsProducts'] = Attachment::builder()->where('lang_id_016', $parameters['lang']->id_001)->where('resource_id_016', 'market-product')->where('family_id_016', config('hotels.idAttachmentsFamily.productList'))->get()->keyBy('object_id_016');
     if (isset($parameters['id'])) {
         // get attachments from base lang
         $attachments = AttachmentLibrary::getRecords($this->package, 'hotels-hotel', $parameters['id'], base_lang()->id_001, true);
         // merge parameters and attachments array
         $parameters = array_merge($parameters, $attachments);
         // get hotel products
         $parameters['hotelProducts'] = HotelProduct::getRecords(['hotel_id_177' => $parameters['id'], 'lang_id_177' => base_lang()->id_001])->keyBy('product_id_177');
         $parameters['hotelProductsIds'] = json_encode($parameters['hotelProducts']->keys()->map(function ($item, $key) {
             return strval($item);
         }));
     }
     return $parameters;
 }
开发者ID:syscover,项目名称:hotels,代码行数:31,代码来源:HotelController.php


示例2: customIndex

 public function customIndex($parameters)
 {
     $parameters['urlParameters']['lang'] = base_lang()->id_001;
     $parameters['field'] = CustomField::getTranslationRecord(['id' => $parameters['field'], 'lang' => $parameters['lang']]);
     $parameters['customTransHeader'] = trans_choice($this->objectTrans, 2) . ' (' . trans_choice('pulsar::pulsar.field', 1) . ': ' . $parameters['field']->name_026 . ')';
     return $parameters;
 }
开发者ID:syscover,项目名称:pulsar,代码行数:7,代码来源:CustomFieldValueController.php


示例3: jsonTerritorialAreas1FromCountry

 public function jsonTerritorialAreas1FromCountry($country)
 {
     if ($country == "null") {
         return response()->json(['status' => 'error', 'message' => 'We expect a correct country code'], 400);
     } else {
         return response()->json(['status' => 'success', 'data' => Country::where('id_002', $country)->where('lang_id_002', base_lang()->id_001)->first()->getTerritorialAreas1]);
     }
 }
开发者ID:syscover,项目名称:pulsar,代码行数:8,代码来源:TerritorialArea1Controller.php


示例4: editCustomRecord

 public function editCustomRecord($parameters)
 {
     $parameters['territorialAreas1'] = TerritorialArea1::getTerritorialAreas1FromCountry($parameters['country']);
     $parameters['country'] = Country::where('id_002', $parameters['country'])->where('lang_id_002', base_lang()->id_001)->first();
     $parameters['customTrans'] = $parameters['country']->territorial_area_2_002;
     $parameters['customTransHeader'] = $parameters['country']->territorial_area_2_002 . ' (' . $parameters['country']->name_002 . ')';
     return $parameters;
 }
开发者ID:syscover,项目名称:pulsar,代码行数:8,代码来源:TerritorialArea2Controller.php


示例5: customCount

 public static function customCount($request, $parameters)
 {
     $query = TerritorialArea2::builder();
     if (isset($parameters['country'])) {
         $query->where('country_id_004', $parameters['country']);
     }
     if (isset($parameters['lang'])) {
         $query->where('lang_id_002', $parameters['lang']);
     } else {
         $query->where('lang_id_002', base_lang()->id_001);
     }
     return $query;
 }
开发者ID:syscover,项目名称:pulsar,代码行数:13,代码来源:TerritorialArea2.php


示例6: scopeBuilder

 public function scopeBuilder($query, $lang = null)
 {
     return $query->leftJoin('012_111_product', '012_117_order_row.product_id_117', '=', '012_111_product.id_111')->leftJoin('012_112_product_lang', function ($join) use($lang) {
         $join->on('012_111_product.id_111', '=', '012_112_product_lang.id_112');
         if ($lang !== null) {
             $join->where('012_112_product_lang.lang_id_112', '=', $lang);
         } else {
             // always need filter by lang, because order form,
             // need filter your order rows by lang without pass lang variable
             $join->where('012_112_product_lang.lang_id_112', '=', base_lang()->id_001);
         }
     });
 }
开发者ID:syscover,项目名称:market,代码行数:13,代码来源:OrderRow.php


示例7: createCustomRecord

 public function createCustomRecord($parameters)
 {
     $parameters['attachmentFamilies'] = AttachmentFamily::getAttachmentFamilies(['resource_id_015' => 'spas-spa']);
     $parameters['customFieldGroups'] = CustomFieldGroup::where('resource_id_025', 'spas-spa')->get();
     $parameters['attachmentsInput'] = json_encode([]);
     $parameters['hotels'] = Hotel::builder()->where('active_170', true)->get();
     if (isset($parameters['id'])) {
         // get attachments from base lang
         $attachments = AttachmentLibrary::getRecords($this->package, 'spas-spa', $parameters['id'], base_lang()->id_001, true);
         // merge parameters and attachments array
         $parameters = array_merge($parameters, $attachments);
     }
     return $parameters;
 }
开发者ID:syscover,项目名称:spas,代码行数:14,代码来源:SpaController.php


示例8: scopeBuilder

 public function scopeBuilder($query)
 {
     // we not relate to countries, because there are two countries which relate, invoice and shipping, has not been found to create aliases on columns within a join
     return $query->join('009_301_customer', '012_116_order.customer_id_116', '=', '009_301_customer.id_301')->join('012_115_payment_method', function ($join) {
         $join->on('012_116_order.payment_method_id_116', '=', '012_115_payment_method.id_115')->where('012_115_payment_method.lang_id_115', '=', base_lang()->id_001);
     })->join('012_114_order_status', function ($join) {
         $join->on('012_116_order.status_id_116', '=', '012_114_order_status.id_114')->where('012_114_order_status.lang_id_114', '=', base_lang()->id_001);
     });
     /*
     ->join('001_002_country', function ($join) {
         $join->on('012_116_order.invoice_country_id_116', '=', '001_002_country.id_002')
             ->on('001_002_country.lang_id_002', '=', '001_001_lang.id_001');
     })
     ->join('001_002_country', function ($join) {
         $join->on('012_116_order.shipping_country_id_116', '=', '001_002_country.id_002')
             ->on('001_002_country.lang_id_002', '=', '001_001_lang.id_001');
     });
     */
 }
开发者ID:syscover,项目名称:market,代码行数:19,代码来源:Order.php


示例9: getRecords

 /**
  *  Function to get attachment element with json string to new element
  *
  * @access	public
  * @param   string      $routesConfigFile
  * @param   string      $resource
  * @param   integer     $objectId
  * @param   string      $lang
  * @param   boolean     $copyAttachment
  * @return  array       $response
  */
 public static function getRecords($routesConfigFile, $resource, $objectId, $lang, $copyAttachment = false)
 {
     $response['attachments'] = Attachment::getRecords(['lang_id_016' => $lang, 'resource_id_016' => $resource, 'object_id_016' => $objectId, 'orderBy' => ['column' => 'sorting_016', 'order' => 'asc']]);
     $attachmentsInput = [];
     foreach ($response['attachments'] as &$attachment) {
         $tmpFileName = null;
         if ($copyAttachment) {
             // function to duplicate files if we create a new lang object
             // copy attachments base lang article to temp folder
             $tmpFileName = uniqid();
             File::copy(public_path() . config($routesConfigFile . '.attachmentFolder') . '/' . $objectId . '/' . base_lang()->id_001 . '/' . $attachment->file_name_016, public_path() . config($routesConfigFile . '.tmpFolder') . '/' . $tmpFileName);
             // store tmp file name in attachment to know temporal name
             $attachment['tmp_file_name_016'] = $tmpFileName;
         }
         // get json data from attachment
         $attachmentData = json_decode($attachment->data_016);
         $attachmentsInput[] = ['id' => $attachment->id_016, 'family' => $attachment->family_id_016, 'type' => ['id' => $attachment->type_id_016, 'name' => $attachment->type_text_016, 'icon' => $attachmentData->icon], 'mime' => $attachment->mime_016, 'name' => $attachment->name_016, 'folder' => $copyAttachment ? config($routesConfigFile . '.tmpFolder') : config($routesConfigFile . '.attachmentFolder') . '/' . $attachment->object_id_016 . '/' . $attachment->lang_id_016, 'tmpFileName' => $tmpFileName, 'fileName' => $attachment->file_name_016, 'width' => $attachment->width_016, 'height' => $attachment->height_016, 'library' => $attachment->library_id_016, 'libraryFileName' => $attachment->library_file_name_016, 'sorting' => $attachment->sorting_016];
     }
     $response['attachmentsInput'] = json_encode($attachmentsInput);
     return $response;
 }
开发者ID:syscover,项目名称:pulsar,代码行数:32,代码来源:AttachmentLibrary.php


示例10: createCustomRecord

 public function createCustomRecord($parameters)
 {
     $parameters['sections'] = Section::all();
     $parameters['families'] = ArticleFamily::all();
     $parameters['tags'] = [];
     $tags = Tag::builder()->where('lang_id_358', $parameters['lang']->id_001)->get();
     foreach ($tags as $tag) {
         $parameters['tags'][] = ['value' => $tag->id_358, 'label' => $tag->name_358];
     }
     $parameters['categories'] = Category::builder()->where('lang_id_352', $parameters['lang']->id_001)->get();
     $parameters['statuses'] = [(object) ['id' => 0, 'name' => trans('cms::pulsar.draft')], (object) ['id' => 1, 'name' => trans('cms::pulsar.publish')]];
     $parameters['attachmentFamilies'] = AttachmentFamily::getAttachmentFamilies(['resource_id_015' => 'cms-article']);
     $parameters['attachmentsInput'] = json_encode([]);
     if (isset($parameters['id'])) {
         // get attachments from base lang
         $attachments = AttachmentLibrary::getRecords($this->package, 'cms-article', $parameters['id'], base_lang()->id_001, true);
         // merge parameters and attachments array
         $parameters = array_merge($parameters, $attachments);
     }
     return $parameters;
 }
开发者ID:syscover,项目名称:cms,代码行数:21,代码来源:ArticleController.php


示例11: scopeBuilder

 public function scopeBuilder($query)
 {
     return $query->join('012_111_product', '011_222_product_prefix.product_id_222', '=', '012_111_product.id_111')->join('012_112_product_lang', '012_111_product.id_111', '=', '012_112_product_lang.id_112')->join('001_001_lang', '012_112_product_lang.lang_id_112', '=', '001_001_lang.id_001')->where('012_112_product_lang.lang_id_112', base_lang()->id_001);
 }
开发者ID:syscover,项目名称:booking,代码行数:4,代码来源:ProductPrefix.php


示例12: scopeBuilder

 public function scopeBuilder($query)
 {
     return $query->join('001_002_country', function ($join) {
         $join->on('012_103_tax_rate_zone.country_id_103', '=', '001_002_country.id_002')->where('001_002_country.lang_id_002', '=', base_lang()->id_001);
     });
 }
开发者ID:syscover,项目名称:market,代码行数:6,代码来源:TaxRateZone.php


示例13: updateCustomRecord

 public function updateCustomRecord($parameters)
 {
     $order = Order::find($parameters['id']);
     Order::where('id_116', $parameters['id'])->update(['status_id_116' => $this->request->input('status'), 'payment_method_id_116' => $this->request->input('paymentMethod'), 'comments_116' => $this->request->has('comments') ? $this->request->input('comments') : null, 'has_gift_116' => $this->request->has('gift'), 'gift_from_116' => $this->request->has('giftFrom') ? $this->request->input('giftFrom') : null, 'gift_to_116' => $this->request->has('giftTo') ? $this->request->input('giftTo') : null, 'gift_message_116' => $this->request->has('giftMessage') ? $this->request->input('giftMessage') : null, 'customer_id_116' => $this->request->input('customerId'), 'customer_company_116' => $this->request->has('customerCompany') ? $this->request->input('customerCompany') : null, 'customer_tin_116' => $this->request->has('customerTin') ? $this->request->input('customerTin') : null, 'customer_name_116' => $this->request->has('customerName') ? $this->request->input('customerName') : null, 'customer_surname_116' => $this->request->has('customerSurname') ? $this->request->input('customerSurname') : null, 'customer_email_116' => $this->request->input('customerEmail'), 'customer_phone_116' => $this->request->has('customerPhone') ? $this->request->input('customerPhone') : null, 'customer_mobile_116' => $this->request->has('customerMobile') ? $this->request->input('customerMobile') : null, 'has_shipping_116' => $this->request->has('hasShipping'), 'shipping_company_116' => $this->request->has('shippingCompany') ? $this->request->input('shippingCompany') : null, 'shipping_name_116' => $this->request->has('shippingName') ? $this->request->input('shippingName') : null, 'shipping_surname_116' => $this->request->has('shippingSurname') ? $this->request->input('shippingSurname') : null, 'shipping_email_116' => $this->request->has('shippingEmail') ? $this->request->input('shippingEmail') : null, 'shipping_phone_116' => $this->request->has('shippingPhone') ? $this->request->input('shippingPhone') : null, 'shipping_mobile_116' => $this->request->has('shippingMobile') ? $this->request->input('shippingMobile') : null, 'shipping_amount_116' => $this->request->has('shippingAmount') ? $this->request->input('shippingAmount') : 0]);
     // if order status is different that previous status order, we record this change
     if ($order->status_id_116 != (int) $this->request->input('status')) {
         $orderStatus = OrderStatus::builder()->where('lang_id_114', base_lang()->id_001)->where('active_114', true)->get();
         Order::setOrderLog($parameters['id'], trans('market::pulsar.message_user_change_order_status', ['user' => auth('pulsar')->user()->user_010, 'oldStatus' => $orderStatus->where('id_114', $order->status_id_116)->first()->name_114, 'newStatus' => $orderStatus->where('id_114', (int) $this->request->input('status'))->first()->name_114]));
     }
 }
开发者ID:syscover,项目名称:market,代码行数:10,代码来源:OrderController.php


示例14: scopeBuilder

 public function scopeBuilder($query)
 {
     return $query->join('008_075_customer', '008_078_request.customer_id_078', '=', '008_075_customer.id_075')->join('001_010_user', '008_078_request.supervisor_id_078', '=', '001_010_user.id_010')->join('008_074_company', '008_078_request.company_id_078', '=', '008_074_company.id_074')->join('008_076_shop', '008_078_request.shop_id_078', '=', '008_076_shop.id_076')->join('008_077_address', '008_078_request.address_id_078', '=', '008_077_address.id_077')->join('008_071_brand', '008_078_request.brand_id_078', '=', '008_071_brand.id_071')->join('008_072_product', '008_078_request.product_id_078', '=', '008_072_product.id_072')->join('008_070_family', '008_078_request.family_id_078', '=', '008_070_family.id_070')->join('001_002_country', function ($join) {
         $join->on('008_078_request.country_id_078', '=', '001_002_country.id_002')->where('001_002_country.lang_id_002', '=', base_lang()->id_001);
     })->leftJoin('001_003_territorial_area_1', '008_078_request.territorial_area_1_id_078', '=', '001_003_territorial_area_1.id_003')->leftJoin('001_004_territorial_area_2', '008_078_request.territorial_area_2_id_078', '=', '001_004_territorial_area_2.id_004');
 }
开发者ID:syscover,项目名称:octopus,代码行数:6,代码来源:Request.php


示例15: getDataObjects

 public function getDataObjects(Request $request)
 {
     $parameters = $request->route()->parameters();
     $result = collect(config('booking.models'))->where('id', (int) $parameters['model']);
     if (count($result) === 0) {
         return response()->json(['status' => 'error', 'code' => 404, 'message' => 'Records not found']);
     }
     // model constructor
     $model = App::make($result->first()->model);
     $name = trans_choice($result->first()->name, 1);
     $primaryKey = $model->getKeyName();
     $suffix = $model->getSuffix();
     // use sofa to get lang from lang table of object query
     $objects = $model->builder()->where('lang_id', base_lang()->id_001)->get();
     return response()->json(['status' => 'success', 'name' => $name, 'primaryKey' => $primaryKey, 'suffix' => $suffix, 'objects' => $objects]);
 }
开发者ID:syscover,项目名称:booking,代码行数:16,代码来源:VoucherController.php


示例16: createRecord

 /**
  * @access      public
  * @return      \Illuminate\Support\Facades\View
  */
 public function createRecord()
 {
     // get parameters from url route
     $parameters = $this->request->route()->parameters();
     $parameters['urlParameters'] = $parameters;
     // check if create route has modal
     // is necessary to have modal paramenter in all routes for proper operation
     if (Route::current()->hasParameter('modal')) {
         // check if this element is modal, to mark in your url petition
         if (isset($parameters['modal']) && $parameters['modal'] == 1) {
             $parameters['urlParameters']['modal'] = 1;
         } else {
             $parameters['urlParameters']['modal'] = 0;
         }
     }
     // get lang object
     if (isset($parameters['lang'])) {
         $parameters['lang'] = Lang::builder()->find($parameters['lang']);
     }
     $parameters = $this->createCustomRecord($parameters);
     // check if parameters is a RedirectResponse object, to send request to other url
     if (is_object($parameters) && get_class($parameters) == \Illuminate\Http\RedirectResponse::class) {
         return $parameters;
     }
     $parameters['resource'] = $this->resource;
     $parameters['package'] = $this->package;
     $parameters['folder'] = $this->folder;
     $parameters['routeSuffix'] = $this->routeSuffix;
     $parameters['icon'] = $this->icon;
     // traslate of object that we are operate, this variable is instance in controller
     $parameters['objectTrans'] = isset($this->objectTrans) && $this->objectTrans != null ? Miscellaneous::getObjectTransValue($parameters, $this->objectTrans) : null;
     // check if action is store or storeLang
     if (isset($parameters['id']) && isset($parameters['lang'])) {
         // set baseLang to get baseLang object
         $parametersAux = $parameters;
         $parametersAux['lang'] = base_lang()->id_001;
         $parameters['object'] = call_user_func($this->model . '::getTranslationRecord', $parametersAux);
         $parameters['action'] = 'storeLang';
     } else {
         $parameters['action'] = 'store';
     }
     // set viewParamentes on parameters for throw to view
     $parameters['viewParameters'] = $this->viewParameters;
     // check if exist create view, default all request go to common view
     if (view()->exists($this->package . '::' . $this->folder . '.create', $parameters)) {
         return view($this->package . '::' . $this->folder . '.create', $parameters);
     } else {
         return view($this->package . '::' . $this->folder . '.form', $parameters);
     }
 }
开发者ID:syscover,项目名称:pulsar,代码行数:54,代码来源:Controller.php


示例17: customIndex

 public function customIndex($parameters)
 {
     $parameters['urlParameters']['lang'] = base_lang()->id_001;
     return $parameters;
 }
开发者ID:syscover,项目名称:hotels,代码行数:5,代码来源:EnvironmentController.php


示例18: editCustomRecord

 public function editCustomRecord($parameters)
 {
     $parameters['products'] = Product::builder()->where('lang_id_112', base_lang()->id_001)->get();
     return $parameters;
 }
开发者ID:syscover,项目名称:booking,代码行数:5,代码来源:ProductPrefixController.php


示例19: editCustomRecord

 public function editCustomRecord($parameters)
 {
     $parameters['categories'] = Category::where('lang_id_110', $parameters['lang']->id_001)->get();
     $parameters['productTypes'] = array_map(function ($object) {
         $object->name = trans($object->name);
         return $object;
     }, config('market.productTypes'));
     $parameters['priceTypes'] = array_map(function ($object) {
         $object->name = trans($object->name);
         return $object;
     }, config('market.priceTypes'));
     $parameters['productClassTaxes'] = ProductClassTax::builder()->get();
     $parameters['parentsProducts'] = Product::builder()->where('lang_id_112', base_lang()->id_001)->where('id_111', '<>', $parameters['id'])->whereNull('parent_product_id_111')->get();
     $taxRules = TaxRule::builder()->where('country_id_103', config('market.taxCountry'))->where('customer_class_tax_id_106', config('market.taxCustomerClass'))->where('product_class_tax_id_107', $parameters['object']->product_class_tax_id_111)->orderBy('priority_104', 'asc')->get();
     $taxes = TaxRuleLibrary::taxCalculateOverSubtotal($parameters['object']->subtotal_111, $taxRules);
     // ATTENTION! we create custom properties tax_amount_111 and total_111
     $parameters['object']->tax_amount_111 = $taxes->sum('taxAmount');
     $parameters['object']->total_111 = $parameters['object']->subtotal_111 + $parameters['object']->tax_amount_111;
     $attachments = AttachmentLibrary::getRecords($this->package, 'market-product', $parameters['object']->id_111, $parameters['lang']->id_001);
     $parameters['customFieldGroups'] = CustomFieldGroup::builder()->where('resource_id_025', 'market-product')->get();
     $parameters['attachmentFamilies'] = AttachmentFamily::getAttachmentFamilies(['resource_id_015' => 'market-product']);
     $parameters = array_merge($parameters, $attachments);
     return $parameters;
 }
开发者ID:syscover,项目名称:market,代码行数:24,代码来源:ProductController.php


示例20: apiGetDataRow

 public function apiGetDataRow()
 {
     $parameters = $this->request->route()->parameters();
     $orderRow = OrderRow::builder(base_lang())->where('id_117', $parameters['id'])->first();
     // get object from json, and convert to array
     $data = json_decode($orderRow->data_117, true);
     return view('market::order.info_modal', $data);
 }
开发者ID:syscover,项目名称:market,代码行数:8,代码来源:OrderRowController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP base_path函数代码示例发布时间:2022-05-24
下一篇:
PHP base_index函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap