doit-cms icon indicating copy to clipboard operation
doit-cms copied to clipboard

Оптимизировать внутренние запросы

Open ramainen opened this issue 11 years ago • 0 comments

$clients = d()->Client->where('user_id = ?', $id);
$active = d()->Workstatus->select('DISTINCT client_id')->where('client_id IN (?) AND status_id = 1 AND service_id IN (SELECT service_id FROM services_to_clients WHERE clients.client_id = services_to_clients.client_id)', $clients->all_of('ids'));

ramainen avatar May 31 '13 10:05 ramainen