$data = Answer::with(['questionInfo' => function ($query) {
            $query->select('id', 'title');
        }])->where("user_id",8)
            ->orderBy("created_at", 'desc')
            ->select(["id", "question_id", "content", "created_at"]);

width里面一定要加id

相关文章:

  • 2022-01-31
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2022-02-10
  • 2021-12-19
相关资源
相似解决方案