在topicController.php的 方法中怎么掉用 Post::model?
如果在topicController.php 的 方法中
显示该帖子的20个post 和 post对应的user 的username,
我在模型Topic 中怎么写?
在topicController.php的 方法中怎么掉用 Post::model?
如果在topicController.php 的 方法中
显示该帖子的20个post 和 post对应的user 的username,
我在模型Topic 中怎么写?
你是要连表查询??
去看看 db relations 吧
是的 我要在topic帖子显示页面 获得posts 和 topic模型 没关系
这样也要写在topic relations 中么?
那就是这样直接调用啊,不然怎么调用model
。。。。