芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/kwesioben.com/paymoney/app/DataTables/Admin/UserRolesDataTable.php
query(); return datatables() ->of($role) ->addColumn('name', function ($role) { return (Common::has_permission(auth('admin')->user()->id, 'edit_group')) ? '
' . ucfirst($role->name) . '
' : ucfirst($role->name); }) ->editColumn('display_name', function ($role) { return ucfirst($role->display_name); }) ->editColumn('description', function ($role) { return ucfirst($role->description); }) ->editColumn('customer_type', function ($role) { return ucfirst($role->customer_type); }) ->editColumn('is_default', function ($role) { return isDefault($role->is_default); }) ->addColumn('action', function ($role) { $edit = (Common::has_permission(auth('admin')->user()->id, 'edit_group')) ? '
' : ''; $delete = (Common::has_permission(auth('admin')->user()->id, 'delete_group')) ? '
' : ''; return $edit . $delete; }) ->rawColumns(['name', 'is_default', 'action']) ->make(true); } public function query() { $role = Role::where(['user_type' => 'User'])->select(); return $this->applyScopes($role); } public function html() { return $this->builder() ->addColumn(['data' => 'id', 'name' => 'roles.id', 'title' => __('ID'), 'searchable' => false, 'visible' => false]) ->addColumn(['data' => 'name', 'name' => 'roles.name', 'title' => __('Name')]) ->addColumn(['data' => 'display_name', 'name' => 'roles.display_name', 'title' => __('Display Name')]) ->addColumn(['data' => 'description', 'name' => 'roles.description', 'title' => __('Description')]) ->addColumn(['data' => 'customer_type', 'name' => 'roles.customer_type', 'title' => __('User Type')]) //new ->addColumn(['data' => 'is_default', 'name' => 'roles.is_default', 'title' => __('Default')]) ->addColumn(['data' => 'action', 'name' => 'action', 'title' => __('Action'), 'orderable' => false, 'searchable' => false]) ->parameters(dataTableOptions()); } }