我试图count(message) As number
让它在控制器端看起来没有错,但在视图端,我得到了那个错误:
Error rendering view: [home.index]
Undefined property: stdClass::$number
我的观点,我有这样的代码:
foreach($sorgu as $value)
{
case 'BUL1':
$sorgu99[0]+=$value->number;
break;
}
$posts = DB::table('xxx');
$posts = DB::table('xxx')->select( array('message', DB::raw('COUNT(message) AS number'), DB::raw('xxx.Time as time')));
$posts = DB::table('xxx')->join( 'xxs', 'xxx.smsCid', '=', 'rcs.smsCid', 'INNER');
$posts = DB::table('xxx')->where('xxs.status','=','1');
$posts = DB::table('xxx')->where( 'xxx.Time' ,'>', '2012-12-26');
$posts = DB::table('xxx')->where(DB::raw('length(message)'), '>', '3');
$posts = DB::table('xxx')->group_by('message');
$posts = DB::table('xxx')->get();