Merge branch 'faiqahzaman' of https://gitlab.com/azfararsyad/lelong into faiqahzaman

This commit is contained in:
faiqahzaman
2022-03-09 16:55:35 +08:00
4 changed files with 44 additions and 11 deletions
+2 -2
View File
@@ -411,7 +411,7 @@ class ApiController extends Controller
$payment->resit_id = $resitoriginal->id;
$payment->status_payment_opt = 2; //bayar secara online 2
$payment->status = 1; //fee rm10 - 1
$payment->remark = 'BAYARAN ONLINCE';
$payment->remark = 'BAYARAN ONLINE';
$payment->save();
event(new PaymentNotify('PAID',$resitoriginal->user_id));
@@ -474,7 +474,7 @@ class ApiController extends Controller
$payment->resit_id = $resitoriginal->id;
$payment->status_payment_opt = 2; //bayar secara online 2
$payment->status = 1; //fee rm10 - 1
$payment->remark = 'BAYARAN ONLINCE';
$payment->remark = 'BAYARAN ONLINE';
$payment->save();
event(new PaymentNotify('PAID',$resit->user_id));
@@ -245,4 +245,44 @@ class LelongMobileController extends Controller
return response()->json($response, 201);
}
public function history($user_id)
{
$lelongs_id = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
->where('lelongbidder.user_id',$user_id)->select('lelongbid.lelong_id')->groupBy('lelongbid.lelong_id')->get();
$arrayID = [];
foreach($lelongs_id as $lelong_id)
{
array_push($arrayID,$lelong_id);
}
$lelongs = Lelong::whereIn('id',$arrayID)->get()->toArray();
// dd($lelongs);
foreach($lelongs as $index1 => $lelong)
{
// dd($lelong['id']);
$datalelongbidder = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
->where('lelongbid.lelong_id',$lelong['id'])->get();
$payment = Payment::join('resit', 'payment.resit_id', '=', 'resit.id')
->where('payment.lelong_id',$lelong['id'])
->where('payment.user_id',$user_id)
->where('resit.resit_type',2)
->first();
if($payment->status == 'PAID')
{
$status = 'Selesai';
}
else
{
$status = 'Belum Selesai';
}
$lelongs[$index1]['total'] = $datalelongbidder->sum('hargabida');
$lelongs[$index1]['status'] = $status;
$lelongs[$index1]['detail_sag'] = $datalelongbidder;
}
return response()->json($lelongs, 201);
}
}
+1 -9
View File
@@ -10,7 +10,7 @@
<p>{{ $message }}</p>
</div>
@endif
<form id="exportform" action="{{route('marhun.exportmarhundetails')}}" method="POST">
<form id="exportform" method="POST">
@csrf
<input type="hidden" name="type" value="User">
<input type="hidden" name="lelongbid" value="{{ $lelongbid->id }}">
@@ -170,14 +170,6 @@
action: function ( e, dt, node, config ) {
alert( 'Button activated' );
}
},
{
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
titleAttr: 'Export Marhun Details to PDF',
text: '<i class="fas fa-download"></i>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
}
}
]
});
+1
View File
@@ -60,6 +60,7 @@ Route::group(['middleware' => ['auth:sanctum']], function () {
Route::get('/lelongDetails/cawangan', [LelongMobileController::class, 'searchLelByCaw']);
Route::get('/karat', [LelongMobileController::class, 'getListKarat']);
Route::get('/result/{user_id}', [LelongMobileController::class, 'bidresult']);
Route::get('/history/{user_id}', [LelongMobileController::class, 'history']);
// Lelong => Bidder
Route::post('/bidder/biditem', [LelongMobileController::class, 'bidderSelectBidItem']);