hermawanramadhan / CodeIgniter4-DataTables

MIT License
92 stars 38 forks source link

Not work model join #31

Open totoprayogo1916 opened 1 year ago

totoprayogo1916 commented 1 year ago

Describe the bug Not work with model join

Your code

# controller
$taskModel = new TaskModel();
$builder   = $taskModel->view(); // show model for view()

return DataTable::of($builder->builder())->toJson(true);

# model
public function view()
{
    $this->builder()
        ->join('user_details', '(user_details.user_id = requests.user_id AND user_details.detail_key = "name")', 'left')
        ->join('clients', 'clients.client_id = requests.client_id', 'left');

    return $this;
}

Screenshots image

Version (please complete the following information):