芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/tblonline.org/app/Http/Controllers/TransactionController.php
with('user') ->with('currency') ->orderBy("transactions.id", "desc"); return Datatables::eloquent($transactions) ->filter(function ($query) use ($request) { if ($request->has('status')) { $query->where('status', $request->status); } }, true) ->editColumn('user.name', function ($transaction) { return '
' . $transaction->user->name . '
' . $transaction->user->email; }) ->editColumn('amount', function ($transaction) { $symbol = $transaction->dr_cr == 'dr' ? '-' : '+'; $class = $transaction->dr_cr == 'dr' ? 'text-danger' : 'text-success'; return '
' . $symbol . ' ' . decimalPlace($transaction->amount, currency($transaction->currency->name)) . '
'; }) ->editColumn('dr_cr', function ($transaction) { return strtoupper($transaction->dr_cr); }) ->editColumn('type', function ($transaction) { return str_replace('_', ' ', $transaction->type); }) ->editColumn('status', function ($transaction) { return transaction_status($transaction->status); }) ->addColumn('action', function ($transaction) { $actions = '
' . _lang('Details') . '
'; return $actions; }) ->setRowId(function ($transaction) { return "row_" . $transaction->id; }) ->rawColumns(['user.name', 'status', 'amount', 'action']) ->make(true); } }