我有一个包含多个存储(属于属性)的列表。我可以根据StorageInt11.val
对结果列表进行排序吗?
public function findList(Query $query, array $options)
{
return $query
->where([
'category_id' => $options['for']
])
->contain([
'StorageDate.Properties',
'StorageDecimal1.Properties',
'StorageDecimal2.Properties',
'StorageInt11.Properties',
'StorageVarchar255.Properties',
'StorageText.Properties'
])
// The following does not work:
->order(['StorageInt11.val' => 'desc'])
->hydrate(false)
->toArray();
}
我应该转到Collections sorting吗?