Merge branch 'amir_dev' into 'main'

merge api payment + export data lelong TBC

See merge request online-sistem1/lelong!164
This commit is contained in:
Nur Izzati Zulkifli
2022-08-17 01:20:06 +00:00
8 changed files with 134 additions and 318 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:gzIRvKsu47COMLPeoVaPKxXgiTqulR9xVskRF4Wroro=
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
API_URL=https://api.e-arrahn.com.my/lelong/
API_URL=https://api_arrahn.test/lelong/
API_VERIFY = false
LOG_CHANNEL=stack
View File
-299
View File
@@ -1,299 +0,0 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:gzIRvKsu47COMLPeoVaPKxXgiTqulR9xVskRF4Wroro=
APP_DEBUG=true
APP_URL=http://localhost
API_URL=https://api_arrahn.test/lelong/
API_VERIFY = true
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=lelong
DB_USERNAME=root
DB_PASSWORD=G0dz!ll4@2020
DB_CONNECTION_MAIN=mysql
DB_HOST_MAIN=192.168.0.101
DB_PORT_MAIN=3306
DB_DATABASE_MAIN=online_arrahn
DB_USERNAME_MAIN=root
DB_PASSWORD_MAIN=G0dz!ll42020
DB_CONNECTION_KB2=mysql
DB_HOST_KB2=192.168.0.101
DB_PORT_KB2=3306
DB_DATABASE_KB2=kb2
DB_USERNAME_KB2=root
DB_PASSWORD_KB2=G0dz!ll42020
DB_CONNECTION_WCY=mysql
DB_HOST_WCY=192.168.0.101
DB_PORT_WCY=3306
DB_DATABASE_WCY=wcy
DB_USERNAME_WCY=root
DB_PASSWORD_WCY=G0dz!ll42020
DB_CONNECTION_1STOP=mysql
DB_HOST_1STOP=192.168.0.101
DB_PORT_1STOP=3306
DB_DATABASE_1STOP=1stop
DB_USERNAME_1STOP=root
DB_PASSWORD_1STOP=G0dz!ll42020
DB_CONNECTION_020301=mysql
DB_HOST_020301=192.168.0.101
DB_PORT_020301=3306
DB_DATABASE_020301=jlwt
DB_USERNAME_020301=root
DB_PASSWORD_020301=G0dz!ll42020
DB_CONNECTION_WB=mysql
DB_HOST_WB=192.168.0.101
DB_PORT_WB=3306
DB_DATABASE_WB=wb
DB_USERNAME_WB=root
DB_PASSWORD_WB=G0dz!ll42020
DB_CONNECTION_ALS=mysql
DB_HOST_ALS=192.168.0.101
DB_PORT_ALS=3306
DB_DATABASE_ALS=klanas
DB_USERNAME_ALS=root
DB_PASSWORD_ALS=G0dz!ll42020
DB_CONNECTION_020306=mysql
DB_HOST_020306=192.168.0.101
DB_PORT_020306=3306
DB_DATABASE_020306=pputeh
DB_USERNAME_020306=root
DB_PASSWORD_020306=G0dz!ll42020
DB_CONNECTION_ARM=mysql
DB_HOST_ARM=192.168.0.101
DB_PORT_ARM=3306
DB_DATABASE_ARM=machang
DB_USERNAME_ARM=root
DB_PASSWORD_ARM=G0dz!ll42020
DB_CONNECTION_KB1=mysql
DB_HOST_KB1=192.168.0.101
DB_PORT_KB1=3306
DB_DATABASE_KB1=kb1
DB_USERNAME_KB1=root
DB_PASSWORD_KB1=G0dz!ll42020
DB_CONNECTION_APM=mysql
DB_HOST_APM=192.168.0.101
DB_PORT_APM=3306
DB_DATABASE_APM=pmas
DB_USERNAME_APM=root
DB_PASSWORD_APM=G0dz!ll42020
DB_CONNECTION_010311=mysql
DB_HOST_010311=192.168.0.101
DB_PORT_010311=3306
DB_DATABASE_010311=gm
DB_USERNAME_010311=root
DB_PASSWORD_010311=G0dz!ll42020
DB_CONNECTION_GC=mysql
DB_HOST_GC=192.168.0.101
DB_PORT_GC=3306
DB_DATABASE_GC=guchil
DB_USERNAME_GC=root
DB_PASSWORD_GC=G0dz!ll42020
DB_CONNECTION_JLI=mysql
DB_HOST_JLI=192.168.0.101
DB_PORT_JLI=3306
DB_DATABASE_JLI=jeli
DB_USERNAME_JLI=root
DB_PASSWORD_JLI=G0dz!ll42020
DB_CONNECTION_ARP=mysql
DB_HOST_ARP=192.168.0.101
DB_PORT_ARP=3306
DB_DATABASE_ARP=rp
DB_USERNAME_ARP=root
DB_PASSWORD_ARP=G0dz!ll42020
DB_CONNECTION_010621=mysql
DB_HOST_010621=192.168.0.101
DB_PORT_010621=3306
DB_DATABASE_010621=ktn
DB_USERNAME_010621=root
DB_PASSWORD_010621=G0dz!ll42020
DB_CONNECTION_010136=mysql
DB_HOST_010136=192.168.0.101
DB_PORT_010136=3306
DB_DATABASE_010136=pg
DB_USERNAME_010136=root
DB_PASSWORD_010136=G0dz!ll42020
DB_CONNECTION_011235=mysql
DB_HOST_011235=192.168.0.101
DB_PORT_011235=3306
DB_DATABASE_011235=skudai
DB_USERNAME_011235=root
DB_PASSWORD_011235=G0dz!ll42020
DB_CONNECTION_011227=mysql
DB_HOST_011227=192.168.0.101
DB_PORT_011227=3306
DB_DATABASE_011227=pttn
DB_USERNAME_011227=root
DB_PASSWORD_011227=G0dz!ll42020
DB_CONNECTION_010620=mysql
DB_HOST_010620=192.168.0.101
DB_PORT_010620=3306
DB_DATABASE_010620=btg
DB_USERNAME_010620=root
DB_PASSWORD_010620=G0dz!ll42020
DB_CONNECTION_010617=mysql
DB_HOST_010617=192.168.0.101
DB_PORT_010617=3306
DB_DATABASE_010617=raub
DB_USERNAME_010617=root
DB_PASSWORD_010617=G0dz!ll42020
DB_CONNECTION_010915=mysql
DB_HOST_010915=192.168.0.101
DB_PORT_010915=3306
DB_DATABASE_010915=kgr
DB_USERNAME_010915=root
DB_PASSWORD_010915=G0dz!ll42020
DB_CONNECTION_011228=mysql
DB_HOST_011228=192.168.0.101
DB_PORT_011228=3306
DB_DATABASE_011228=sdk
DB_USERNAME_011228=root
DB_PASSWORD_011228=G0dz!ll42020
DB_CONNECTION_010219=mysql
DB_HOST_010219=192.168.0.101
DB_PORT_010219=3306
DB_DATABASE_010219=spetani
DB_USERNAME_010219=root
DB_PASSWORD_010219=G0dz!ll42020
DB_CONNECTION_011229=mysql
DB_HOST_011229=192.168.0.101
DB_PORT_011229=3306
DB_DATABASE_011229=tawau
DB_USERNAME_011229=root
DB_PASSWORD_011229=G0dz!ll42020
DB_CONNECTION_011230=mysql
DB_HOST_011230=192.168.0.101
DB_PORT_011230=3306
DB_DATABASE_011230=api2
DB_USERNAME_011230=root
DB_PASSWORD_011230=G0dz!ll42020
DB_CONNECTION_011013=mysql
DB_HOST_011013=192.168.0.101
DB_PORT_011013=3306
DB_DATABASE_011013=kjg
DB_USERNAME_011013=root
DB_PASSWORD_011013=G0dz!ll42020
DB_CONNECTION_011412=mysql
DB_HOST_011412=192.168.0.101
DB_PORT_011412=3306
DB_DATABASE_011412=rlaut
DB_USERNAME_011412=root
DB_PASSWORD_011412=G0dz!ll42020
DB_CONNECTION_011231=mysql
DB_HOST_011231=192.168.0.101
DB_PORT_011231=3306
DB_DATABASE_011231=bfort
DB_USERNAME_011231=root
DB_PASSWORD_011231=G0dz!ll42020
DB_CONNECTION_011232=mysql
DB_HOST_011232=192.168.0.101
DB_PORT_011232=3306
DB_DATABASE_011232=kbelud
DB_USERNAME_011232=root
DB_PASSWORD_011232=G0dz!ll42020
DB_CONNECTION_011234=mysql
DB_HOST_011234=192.168.0.101
DB_PORT_011234=3306
DB_DATABASE_011234=tuaran
DB_USERNAME_011234=root
DB_PASSWORD_011234=G0dz!ll42020
DB_CONNECTION_011233=mysql
DB_HOST_011233=192.168.0.101
DB_PORT_011233=3306
DB_DATABASE_011233=kngau
DB_USERNAME_011233=root
DB_PASSWORD_011233=G0dz!ll42020
DB_CONNECTION_020303=mysql
DB_HOST_020303=192.168.0.101
DB_PORT_020303=3306
DB_DATABASE_020303=tm
DB_USERNAME_020303=root
DB_PASSWORD_020303=G0dz!ll42020
DB_CONNECTION_010618=mysql
DB_HOST_010618=192.168.0.101
DB_PORT_010618=3306
DB_DATABASE_010618=tmlh
DB_USERNAME_010618=root
DB_PASSWORD_010618=G0dz!ll42020
DB_CONNECTION_011237=mysql
DB_HOST_011237=192.168.0.101
DB_PORT_011237=3306
DB_DATABASE_011237=semporna
DB_USERNAME_011237=root
DB_PASSWORD_011237=G0dz!ll42020
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
+38 -15
View File
@@ -482,14 +482,25 @@ class ApiController extends Controller
$index->status = 2; //0-unpaid //1-fee //2-bid
$index->remark = "BERJAYA BAYARAN ONLINE";
$index->update();
$updateTag = LelongBid::where('lelongbid.norujukan', $index->norujukan)->first();
$updateTag->status_payment = 2;
$updateTag->save();
$lelongbidder = $updateTag->lelongbidder;
$lelongbidder->status_payment = 2;
$lelongbidder->save();
// $updateTag = LelongBid::where('lelongbid.norujukan', $index->norujukan)->first();
// $updateTag->status_payment = 2;
// $updateTag->save();
// $lelongbidder = $updateTag->lelongbidder;
// $lelongbidder->status_payment = 2;
// $lelongbidder->payment_id = $index->id;
// $lelongbidder->save();
$updateTagBid = LelongBid::where('norujukan', $index->norujukan)->first();
$updateTagBid->status_payment = 2;
$updateTagBid->save();
$updateTagBidder = LelongBidder::where('lelongbid_id', $updateTagBid->id)
->where('user_id', $resit->user_id)->first();
$updateTagBidder->status_payment = 2;
$updateTagBidder->payment_id = $index->id;
$updateTagBidder->save();
}
event(new PaymentNotify('PAID', $resit->user_id, $payment));
@@ -527,6 +538,7 @@ class ApiController extends Controller
public function bidresponse(Request $request)
{
// dd($request->all());
$http = new HttpMethodsClient(
new GuzzleHttpClient(),
new GuzzleMessageFactory()
@@ -570,19 +582,30 @@ class ApiController extends Controller
->where('user_id', $resit->user_id)
->where('resit_id', $resit->id)
->get();
foreach ($payment as $index) {
$index->status = 2; //0-unpaid //1-fee //2-bid
$index->remark = "BERJAYA BAYARAN ONLINE";
$index->update();
$updateTag = LelongBid::where('lelongbid.norujukan', $index->norujukan)->first();
$updateTag->status_payment = 2;
$updateTag->save();
$lelongbidder = $updateTag->lelongbidder;
$lelongbidder->status_payment = 2;
$lelongbidder->payment_id = $index->id;
$lelongbidder->save();
// $updateTag = LelongBid::where('lelongbid.norujukan', $index->norujukan)->first();
// $updateTag->status_payment = 2;
// $updateTag->save();
// $lelongbidder = $updateTag->lelongbidder;
// $lelongbidder->status_payment = 2;
// $lelongbidder->payment_id = $index->id;
// $lelongbidder->save();
$updateTagBid = LelongBid::where('norujukan', $index->norujukan)->first();
$updateTagBid->status_payment = 2;
$updateTagBid->save();
$updateTagBidder = LelongBidder::where('lelongbid_id', $updateTagBid->id)
->where('user_id', $resit->user_id)->first();
$updateTagBidder->status_payment = 2;
$updateTagBidder->payment_id = $index->id;
$updateTagBidder->save();
}
event(new PaymentNotify('PAID', $resit->user_id, $payment));
+33 -1
View File
@@ -85,10 +85,42 @@ class LelongController extends Controller
// dd($arraydetails);
return view('lelong.senarailelong',compact('lelong', 'arraydetails'));
}
public function exportData($lelongid)
{
$lelong = Lelong::where('id', $lelongid)->first();
$lelongbycaw = Lelong::join('cawangan_lelong', 'lelong.id', '=', 'cawangan_lelong.lelong_id')
->join('cawangan', 'cawangan_lelong.caw_id', '=', 'cawangan.id')
->select('cawangan.caw_name', 'cawangan.caw_code', 'cawangan.id')
->where('lelong.id', $lelongid)
->get();
foreach ($lelongbycaw as $index => $data) {
$lelongbycaw[$index]['lelong'] = $lelong->toArray();
$lelongbid = Lelongbid::join('lelongbidder', 'lelongbid.id', '=', 'lelongbidder.lelongbid_id')
->where('lelong_id', $lelongid)
->where('lelongbid.caw_id', $data['id'])
->where('status_jual', 1)
->where('lelongbidder.status_bidder', 1)
->where('lelongbidder.status_payment', 1)
->get();
foreach ($lelongbid as $index2 => $value) {
$lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $value['id'])
->get();
$lelongbid[$index2]['lelongbidmarhun'] = $lelongbidmarhun->toArray();
}
$lelongbycaw[$index]['lelongbid'] = $lelongbid->toArray();
}
return view('lelong.exportData', compact('lelongbycaw', 'lelong'));
}
public function show(Request $request, $id)
{
$lelong_id = $id;
@@ -0,0 +1,58 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="card">
<div class="card-header">Export Data Lelong</div>
<div class="card-body">
<a href="javascript:window.history.go(-1);" class="btn btn-light">
<h3><i class="fas fa-arrow-alt-circle-left"></i></h3>
</a>
<p>ID Lelong: {{$lelong['id']}}</p>
<p>Tarikh Lelong: {{$lelong['tarikh_lelong']}}</p>
<p>Masa Mula Lelong: {{$lelong['masamula_lelong']}}</p>
<p>Masa Tamat Lelong: {{$lelong['masatamat_lelong']}}</p>
<table class="table table-striped table-xl text-center" id="senarailelongtaklaku" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>Bil</th>
<th>Kod Cawangan</th>
<th>Cawangan</th>
<th>Tindakan</th>
</tr>
</thead>
<tbody>
@foreach($lelongbycaw as $data)
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$data['caw_code']}}</td>
<td>
{{$data['caw_name']}}
{{--<table class="table">
<thead class="bg-secondary text-white">
<tr>
<th>No Rujukan</th>
<th>Marhun</th>
</tr>
</thead>
<tbody>
@foreach($data['lelongbid'] as $value)
<tr>
<td>{{$value['norujukan']}}</td>
<td>{{$value['marhun']}}</td>
</tr>
@endforeach
</tbody>
</table>--}}
</td>
<td><button class="btn btn-primary">EXPORT</button></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@@ -88,7 +88,7 @@
<button class="btn btn-info btn-sm" disabled>JANA PEMENANG</button>
@elseif($data['laporan']['sts_lelong'] == 3)
<button class="btn btn-success btn-sm" disabled>LELONG SELESAI</button>
<button class="btn btn-primary btn-sm">EXPORT DATA LELONG</button>
<a href="{{ route('lelong.exportDataByCawangan', $data['laporan']['lelong_id']) }}" class="btn btn-primary btn-sm">EXPORT <i class="fas fa-file-export"></i></a>
@endif
@endhasrole
</td>
+2
View File
@@ -166,6 +166,8 @@ Route::group(['prefix'=>'lelong'], function () {
Route::get('/lapbrglelpembida/{lelong_id}',['as'=>'lelong.lapbrglelpembida','uses'=>'LelongController@lapbrglelpembida']);
Route::post('/pdflapbrglelpembida',['as'=>'lelong.pdflapbrglelpembida','uses'=>'LelongController@pdflapbrglelpembida']);
Route::get('/export-data/{lelongid}', ['as'=>'lelong.exportDataByCawangan', 'uses'=>'LelongController@exportData']);
});
Route::group(['middleware' => ['permission:pengesahanpembayaranpc']], function () {