relacja klienta z pracyyajra DataTable z join nie działa w laravel 5?
public function customer() {
return $this->belongsTo('App\Customer','customerid');
}
public function jobs(){
return $this->hasMany('App\Job','customerid');
}
w kontrolerze
protected function getJobs(){
\t \t \t $jobs = Job::Join('customer','jobs.customerid','=','customer.id')
->select(array('jobs.id','customer.firstname','customer.lastname','jobs.jobstatus','jobs.trialdate','jobs.deliverydate')); \t
return Datatables::of($jobs)
->addColumn('action', '<a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" title="Edit" href="{{ URL::to(\'updatejob/\'.$id) }}"><i class="fa fa-pencil"></i></a>')
->make();
\t \t \t
}
SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'order clause' (SQL: select `jobs`.`id`, `customer`.`firstname`, `customer`.`lastname`, `jobs`.`jobstatus`, `jobs`.`trialdate`, `jobs`.`deliverydate` from `jobs` inner join `customer` on `jobs`.`customerid` = `customer`.`id` order by `0` asc limit 10 offset 0)
utknąłem w tej kwestii od 2 dnia pomóż mi wydostać się z tego