我使用的是2千卡,我有以下模式:
I would like to use the find()
method to give me a list of all the Artists
along with the number of Products
they have in their portfolio and the number they have in their archive. An Products
.
A Artists
portfolio if its ProductAvailability.name = For sale
or if its ProductAvailability.name = Sold
and the Order.date
on which it was sold is less than 30 days in the past.
一种产品载于Artists
档案中,如果其ProductAvailability.name = Sold
和>Order.date
出售该产品 过去30天。
示范协会:
Artist hasMany Product
Product belongsTo Artist
Product belongsTo ProductAvailability
ProductAvailability hasMany Product
OrderDetail belongsTo Product
Product hasMany OrderDetail
我倾向于使用<代码>find()方法,而不是<代码>query()方法进行可携带性和测试。 任何想法?