1 回答

TA貢獻1921條經驗 獲得超9個贊
$temp = DB::select(DB::raw("select regionalid,
nvl(sum(case when lastactiontype='0' then totalcharge end),0) as creditlimit_usage,
count(case when lastactiontype='0' then msisdn end) as creditlimit_rec,
from alarms_v2
where alarmdate = '$today'
-- fatal error exception :Call to a member function get() on array --
group by regionalid order by regionalid"))->get();
在這里,您不需要調用該get()方法。因為select()方法已經執行查詢并返回結果數組。因此,請像下面這樣做:
$temp = DB::select(DB::raw("select regionalid,
nvl(sum(case when lastactiontype='0' then totalcharge end),0) as creditlimit_usage,
count(case when lastactiontype='0' then msisdn end) as creditlimit_rec,
from alarms_v2
where alarmdate = '$today'
group by regionalid order by regionalid"));
- 1 回答
- 0 關注
- 164 瀏覽
添加回答
舉報