Commit f7e643c97f905b23672dbc68240e114d2b38f931

Authored by Hayk Nazaryan
1 parent 1b48ee4fb1
Exists in master

fix fields

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

app/Http/Controllers/WorkerController.php
... ... @@ -304,7 +304,9 @@ class WorkerController extends Controller
304 304 )". ((!empty($jobIds)) ? 'and job_titles.id in ('. implode(',', $jobIds).')' : '')
305 305 );*/
306 306  
307   - $users = DB::select("SELECT`job_titles`.`name`,`users`.`surname`,`users`.`name_man`,`users`.`surname2`,`users`.`email`,`users`.`telephone` FROM users
  307 + $selectFields = implode(',', $columns);
  308 +
  309 + $users = DB::select("SELECT $selectFields FROM users
308 310 JOIN workers ON `users`.`id` = `workers`.`user_id`
309 311 JOIN job_titles ON (`workers`.`position_work` = `job_titles`.`id`
310 312 OR JSON_CONTAINS(`workers`.`positions_work`, JSON_QUOTE(CAST(`job_titles`.`id` AS CHAR)), '$'))