如何以 cakephp 格式编写以下 sql 查询
SELECT
`ActivityLog`.`id`,
CASE User.user_type
WHEN 'admin' THEN concat_ws(' ',Admin.first_name,Admin.last_name)
END,
FROM `project`.`activity_logs` AS `ActivityLog`
left join users as User on ActivityLog.user_id = User.id
left join admins as Admin on User.id = Admin.user_id
WHERE 1 = 1 ORDER BY `ActivityLog`.`datetime` desc
一切都很好,除了case
声明,请帮助我..