我有一个具有$ hasMany属性的模型.如果我有以下内容:
var $hasMany = 'OtherModel'
Run Code Online (Sandbox Code Playgroud)
在类OtherModel扩展AppModel我有以下内容:
var $order = 'colour_id DESC';
Run Code Online (Sandbox Code Playgroud)
订单被忽略,但如果我在第一个模型中有这个:
var $hasMany = array(
'OtherModel' => array(
'order' => 'colour_id DESC'
)
);
Run Code Online (Sandbox Code Playgroud)
然后它使用正确的顺序.
我不确定为什么$ hasMany模型中的顺序在第一个实例中被忽略了?