$result['tests'] = Test::select('test.test_id',
DB::raw('convert_tz(test.updated_at,+00:00,-05:30) as updated_at'),
'test.created_at')
->orderBy('test.test_id', 'ASC')
->get()->toArray();
我已经找到了像db::raw('(case when favorite.is\u favorite is null then 0 else favorite.is\u favorite end)as is\u favorite')这样的case when查询的解决方案,
但问题是,我不能对convert\u tz做同样的处理,因为值在引号内。
db::raw('转换\u tz(test.updated \u at,+00:00,-05:30)为updated \u at')
暂无答案!
目前还没有任何答案,快来回答吧!