购物车未支付订单
public function index()
{
$session = \Session::get('indexlogin');
// dd($session);
$datas = \DB::table('user_account')->where('guid',$session->guid)->first();
$money_amout = $datas->money_amout;
// dd($money_amout);
$data = \DB::table('shopping_cart')->where('guid',$session->guid)->get();
// dd($data);
if(!empty($data)){
$money = '';
foreach ($data as $key => $value) {
$goods[$key] = \DB::table('qiniu_goods')->where('id',$value->goods_id)->first();
$money += $goods[$key]->goods_money;
}
}else{
$goods = array();
$money = 0;
}
// dd($money);
return view('home.order.index')->with('goods',$goods)->with('money',$money)->with('money_amout',$money_amout);
}
删除订单
public function del($id)
{
$session = \Session::get('indexlogin');
// dd($session->guid);
$shopping_cart = \DB::table('shopping_cart')->where('goods_id',$id)->where('guid',$session->guid)->first();
// dd($shopping_cart);
if(!empty($shopping_cart)){
$row = \DB::table('shopping_cart')->where('id',$shopping_cart->id)->delete();
// dd($row);
return redirect('order');
}else{
return redirect('order');
}
}
未完待续