2

嗨,我对 php yii 很陌生,我有以下查询

select d.* from customer_service_provider csp inner join (select id_customers from customer_devices cd where id_devices=2) as c on csp.id_customers=c.id_customers inner join user_devices ud on ud.id_users = csp.id_users inner join devices d on d.id = ud.id_devices 

我如何使用 CDBcriteria 写入 php yii

4

1 回答 1

1

您无法使用 $criteria 和 CActiveDataProvider 从“customer_service_provider”获取“设备”(d.*)。

因为 CActiveDataProvider 需要一个模型来将查询结果转换为该模型的对象列表,但在这种情况下,您必须传递模型“customer_service_provider”类。

对不起我的英语不好..

于 2013-07-26T12:40:23.003 回答