I have this query without SELECT clause
$itemList = Job::find('all', array('conditions' => array('jobs.deleted = ?' . $sql_conditional_fragment, 0),
'include' => array('job_type','client_upload' => array('outer_client_user'), 'outer_client_offer', 'user', 'retailer', 'job_status'),
'joins' => '
LEFT JOIN client_uploads cu ON cu.id = jobs.client_upload_id
LEFT JOIN users ON users.id = jobs.user_id
LEFT JOIN job_statuses js ON js.id = jobs.job_status_id
LEFT JOIN retailers r ON r.id = jobs.retailer_id',
'order' => $sort,
'limit' => $limit,
'offset' => $offset
));
The actual table names
jobs, job_types, job_statuses, retailers, users, client_uploads
outer_client_user
and outer_client_offer
are not actual table names in the DB.
These are tables from diff DB with names – users and offer. But both have a corresponding Model with actual table name and connection name defined.
can any help me with selecting only handful of columns from all the tables?
What I tried:
'select' =>
'jobs.id, jobs.legibility, jobs.num_items, jobs.total_spent,
jobs.processed_at, jobs.created_at, jobs.approved,
users.first_name, users.last_name, outer_client_user.user_first_name,
outer_client_user.user_last_name, job_types.name,
job_types.abbreviation, r.name, outer_client_offer.offer_name, js.name'