Merge branch 'azfar_dev'
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user