add shipping rules
This commit is contained in:
@@ -2,11 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Admin\Core;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
|
||||
use App\Models\Core\Comment;
|
||||
use App\Repositories\Core\Comments;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CommentsDataTable extends DataTable
|
||||
{
|
||||
@@ -20,6 +18,7 @@ class CommentsDataTable extends DataTable
|
||||
public function query(Comment $model)
|
||||
{
|
||||
$model = $model::with(['user'])->select('*');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Botanic;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Botanic\Family;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class FamiliesDataTable extends DataTable
|
||||
{
|
||||
@@ -12,7 +12,8 @@ class FamiliesDataTable extends DataTable
|
||||
|
||||
public function query(Family $model)
|
||||
{
|
||||
$model = $model::withCount(['genres','species','varieties']);
|
||||
$model = $model::withCount(['genres', 'species', 'varieties']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Botanic;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Botanic\Genre;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class GenresDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class GenresDataTable extends DataTable
|
||||
public function query(Genre $model)
|
||||
{
|
||||
$model = $model::with('family')->withCount('species')->withCount('varieties');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -23,6 +24,7 @@ class GenresDataTable extends DataTable
|
||||
return $genre->family ? $genre->family->name : '';
|
||||
})
|
||||
->rawColumns(['genre_name', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Datatables\Botanic;
|
||||
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Botanic\Specie;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class SpeciesDataTable extends DataTable
|
||||
{
|
||||
@@ -15,6 +15,7 @@ class SpeciesDataTable extends DataTable
|
||||
public function query(Specie $model)
|
||||
{
|
||||
$model = $model::withCount(['images', 'varieties', 'tags'])->with(['genre', 'image', 'tags']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -32,9 +33,11 @@ class SpeciesDataTable extends DataTable
|
||||
foreach ($specie->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['thumb', 'tags2', 'genre_name', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Datatables\Botanic;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Botanic\Variety;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class VarietiesDataTable extends DataTable
|
||||
{
|
||||
@@ -15,6 +15,7 @@ class VarietiesDataTable extends DataTable
|
||||
public function query(Variety $model)
|
||||
{
|
||||
$model = $model::joinRelationship('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with(['image', 'Specie', 'tags'])->withCount(['Articles', 'tags', 'images']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -29,13 +30,14 @@ class VarietiesDataTable extends DataTable
|
||||
foreach ($variety->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['thumb', 'tags2', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -4,30 +4,38 @@ namespace App\Datatables;
|
||||
|
||||
use Yajra\DataTables\Html\Button;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Html\Editor\Editor;
|
||||
use Yajra\DataTables\Html\Editor\Fields;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class ParentDataTable extends DataTable
|
||||
{
|
||||
public $autoWidth = false;
|
||||
|
||||
public $colReorder = false;
|
||||
|
||||
public $fixedColumns = false;
|
||||
|
||||
public $fixedHeader = false;
|
||||
|
||||
public $rowReorder = false;
|
||||
|
||||
public $rowReorderSelector; // ['selector' => 'tr']
|
||||
|
||||
public $scrollCollapse = false;
|
||||
|
||||
public $scrollX = false;
|
||||
|
||||
public $sortedColumn = 0;
|
||||
|
||||
public $sortedOrder = 'asc';
|
||||
|
||||
public $stateSave = true;
|
||||
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
return $this->modifier(datatables()->eloquent($query));
|
||||
@@ -41,7 +49,7 @@ class ParentDataTable extends DataTable
|
||||
/**
|
||||
* Add buttons DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function addButtons($datatables)
|
||||
@@ -54,6 +62,7 @@ class ParentDataTable extends DataTable
|
||||
$buttons = '';
|
||||
$buttons .= self::getButtonEdit();
|
||||
$buttons .= self::getButtonDel();
|
||||
|
||||
return $buttons;
|
||||
// return view('components.datatables.buttons.row_action');
|
||||
}
|
||||
@@ -86,20 +95,20 @@ class ParentDataTable extends DataTable
|
||||
|
||||
public static function isFilteredByField($field)
|
||||
{
|
||||
return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false);
|
||||
return (request()->has('filters.'.$field)) ? request()->input('filters.'.$field) : (request()->has($field) ? request()->input($field) : false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Family $model
|
||||
* @param \App\Family $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function buildQuery($model)
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
@@ -107,7 +116,7 @@ class ParentDataTable extends DataTable
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->buildHtml(strtolower($this->model_name) . '-table');
|
||||
return $this->buildHtml(strtolower($this->model_name).'-table');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,19 +126,20 @@ class ParentDataTable extends DataTable
|
||||
*/
|
||||
public function buildHtml($table_id = false, $selector = false)
|
||||
{
|
||||
$table_id = $table_id ? $table_id : strtolower($this->model_name) . '-table';
|
||||
$selector = $selector ? $selector : '#' . $this->model_name . '-filters';
|
||||
$table_id = $table_id ? $table_id : strtolower($this->model_name).'-table';
|
||||
$selector = $selector ? $selector : '#'.$this->model_name.'-filters';
|
||||
|
||||
return $this->builder()
|
||||
->setTableId($table_id)
|
||||
->parameters($this->getParameters())
|
||||
->columns($this->getColumns())
|
||||
->ajax([
|
||||
'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }',
|
||||
'url' => isset($this->url) ? $this->url : ''
|
||||
])
|
||||
->dom($this->getDom())
|
||||
->orderBy($this->sortedColumn, $this->sortedOrder)
|
||||
->buttons($this->getButtons());
|
||||
->setTableId($table_id)
|
||||
->parameters($this->getParameters())
|
||||
->columns($this->getColumns())
|
||||
->ajax([
|
||||
'data' => 'function(d) { d.filters = $("'.$selector.'").serializeJSON(); }',
|
||||
'url' => isset($this->url) ? $this->url : '',
|
||||
])
|
||||
->dom($this->getDom())
|
||||
->orderBy($this->sortedColumn, $this->sortedOrder)
|
||||
->buttons($this->getButtons());
|
||||
}
|
||||
|
||||
public function getButtons()
|
||||
@@ -138,7 +148,7 @@ class ParentDataTable extends DataTable
|
||||
// Button::make('export'),
|
||||
Button::make('print'),
|
||||
Button::make('colvis'),
|
||||
Button::make('columnsToggle')
|
||||
Button::make('columnsToggle'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -153,11 +163,12 @@ class ParentDataTable extends DataTable
|
||||
'searchDelay' => 500,
|
||||
'scrollX' => $this->scrollX,
|
||||
'scrollCollapse' => $this->scrollCollapse,
|
||||
'stateSave' => $this->stateSave
|
||||
'stateSave' => $this->stateSave,
|
||||
];
|
||||
if ($this->rowReorder) {
|
||||
$data['rowReorder'] = ['selector' => $this->rowReorderSelector];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -165,8 +176,9 @@ class ParentDataTable extends DataTable
|
||||
{
|
||||
$dom = '';
|
||||
// $dom .= $this->getDatatablesHeaderDefault();
|
||||
$dom .= "rt";
|
||||
$dom .= 'rt';
|
||||
$dom .= $this->getDatatablesFooterDefault();
|
||||
|
||||
return $dom;
|
||||
}
|
||||
|
||||
@@ -189,8 +201,9 @@ class ParentDataTable extends DataTable
|
||||
. '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>';
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
||||
|
||||
return $dom;
|
||||
// return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>';
|
||||
}
|
||||
@@ -217,6 +230,6 @@ class ParentDataTable extends DataTable
|
||||
*/
|
||||
protected function buildFilename($name)
|
||||
{
|
||||
return $name . '_' . date('YmdHis');
|
||||
return $name.'_'.date('YmdHis');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\ArticleNature;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class ArticleNaturesDataTable extends DataTable
|
||||
{
|
||||
@@ -14,16 +14,18 @@ class ArticleNaturesDataTable extends DataTable
|
||||
public function query(ArticleNature $model)
|
||||
{
|
||||
$model = $model::withCount('Articles');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn('product_type', function (ArticleNature $nature) {
|
||||
return ArticleNatures::getProductTypeName($nature->product_type);
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
->editColumn('product_type', function (ArticleNature $nature) {
|
||||
return ArticleNatures::getProductTypeName($nature->product_type);
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Article;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class ArticlesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'articles';
|
||||
|
||||
public $sortedColumn = 2;
|
||||
|
||||
public function query(Article $model)
|
||||
@@ -20,70 +20,77 @@ class ArticlesDataTable extends DataTable
|
||||
$model = self::filterByArticleNature($model);
|
||||
$model = self::filterByCategory($model);
|
||||
$model = self::filterByTag($model);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public static function filterByArticleNature($model, $article_nature_id = false)
|
||||
{
|
||||
$article_nature_id = $article_nature_id ? $article_nature_id : self::isFilteredByField('article_nature_id');
|
||||
|
||||
return $article_nature_id ? $model->byArticleNature($article_nature_id) : $model;
|
||||
}
|
||||
|
||||
public static function filterByCategory($model, $category_id = false)
|
||||
{
|
||||
$category_id = $category_id ? $category_id : self::isFilteredByField('category_id');
|
||||
|
||||
return $category_id ? $model->byCategory($category_id) : $model;
|
||||
}
|
||||
|
||||
public static function filterByTag($model, $tag_id = false)
|
||||
{
|
||||
$tag_id = $tag_id ? $tag_id : self::isFilteredByField('tag_id');
|
||||
|
||||
return $tag_id ? $model->byTag($tag_id) : $model;
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn('visible', function (Article $article) {
|
||||
return view("components.form.toggle", [
|
||||
'name' => 'visible',
|
||||
'value' => $article->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $article->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->editColumn('homepage', function (Article $article) {
|
||||
return view("components.form.toggle", [
|
||||
'name' => 'homepage',
|
||||
'value' => $article->homepage,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $article->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'homepage',
|
||||
]);
|
||||
})
|
||||
->editColumn('thumb', function (Article $article) {
|
||||
$image = Articles::getFullImageByArticle($article);
|
||||
return Articles::getThumb($image, false);
|
||||
})
|
||||
->editColumn('article_nature.name', function (Article $article) {
|
||||
return $article->article_nature ? $article->article_nature->name : '';
|
||||
})
|
||||
->editColumn('tags2', function (Article $article) {
|
||||
$html = '';
|
||||
foreach ($article->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
return $html;
|
||||
})
|
||||
->editColumn('images_count2', function (Article $article) {
|
||||
return Articles::countFullImagesByArticle($article);
|
||||
})
|
||||
->rawColumns(['tags2', 'thumb', 'action']);
|
||||
->editColumn('visible', function (Article $article) {
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'visible',
|
||||
'value' => $article->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id='.$article->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->editColumn('homepage', function (Article $article) {
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'homepage',
|
||||
'value' => $article->homepage,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id='.$article->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'homepage',
|
||||
]);
|
||||
})
|
||||
->editColumn('thumb', function (Article $article) {
|
||||
$image = Articles::getFullImageByArticle($article);
|
||||
|
||||
return Articles::getThumb($image, false);
|
||||
})
|
||||
->editColumn('article_nature.name', function (Article $article) {
|
||||
return $article->article_nature ? $article->article_nature->name : '';
|
||||
})
|
||||
->editColumn('tags2', function (Article $article) {
|
||||
$html = '';
|
||||
foreach ($article->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->editColumn('images_count2', function (Article $article) {
|
||||
return Articles::countFullImagesByArticle($article);
|
||||
})
|
||||
->rawColumns(['tags2', 'thumb', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Category;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CategoriesDataTable extends DataTable
|
||||
{
|
||||
@@ -13,46 +13,49 @@ class CategoriesDataTable extends DataTable
|
||||
public function query(Category $model)
|
||||
{
|
||||
$model = $model::notRoot()->with(['tags.articles'])->withCount(['articles', 'tags']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn('name', function (Category $category) {
|
||||
return $category->name;
|
||||
})
|
||||
->editColumn('visible', function (Category $category) {
|
||||
return view("components.form.toggle", [
|
||||
'name' => 'visible',
|
||||
'value' => $category->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $category->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->editColumn('homepage', function (Category $category) {
|
||||
return view("components.form.toggle", [
|
||||
'name' => 'homepage',
|
||||
'value' => $category->homepage,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $category->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'homepage',
|
||||
]);
|
||||
})
|
||||
->editColumn('articles_tagged_count', function (Category $category) {
|
||||
$count = 0;
|
||||
foreach ($category->tags as $tag) {
|
||||
$nb = collect($tag->articles)->count();
|
||||
$count += $nb;
|
||||
}
|
||||
return $count;
|
||||
})
|
||||
->rawColumns(['visible', 'action']);
|
||||
->editColumn('name', function (Category $category) {
|
||||
return $category->name;
|
||||
})
|
||||
->editColumn('visible', function (Category $category) {
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'visible',
|
||||
'value' => $category->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id='.$category->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->editColumn('homepage', function (Category $category) {
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'homepage',
|
||||
'value' => $category->homepage,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id='.$category->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'homepage',
|
||||
]);
|
||||
})
|
||||
->editColumn('articles_tagged_count', function (Category $category) {
|
||||
$count = 0;
|
||||
foreach ($category->tags as $tag) {
|
||||
$nb = collect($tag->articles)->count();
|
||||
$count += $nb;
|
||||
}
|
||||
|
||||
return $count;
|
||||
})
|
||||
->rawColumns(['visible', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\CustomerAddress;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomerAddressesDataTable extends DataTable
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Customer;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomerDeliveriesDataTable extends DataTable
|
||||
{
|
||||
|
||||
@@ -2,25 +2,27 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Order;
|
||||
use App\Repositories\Shop\InvoicePayments;
|
||||
use App\Repositories\Shop\Orders;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomerOrdersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'orders';
|
||||
|
||||
public $sortedColumn = 1;
|
||||
|
||||
public $sortedOrder = 'desc';
|
||||
|
||||
public $stateSave = true;
|
||||
|
||||
public function query(Order $model)
|
||||
{
|
||||
$customer_id = Auth::id();
|
||||
$model = $model->byCustomer($customer_id)->with(['delivery']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -37,6 +39,7 @@ class CustomerOrdersDataTable extends DataTable
|
||||
return InvoicePayments::getPaymentType($order->payment_type);
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Customer;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomersDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class CustomersDataTable extends DataTable
|
||||
public function query(Customer $model)
|
||||
{
|
||||
$model = $model->with('addresses');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Delivery;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class DeliveriesDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class DeliveriesDataTable extends DataTable
|
||||
public function query(Delivery $model)
|
||||
{
|
||||
$model = $model->with('sale_channel');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -20,18 +21,19 @@ class DeliveriesDataTable extends DataTable
|
||||
{
|
||||
$datatables
|
||||
->editColumn('active', function (Delivery $delivery) {
|
||||
return view("components.form.toggle", [
|
||||
return view('components.form.toggle', [
|
||||
'value' => $delivery->active,
|
||||
'on' => __('active'),
|
||||
'off' => __('inactive'),
|
||||
'meta' => 'data-id=' . $delivery->id,
|
||||
'meta' => 'data-id='.$delivery->id,
|
||||
'size' => 'sm',
|
||||
]);
|
||||
})
|
||||
->editColumn('address', function (Delivery $delivery) {
|
||||
return $delivery->address . ' ' . $delivery->zipcode . ' ' . $delivery->city;
|
||||
return $delivery->address.' '.$delivery->zipcode.' '.$delivery->city;
|
||||
})
|
||||
->rawColumns(['active', 'address', 'action']);
|
||||
->rawColumns(['active', 'address', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
27
app/Datatables/Shop/DeliveryPackagesDataTable.php
Normal file
27
app/Datatables/Shop/DeliveryPackagesDataTable.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\DeliveryPackage;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class DeliveryPackagesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'delivery_packages';
|
||||
|
||||
public function query(DeliveryPackage $model)
|
||||
{
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('weight')->title('Poids'),
|
||||
Column::make('weight_flyer')->title('Flyer'),
|
||||
Column::make('weight_packaging')->title('Packaging'),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Datatables/Shop/DeliveryTypeCalculationsDataTable.php
Normal file
29
app/Datatables/Shop/DeliveryTypeCalculationsDataTable.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\DeliveryTypeCalculation;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class DeliveryTypeCalculationsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'delivery_type_calculations';
|
||||
|
||||
public function query(DeliveryTypeCalculation $model)
|
||||
{
|
||||
$model = $model->with('delivery_type');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('delivery_type.name')->title('Nom'),
|
||||
Column::make('weight')->title('Poids en g')->addClass('text-right'),
|
||||
Column::make('price')->title('Prix')->addClass('text-right'),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
25
app/Datatables/Shop/DeliveryTypesDataTable.php
Normal file
25
app/Datatables/Shop/DeliveryTypesDataTable.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\DeliveryType;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class DeliveryTypesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'delivery_types';
|
||||
|
||||
public function query(DeliveryType $model)
|
||||
{
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Homepage;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class HomepagesDataTable extends DataTable
|
||||
{
|
||||
@@ -18,6 +18,7 @@ class HomepagesDataTable extends DataTable
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables->rawColumns(['text', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Invoice;
|
||||
use App\Repositories\Shop\Invoices;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class InvoicesDataTable extends DataTable
|
||||
{
|
||||
@@ -14,6 +14,7 @@ class InvoicesDataTable extends DataTable
|
||||
public function query(Invoice $model)
|
||||
{
|
||||
$model = $model->with('customer');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -27,9 +28,10 @@ class InvoicesDataTable extends DataTable
|
||||
return $invoice->created_at->toDateTimeString();
|
||||
})
|
||||
->editColumn('customer.last_name', function (Invoice $invoice) {
|
||||
return ($invoice->customer ?? false) ? $invoice->customer->last_name . ' ' . $invoice->customer->first_name : '';
|
||||
return ($invoice->customer ?? false) ? $invoice->customer->last_name.' '.$invoice->customer->first_name : '';
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Shop\Merchandises;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class MerchandisesDataTable extends DataTable
|
||||
{
|
||||
@@ -15,10 +15,10 @@ class MerchandisesDataTable extends DataTable
|
||||
public function query(Merchandise $model)
|
||||
{
|
||||
$model = $model::with(['image', 'tags'])->withCount(['Articles', 'tags', 'images']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
@@ -30,13 +30,14 @@ class MerchandisesDataTable extends DataTable
|
||||
foreach ($merchandise->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['thumb', 'tags2', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -2,33 +2,37 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Offer;
|
||||
use App\Repositories\Shop\Offers;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class OffersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'offers';
|
||||
|
||||
public $sortedColumn = 1;
|
||||
|
||||
public function query(Offer $model)
|
||||
{
|
||||
$model = $model->with(['article.article_nature', 'variation', 'tariff'])->select($model->getTable() . '.*');
|
||||
$model = $model->with(['article.article_nature', 'variation', 'tariff'])->select($model->getTable().'.*');
|
||||
$model = self::filterByArticleNature($model);
|
||||
$model = self::filterByPackage($model);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public static function filterByArticleNature($model, $article_nature_id = false)
|
||||
{
|
||||
$article_nature_id = $article_nature_id ? $article_nature_id : self::isFilteredByField('article_nature_id');
|
||||
|
||||
return $article_nature_id ? $model->byArticleNature($article_nature_id) : $model;
|
||||
}
|
||||
|
||||
public static function filterByPackage($model, $package_id = false)
|
||||
{
|
||||
$package_id = $package_id ? $package_id : self::isFilteredByField('package_id');
|
||||
|
||||
return $package_id ? $model->byPackage($package_id) : $model;
|
||||
}
|
||||
|
||||
@@ -36,10 +40,10 @@ class OffersDataTable extends DataTable
|
||||
{
|
||||
$datatables
|
||||
->editColumn('thumb', function (Offer $offer) {
|
||||
return '<img src="' . Offers::getThumbSrc($offer) . '">';
|
||||
return '<img src="'.Offers::getThumbSrc($offer).'">';
|
||||
})
|
||||
->editColumn('status_id', function (Offer $offer) {
|
||||
return view("components.form.toggle", [
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'status_id',
|
||||
'value' => $offer->status_id,
|
||||
'on' => __('active'),
|
||||
@@ -49,9 +53,10 @@ class OffersDataTable extends DataTable
|
||||
]);
|
||||
})
|
||||
->editColumn('stock_delayed', function (Offer $offer) {
|
||||
return $offer->stock_delayed . ' - ' . $offer->delay_type;
|
||||
return $offer->stock_delayed.' - '.$offer->delay_type;
|
||||
})
|
||||
->rawColumns(['active', 'thumb', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,23 +2,26 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Order;
|
||||
use App\Repositories\Shop\InvoicePayments;
|
||||
use App\Repositories\Shop\Orders;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class OrdersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'orders';
|
||||
|
||||
public $sortedColumn = 1;
|
||||
|
||||
public $sortedOrder = 'desc';
|
||||
|
||||
public $stateSave = true;
|
||||
|
||||
public function query(Order $model)
|
||||
{
|
||||
$model = $model->with(['customer', 'delivery']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -32,12 +35,13 @@ class OrdersDataTable extends DataTable
|
||||
return $order->created_at->toDateTimeString();
|
||||
})
|
||||
->editColumn('customer.last_name', function (Order $order) {
|
||||
return $order->customer->last_name . ' ' . $order->customer->first_name;
|
||||
return $order->customer->last_name.' '.$order->customer->first_name;
|
||||
})
|
||||
->editColumn('payment_type', function (Order $order) {
|
||||
return InvoicePayments::getPaymentType($order->payment_type);
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Package;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class PackagesDataTable extends DataTable
|
||||
{
|
||||
@@ -12,7 +12,8 @@ class PackagesDataTable extends DataTable
|
||||
|
||||
public function query(Package $model)
|
||||
{
|
||||
$model = $model->withCount(['variations','offers']);
|
||||
$model = $model->withCount(['variations', 'offers']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\PriceGenericCategory;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class PriceGenericCategoriesDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class PriceGenericCategoriesDataTable extends DataTable
|
||||
public function query(PriceGenericCategory $model)
|
||||
{
|
||||
$model = $model->withCount('price_generics');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\PriceList;
|
||||
use App\Repositories\Shop\PriceLists;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class PriceListsDataTable extends DataTable
|
||||
{
|
||||
@@ -20,12 +20,14 @@ class PriceListsDataTable extends DataTable
|
||||
{
|
||||
$model = $model->with(['sale_channel', 'price_list_values']);
|
||||
$model = self::filterByTariff($model);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public static function filterByTariff($model, $tariff_id = false)
|
||||
{
|
||||
$tariff_id = $tariff_id ? $tariff_id : self::isFilteredByField('tariff_id');
|
||||
|
||||
return $tariff_id ? $model->byTariff($tariff_id) : $model;
|
||||
}
|
||||
|
||||
@@ -39,6 +41,7 @@ class PriceListsDataTable extends DataTable
|
||||
return view('Admin.Shop.PriceLists.partials.table-prices', ['prices' => $price_list['price_list_values']]);
|
||||
})
|
||||
->rawColumns(['tariff_id', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Producer;
|
||||
use App\Repositories\Shop\Producers;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class ProducersDataTable extends DataTable
|
||||
{
|
||||
@@ -15,10 +15,10 @@ class ProducersDataTable extends DataTable
|
||||
public function query(Producer $model)
|
||||
{
|
||||
$model = $model::with(['image', 'tags'])->withCount(['Merchandises', 'tags', 'images']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
@@ -30,13 +30,14 @@ class ProducersDataTable extends DataTable
|
||||
foreach ($producer->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['thumb', 'tags2', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\SaleChannel;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class SaleChannelsDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class SaleChannelsDataTable extends DataTable
|
||||
public function query(SaleChannel $model)
|
||||
{
|
||||
$model = $model->withCount(['deliveries', 'tariffs']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,36 +2,39 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\TagGroup;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class TagGroupsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tag_groups';
|
||||
|
||||
public $sortedColumn = 2;
|
||||
|
||||
public function query(TagGroup $model)
|
||||
{
|
||||
$model = $model::with('article_family')->withCount('tags');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn('visible', function (TagGroup $tag_group) {
|
||||
return view("components.form.toggle", [
|
||||
'name' => 'visible',
|
||||
'value' => $tag_group->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $tag_group->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->rawColumns(['visible', 'action']);
|
||||
->editColumn('visible', function (TagGroup $tag_group) {
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'visible',
|
||||
'value' => $tag_group->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id='.$tag_group->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->rawColumns(['visible', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Tag;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class TagsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tags';
|
||||
|
||||
public $rowReorder = ['selector' => 'tr'];
|
||||
|
||||
public function query(Tag $model)
|
||||
{
|
||||
$model = $model::with('tag_group')->withCount(['articles', 'shelves', 'species', 'varieties']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -24,6 +26,7 @@ class TagsDataTable extends DataTable
|
||||
return $tag->name;
|
||||
})
|
||||
->rawColumns(['active', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Tariff;
|
||||
use App\Repositories\Shop\Tariffs;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class TariffsDataTable extends DataTable
|
||||
{
|
||||
@@ -14,6 +14,7 @@ class TariffsDataTable extends DataTable
|
||||
public function query(Tariff $model)
|
||||
{
|
||||
$model = $model->with(['sale_channels'])->withCount(['price_lists', 'offers']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -26,11 +27,13 @@ class TariffsDataTable extends DataTable
|
||||
->editColumn('sale_channels2', function (Tariff $tariff) {
|
||||
$html = '';
|
||||
foreach ($tariff->sale_channels as $sale_channel) {
|
||||
$html .= $sale_channel->code . ', ';
|
||||
$html .= $sale_channel->code.', ';
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['sale_channels2', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Unity;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class UnitiesDataTable extends DataTable
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Variation;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class VariationsDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class VariationsDataTable extends DataTable
|
||||
public function query(Variation $model)
|
||||
{
|
||||
$model = $model->with(['package', 'unity'])->withCount('offers');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -23,6 +24,7 @@ class VariationsDataTable extends DataTable
|
||||
return $variation->unity ? $variation->unity->value : '';
|
||||
})
|
||||
->rawColumns(['description', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user