芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/kwesioben.com/paymoney/app/DataTables/Admin/MerchantGroupsDataTable.php
query(); return datatables() ->of($role) ->addColumn('name', function ($merchantGroup) { return (Common::has_permission(auth('admin')->user()->id, 'edit_merchant_group')) ? '
' . ucfirst($merchantGroup->name) . '
' : ucfirst($merchantGroup->name); }) ->editColumn('description', function ($merchantGroup) { return ucfirst($merchantGroup->description); }) ->editColumn('fee', function ($merchantGroup) { return formatNumber($merchantGroup->fee); }) ->editColumn('fee_bearer', function ($merchantGroup) { return $merchantGroup->fee_bearer; }) ->editColumn('is_default', function ($merchantGroup) { return isDefault($merchantGroup->is_default); }) ->addColumn('action', function ($merchantGroup) { $edit = (Common::has_permission(auth('admin')->user()->id, 'edit_merchant_group')) ? '
' : ''; $delete = (Common::has_permission(auth('admin')->user()->id, 'delete_merchant_group')) ? '
' : ''; return $edit . $delete; }) ->rawColumns(['name', 'is_default', 'action']) ->make(true); } public function query() { $merchantGroup = MerchantGroup::select(); return $this->applyScopes($merchantGroup); } public function html() { return $this->builder() ->addColumn([ 'data' => 'id', 'name' => 'merchant_groups.id', 'title' => __('ID'), 'searchable' => false, 'visible' => false ]) ->addColumn([ 'data' => 'name', 'name' => 'merchant_groups.name', 'title' => __('Name') ]) ->addColumn([ 'data' => 'description', 'name' => 'merchant_groups.description', 'title' => __('Description') ]) ->addColumn([ 'data' => 'fee', 'name' => 'merchant_groups.fee', 'title' => __('Fee (%)') ]) ->addColumn([ 'data' => 'fee_bearer', 'name' => 'merchant_groups.fee_bearer', 'title' => __('Fee Bearer') ]) ->addColumn([ 'data' => 'is_default', 'name' => 'merchant_groups.is_default', 'title' => __('Default') ]) ->addColumn([ 'data' => 'action', 'name' => 'action', 'title' => __('Action'), 'orderable' => false, 'searchable' => false ]) ->parameters(dataTableOptions()); } }