芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/rentandbuyrealty.com/rentandbuyrealty.com/app/Http/Controllers/PaymentController.php
with('customer')->orderBy($sort, $order); if (isset($_GET['search']) && !empty($_GET['search'])) { $search = $_GET['search']; $sql->wherehas('customer', function ($q) use ($search) { $q->where('name', 'LIKE', "%$search%"); })->orwherehas('package', function ($q1) use ($search) { $q1->where('name', 'LIKE', "%$search%"); })->orwhere('transaction_id', 'LIKE', "%$search%")->orwhere('amount', 'LIKE', "%$search%"); } $total = $sql->count(); if (isset($_GET['limit'])) { $sql->skip($offset)->take($limit); } $res = $sql->get(); // return $res; $bulkData = array(); $bulkData['total'] = $total; $rows = array(); $tempRow = array(); $count = 1; $operate = ''; $tempRow['type'] = ''; $parameter_name_arr = []; foreach ($res as $row) { $tempRow['id'] = $row->id; $tempRow['customer_name'] = $row->customer->name; $tempRow['package_name'] = $row->package->name; $tempRow['amount'] = $row->amount; $tempRow['transaction_id'] = $row->transaction_id; $tempRow['payment_date'] = date('d-m-Y', strtotime($row->created_at)); $tempRow['payment_gateway'] = $row->payment_gateway; $tempRow['status'] = ($row->status == '0') ? '
Fail
' : '
Success
'; $rows[] = $tempRow; $count++; } $bulkData['rows'] = $rows; return response()->json($bulkData); } }