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字段的值

相关文章:

  • 2022-12-23
  • 2021-10-26
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
猜你喜欢
  • 2021-09-06
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案