使用withJoin来联模型的时候

假如是一个单词的表:user

在使用的时候

withJoin(['user'])->select();

没有问题 查出来使用user.xxx参数就可以使用了

 

但是假如是一个驼峰参数命名的模型比如 UserQuestion

使用完后

withJoin('UserQuestion')->select();

查询出来的属性不是userQuestion.xxx 而是 userQuestion__xxx才能使用注意是两个下划线。。。。

可能是我使用方式不对吧  挺坑的

相关文章:

  • 2021-04-11
  • 2021-05-22
  • 2021-12-20
  • 2021-10-04
  • 2021-08-07
  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-14
  • 2021-06-22
  • 2021-10-15
  • 2021-08-31
  • 2022-01-09
  • 2021-08-01
相关资源
相似解决方案