dongyi1996 2015-11-28 06:47
浏览 31
已采纳

Idiorm / Paris - 访问交汇处的列

I'm using Paris for my new project...

Let's say I have 3 tables: users, books and borrows:

users: id/name

books: id/title

borrows: users_id/books_id/borrow_date/return_date


In Books class:

function users()
{
    return $this->has_many_through('Users', 'Borrows');
}

In Users class:

function books()
{
    return $this->has_many_through('User', 'Borrows');
}

Everything is fine, I can access to borrowed books by each user and list of users who borrowed a single book before, but I'm wondering that how can I access to borrow_date and return_date column/property of Borrows table/class?

  • 写回答

1条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥30 eMMC&Android&C&Linux
      • ¥15 uniapp ios恢复购买
      • ¥20 ArcgisPro随机森林问题
      • ¥15 layui upload.render 问题 有偿
      • ¥15 “with “is not allowed in strict mode
      • ¥15 ADS2020使用村田数据库仿真出错
      • ¥15 如何解决爬取网站不定时不返回数据
      • ¥20 有几个关于fpga的基础问题黑盒仿真,建立保持时间,和仿真覆盖理论。
      • ¥20 如何在NCBI上下载高通量的测序数据
      • ¥15 L型TFET的器件参数