【问题标题】:How to delete words sum(total) in my view blade template如何在我的视图刀片模板中删除单词总和(总计)
【发布时间】:2017-09-09 07:20:27
【问题描述】:
$cek = DB::table('temp_obat')
            ->selectRaw('sum(total)')
            ->where('pasien', $id)
            ->get();
$total = $cek;

return view ('buy/bayar',compact('pasien'));

如何删除视图刀片中的 sum(total) 字样?

【问题讨论】:

    标签: php arrays laravel object blade


    【解决方案1】:

    试试这个:

    $cek = DB::table('temp_obat')
            ->selectRaw('sum(total) as total')
            ->where('pasien', $id)
            ->get();
    
    return view ('buy/bayar', ['cek', $cek]);
    

    在模板中:

    {{ $cek->total }}
    

    【讨论】:

      猜你喜欢
      • 2018-07-21
      • 1970-01-01
      • 2018-12-21
      • 2017-08-07
      • 1970-01-01
      • 2021-01-30
      • 2019-07-29
      • 2016-05-31
      • 1970-01-01
      相关资源
      最近更新 更多