$cek = DB::table('temp_obat')
->selectRaw('sum(total)')
->where('pasien', $id)
->get();
$total = $cek;
return view ('buy/bayar',compact('pasien'));
如何删除视图刀片中的sum(total)
字样?
答案 0 :(得分:1)
试试这个:
$cek = DB::table('temp_obat')
->selectRaw('sum(total) as total')
->where('pasien', $id)
->get();
return view ('buy/bayar', ['cek', $cek]);
在模板中:
{{ $cek->total }}