Merge pull request #221 from bagisto/jitendra
Now raw expression will work on select raw dd(->columns);
This commit is contained in:
commit
4eef920472
|
|
@ -67,11 +67,11 @@ class CustomerDataGrid
|
|||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'first_name',
|
||||
'alias' => 'FirstName',
|
||||
'name' => 'CONCAT(first_name, " ", last_name)',
|
||||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
'label' => 'First Name',
|
||||
'sortable' => false,
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'email',
|
||||
|
|
|
|||
|
|
@ -456,16 +456,14 @@ class DataGrid
|
|||
{
|
||||
$select = [];
|
||||
foreach ($this->columns as $column) {
|
||||
$select[] = $column->name.' as '.$column->alias;
|
||||
$this->query->addselect(DB::raw($column->name.' as '.$column->alias));
|
||||
}
|
||||
|
||||
$this->query->select(...$select);
|
||||
// $this->query->select(...$select);
|
||||
|
||||
if ($this->select) {
|
||||
$this->query->addselect($this->select);
|
||||
}
|
||||
|
||||
// dd($this->query);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue