SQL JOIN dotaz pomocí Database Explorer

jedlicka
Člen | 57
+
0
-

Ahoj,

mám SQL JOIN dotaz:

SELECT * FROM contracts
JOIN contracts_states on contracts_states.id=contracts.state_id AND contracts_states.state != 5
WHERE contracts.uid=25 AND contracts.sale=0 AND
STR_TO_DATE(JSON_UNQUOTE(JSON_EXTRACT(contracts.data, '$.886')), '%Y-%m-%d') < CURRENT_TIMESTAMP
ORDER BY contracts.date DESC

a potřeboval bych ho zapsat pomocí Database Explorer (nevím, jak na JOIN):

$this->database->table('contracts')
...
->where('contracts.uid=25 AND contracts.sale=0');
->where("STR_TO_DATE(JSON_UNQUOTE(JSON_EXTRACT(data, '$.886')), ?) < ?", '%Y-%m-%d', $today->format('Y-m-d'));
->order('contracts.date DESC');

Děkuji za rady.

Martin