芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/myvyralapp.com/bck/app/Http/Controllers/Api/Merchant/TransactionController.php
PaymentGatewayConst::TYPEMONEYOUT, 'merchant-payment' => PaymentGatewayConst::MERCHANTPAYMENT, 'received-payment' => PaymentGatewayConst::TYPEMAKEPAYMENT, 'add-sub-balance' => PaymentGatewayConst::TYPEADDSUBTRACTBALANCE, ]; if(!array_key_exists($slug,$values)) return abort(404); return $values[$slug]; } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index($slug = null) { $moneyOut = Transaction::merchantAuth()->moneyOut()->orderByDesc("id")->get(); $merchant_payment = Transaction::merchantAuth()->merchantPayment()->orderByDesc("id")->get(); $make_payment = Transaction::merchantAuth()->makePayment()->orderByDesc("id")->get(); $addSubBalance = Transaction::merchantAuth()->addSubBalance()->orderByDesc("id")->get(); $transactions = [ 'money_out' => MoneyOutLogs::collection($moneyOut), 'merchant_payment' => MerchantPaymentLogs::collection($merchant_payment), 'make_payment' => MakePaymentLogs::collection($make_payment), 'add_sub_balance' => AddSubBalanceLogs::collection($addSubBalance), ]; $transactions = (object)$transactions; $transaction_types = [ 'money_out' => PaymentGatewayConst::TYPEMONEYOUT, 'merchant_payment' => PaymentGatewayConst::MERCHANTPAYMENT, 'received_payment' => PaymentGatewayConst::TYPEMAKEPAYMENT, 'add_sub_balance' => PaymentGatewayConst::TYPEADDSUBTRACTBALANCE, ]; $transaction_types = (object)$transaction_types; $data =[ 'transaction_types' => $transaction_types, 'transactions'=> $transactions, ]; $message = ['success'=>['All Transactions']]; return Helpers::success($data,$message); } }