【发布时间】:2021-08-05 19:02:04
【问题描述】:
$carts= Cart::leftjoin('products', 'products.id', '=', 'carts.productid')
->leftjoin('sellers', 'sellers.id', '=', 'products.seller')
->select('products.*','carts.productid as productid','carts.userid as userid','carts.quantity as cartquantity','carts.subtotal as subtotal','carts.id as cartid','sellers.id as sellerid')->where('carts.userid',$_SESSION['salmonlightsuserid'])->get();
$data1 = array('carts'=>"$carts",'subtotal'=>"$subtotal",'totalquantity'=>"$totalquantity",'primaryaddress'=>"$primaryaddress");
$useremail=$_SESSION['salmonlightsuseremail'];
Mail::send('order-email-template',$data1, function($message) use($useremail){
$message->to($useremail)->subject
('Order');
$message->from('noreply@gamil.com');
});
它在 order-email-template.blade.php 中给出错误 错误是:- 为 foreach() 提供的参数无效 @foreach($carts as $cartsnew)
【问题讨论】:
标签: mysql laravel laravel-5 eloquent laravel-4