本文整理汇总了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';
}
}
}