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


PHP Customer::GetCustomer方法代码示例

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


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

示例1: storeQuotationOffline

 public function storeQuotationOffline(Request $request)
 {
     if (isset($request->hidden_quotation)) {
         $quot = json_decode($request->hidden_quotation, false);
         $options = json_encode($quot->list_option);
         $customers = Customer::GetCustomer($quot->id_customers)->get();
         $customer = $customers[0];
         $mail_customer = $customer->mail;
         //dd($request->list_option);
         $quotation = new Quotation();
         $quotation->total_price = $quot->prix_total_voiture;
         $quotation->id_car = $quot->id_car;
         $quotation->id_customer = $quot->id_customers;
         $res = $quotation->save();
         foreach ($options as $opt) {
             $quotationOption = new QuotationOption();
             $quotationOption->quotation_id = $quotation->id;
             $quotationOption->option_car_id = $opt->id;
             $quotationOption->option_price = $opt->price;
             $quotationOption->save();
         }
         $this->SendMail($quot->car_finition, $quot->basic_price, $quot->tva, $quot->frais_imm, $quot->tme, $quot->frais_timbre, $quot->prix_total_voiture, $quot->list_option, $quot->prix_options, $customer->name, $customer->last_name, $customer->mail);
         return 'd';
     } else {
         $quot = json_decode($request->hidden_quotation_customer, false);
         $testCin = Customer::GetCinCustomer($quot->clients->cin)->get();
         if (!isset($testCin[0])) {
             $customer = $this->addcustomerfirst($quot->clients->name, $quot->clients->last_name, $quot->clients->cin, $quot->clients->mail, $quot->clients->adress, $quot->clients->function, $quot->clients->phone, $quot->clients->car);
             $quotation = new Quotation();
             $quotation->total_price = $quot->devis->prix_total_voiture;
             $quotation->id_car = $quot->devis->id_car;
             $quotation->id_customer = $customer->id;
             $res = $quotation->save();
             foreach (json_encode($quot->devis->list_option) as $opt) {
                 $quotationOption = new QuotationOption();
                 $quotationOption->quotation_id = $quotation->id;
                 $quotationOption->option_car_id = $opt->id;
                 $quotationOption->option_price = $opt->price;
                 $quotationOption->save();
             }
             $this->SendMail($quot->devis->car_finition, $quot->devis->basic_price, $quot->devis->tva, $quot->devis->frais_imm, $quot->devis->tme, $quot->devis->frais_timbre, $quot->devis->prix_total_voiture, $quot->devis->list_option, $quot->devis->prix_options, $quot->clients->name, $quot->clients->last_name, $quot->clients->mail);
             return 'dc';
         } else {
             return 'false';
         }
     }
 }
开发者ID:bychems,项目名称:projet-pfe,代码行数:47,代码来源:QuotationsController.php


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