add shipping rules

This commit is contained in:
Ludovic CANDELLIER
2023-07-16 14:45:42 +02:00
parent 72a7b270f9
commit 0879b0abf0
459 changed files with 6219 additions and 5416 deletions

View File

@@ -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);
}