lundi 25 septembre 2017

fetch the value from the data table

I have 3 tables users,project,department.I want to get 'owner_id'(DCE005) from project table and get the user_id (2) from users table and get the PM_dceid (DCE003) of the project owner and check (DCE003) not in department table's 'dept_head' column.If (DCE003) not in dept_head(DCE004,DCE007,DCE009) then get the value (3) from the users table.Is it possible to get recursive data

project table
 id  owner_id  dept_id  
  4  DCE005     005

users table
 user_id dceid    name    PM_dceid
  1  DCE001  user1    DCE003
  2  DCE005  user2    DCE003
  3  DCE003  user3    DCE009

Department table 
 id    dept-id   dept_head
  2       005      DCE004
  3       006      DCE007
  4                DCE009  

query
 $dept= department::pluck('dept_head')->all();
$project=DB::table('project')
      ->join('users', 'project.project_owner_id', '=', 'users.aceid')->whereNotIn('users.id', $dept)



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2xzKKBX
via IFTTT

Aucun commentaire:

Enregistrer un commentaire