Moved Channel Remaining Initialization Property To Constructor As Its Previously Defined There

This commit is contained in:
Devansh 2020-08-10 09:51:13 +05:30
parent eadc2cc0a6
commit 03c0b9938e
1 changed files with 4 additions and 4 deletions

View File

@ -28,17 +28,17 @@ class ProductDataGrid extends DataGrid
{
parent::__construct();
/* locale */
$this->locale = request()->get('locale') ?? 'all';
/* finding channel name */
$this->channel = request()->get('channel') ?? 'all';
$this->channel = Channel::find($this->channel);
$this->channel = $this->channel ? $this->channel->code : 'all';
}
public function prepareQueryBuilder()
{
/* finding channel name */
$this->channel = Channel::find($this->channel);
$this->channel = $this->channel ? $this->channel->code : 'all';
/* query builder */
$queryBuilder = DB::table('product_flat')
->leftJoin('products', 'product_flat.product_id', '=', 'products.id')