Add notification lelong online

This commit is contained in:
Amir
2022-10-16 10:24:22 +08:00
parent eb0b3a2cd2
commit 1a6439d278
2 changed files with 20 additions and 5 deletions
@@ -14,6 +14,7 @@ use App\Models\Payment;
use App\Models\Cart;
use Carbon\Carbon;
use App\Models\Cawangan;
use App\Models\FileMarhun;
use App\Models\Resit;
use App\Models\FileResit;
use App\Models\Invoice;
@@ -365,11 +366,7 @@ class LelongMobileController extends Controller
$listLelong = [];
foreach ($arrayDiff2 as $index => $data) {
$lelongbid = LelongBid::
// join('filemarhun', 'lelongbid.id', '=', 'filemarhun.lelongbid_id')
where('id', $data)
// ->where('photo_type', 1)
->first()->toArray();
$lelongbid = LelongBid::where('id', $data)->first()->toArray();
$lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelongbid['id'])->get()->toArray();
foreach ($lelongbidmarhun as $index1 => $marhun) {
$marhunDesc = JenisEmas::where('marhun', $marhun['marhun'])->first()->toArray();
@@ -378,6 +375,12 @@ class LelongMobileController extends Controller
$lelongbid['lelongbidmarhun'] = $lelongbidmarhun;
$fileMarhun = FileMarhun::where('lelongbid_id', $lelongbid['id'])->get();
if ($fileMarhun->isNotEmpty()) {
$lelongbid['filemarhun'] = $fileMarhun;
}
array_push($listLelong, $lelongbid);
}
$lelong['lelongbid'] = $listLelong;
@@ -394,6 +397,16 @@ class LelongMobileController extends Controller
}
}
public function lelongOnline()
{
$lelong = Lelong::where('sts_lelong', '=', 1)->first();
if ($lelong) {
return response()->json(['success' => true, 'lelong' => $lelong]);
} else {
return response()->json(['success' => false,]);
}
}
public function searchLelongByCawangan(Request $request){
$currentdate = Carbon::now();
+2
View File
@@ -57,6 +57,8 @@ Route::group(['middleware' => ['auth:sanctum']], function () {
Route::get('/listcawlelongtodaystarted', [LelongMobileController::class, 'listCawLelongTodayStarted']);
//list surat exclude in cart and bid-record
Route::get('/lelongDetails/listSuratLelong', [LelongMobileController::class, 'listSuratLelong']);
//list lelong online
Route::get('/lelongOnline', [LelongMobileController::class, 'lelongOnline']);