Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
Combine el resultado de la selección de registros activos con la combinación

He usado la siguiente consulta en mi modelo, pero cuando combino mis resultados, solo devuelve la última consulta.

 $this->db->where('type','user'); $this->db->where('status','Approve'); $this->db->select('*'); $this->db->from('trending_update'); $this->db->order_by('trending_update.update_time','DESC'); $this->db->join('user_profile', 'user_profile.id = trending_update.user_id'); $query = $this->db->get(); $data_user= $query->result(); $this->db->where('type','employer'); $this->db->where('status','Approve'); $this->db->select('*'); $this->db->from('trending_update'); $this->db->order_by('trending_update.update_time','DESC'); $this->db->join('event_master', 'event_master.employer_id = trending_update.user_id','left outer'); $this->db->join('employer_profile', 'employer_profile.id = trending_update.user_id','left outer'); $this->db->join('news_master', 'news_master.employer_id = trending_update.user_id','left outer'); $this->db->group_by('employer_profile.id'); $query = $this->db->get(); $data_employer = $query->result(); $data_all=$data_employer+$data_user;
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Utilice la función php array_merge :

 $this->db->where('type','user'); $this->db->where('status','Approve'); $this->db->select('*'); $this->db->from('trending_update'); $this->db->order_by('trending_update.update_time','DESC'); $this->db->join('user_profile', 'user_profile.id = trending_update.user_id'); $query = $this->db->get(); $data_user= $query->result_array(); $this->db->where('type','employer'); $this->db->where('status','Approve'); $this->db->select('*'); $this->db->from('trending_update'); $this->db->order_by('trending_update.update_time','DESC'); $this->db->join('event_master', 'event_master.employer_id = trending_update.user_id','left outer'); $this->db->join('employer_profile', 'employer_profile.id = trending_update.user_id','left outer'); $this->db->join('news_master', 'news_master.employer_id = trending_update.user_id','left outer'); $this->db->group_by('employer_profile.id'); $query = $this->db->get(); $data_employer = $query->result_array(); $data_all=array_merge($data_user,$data_employer);
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!