Is it possible to use model condition with composite key like that?
$checkExist = Daily::findFirst(
[
'columns' => 'ts',
'conditions' => '(ts, tds_id, tracking_id) = (:ts:, :tdsId:, :trackingId:)',
'bind' => [
'ts' => $this->timeFrom,
'tdsId' => $pair->tds_id,
'trackingId' => $pair->tracking_id,
],
]
);
All I got is error:
Syntax error, unexpected token COMMA, near to ' tds_id, tracking_id) = (:ts:, :tdsId:, :trackingId:) LIMIT :APL0:', when parsing: SELECT ts FROM [Models\Daily] WHERE (ts, tds_id, tracking_id) = (:ts:, :tdsId:, :trackingId:) LIMIT :APL0: (106)
Or may be there are another way to get this row?