Join in codeigniter
Join 3 tables by codeigniter
$query = ee()->db->select('b.id,b.rec_date,b.status,b.member_id, b.merchant_name, b.order_number, b.shipping_company, b.tracking_number,b.optional_service, b.inspected, c.first_name, c.last_name, c.mailbox_number,d.group_title as membership')
->from('exp_incoming_order b')
->order_by('b.id','desc')
->join('exp_members c', 'b.member_id=c.member_id and '.$whereCond)
->join('exp_member_groups d', 'd.group_id=c.group_id')
->limit($this->perpage, $rownum)
->get();
Join 3 tables by codeigniter
$query = ee()->db->select('b.id,b.rec_date,b.status,b.member_id, b.merchant_name, b.order_number, b.shipping_company, b.tracking_number,b.optional_service, b.inspected, c.first_name, c.last_name, c.mailbox_number,d.group_title as membership')
->from('exp_incoming_order b')
->order_by('b.id','desc')
->join('exp_members c', 'b.member_id=c.member_id and '.$whereCond)
->join('exp_member_groups d', 'd.group_id=c.group_id')
->limit($this->perpage, $rownum)
->get();
No comments:
Post a Comment