Код: Выделить всё
$this->db->join(
'user_profile ON sender.user_id = CASE WHEN mailbox.sender_user_id = 1
THEN mailbox_recipient.recipient_user_id
ELSE mailbox.sender_user_id END'
);
Код: Выделить всё
JOIN `user_profile ON sender`.`user_id = CASE WHEN mailbox`.`sender_user_id = 1 THEN mailbox_recipient`.`recipient_user_id ELSE mailbox`.`sender_user_id` `END`
Подробнее здесь: https://stackoverflow.com/questions/430 ... igniters-j
Мобильная версия