https://www.it610.com/article/1298498230232883200.htm
$sellData = DB::table('sells as s')->select([ 's.id', 's.amount', DB::raw('"sell" as type'), ])->get();
type为查询时显示的字段,as左侧的字符串“sell”为type字段的值
https://www.it610.com/article/1298498230232883200.htm
$sellData = DB::table('sells as s')->select([ 's.id', 's.amount', DB::raw('"sell" as type'), ])->get();
type为查询时显示的字段,as左侧的字符串“sell”为type字段的值