Hi,
Im hoping anybody have encountered similar problems and come up with a solution.
I am using a myisam database and here are my 2 tables:
table 1: orders
columns: id, customername, time, amount
table 2: order_details
columns: id, order_id, product, quantity
the link between the 2 columns are:
orders.id and order_details.order_id
this is my code on Orders Model
function relation() {
return array(
'rel_order_details' => array(self::BELONGS_TO,'OrderDetailsActiveDomain','id'),
);
}
this is my code on OrderDetails model:
return array(
'rel_orders' => array(self::BELONGS_TO,'OrdersActiveDomain','order_id'),
);
}
==
however, the sql code being generated is:
… select * from orders o left outer join order_details od on (o.id=od.id) where …
but what i actually expected is to generate this sql:
… select * from orders o left outer join order_details od on (o.id=od.order_id) where …
====
any ideas anyone?