【发布时间】:2015-07-05 10:31:40
【问题描述】:
我有一个包含许多 Action 的 Objective 模型,每个 Action 都有一个 ActionYear。已经在模型中定义。
如何使用orderby通过action_year的具体列对object中的action进行排序。
$query = Objective::with('actions.actionYear')
->orderBy('action_year.created_at')
->get();
这是由于错误Undefined table: 7 ERROR: missing FROM-clause entry for table "action_year"。
如何解决这个问题。谢谢。
【问题讨论】:
标签: php orm eloquent laravel-5