diff --git a/app/Http/Controllers/AuthMobile/LelongController.php b/app/Http/Controllers/AuthMobile/LelongController.php deleted file mode 100644 index 2b057812..00000000 --- a/app/Http/Controllers/AuthMobile/LelongController.php +++ /dev/null @@ -1,17 +0,0 @@ -where('t_lelong','=',$t_lelong) - ->first(); - - } -} diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php new file mode 100644 index 00000000..8b85d7b2 --- /dev/null +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -0,0 +1,60 @@ +toDateString(); + + $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); + + $arrayID = []; + foreach($lelong as $data) + { + array_push($arrayID,$data->id); + } + $lelongbid = LelongBid::whereIn('lelong_id',$arrayID) + ->join('lelongbidmarhun','lelongbid.id','=','lelongbidmarhun.lelongbid_id') + ->get(); + + $surat = LelongBid::whereIn('lelong_id',$arrayID)->get(); + + if(sizeof($lelongbid)!=0) + { + return response()->json([ + 'success' => true, + 'lelong' => $lelong, + 'surat' => $surat, + 'item' => $lelongbid + ]); + } + else + { + return response()->json([ + 'success' => false, + 'message' => 'No Data', + ], 401); + } + + } + + public function getlelongdetails(Request $request){ + + $currentdate = Carbon::now(); + $currentdate = $currentdate->toDateString(); + + $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); + + + } +} diff --git a/app/Http/Controllers/AuthMobile/NewPasswordController.php b/app/Http/Controllers/AuthMobile/NewPasswordController.php index 070d2976..8e486e4f 100644 --- a/app/Http/Controllers/AuthMobile/NewPasswordController.php +++ b/app/Http/Controllers/AuthMobile/NewPasswordController.php @@ -1,6 +1,6 @@ 'Admin', 'username' => 'Admin', 'email' => 'admin@example.com', + 'user_type' => 1 ]); $user->assignRole($role1); @@ -167,6 +168,7 @@ class RolesSeeder extends Seeder 'name' => 'Khazanah', 'username' => 'Khazanah', 'email' => 'khazanah@example.com', + 'user_type' => 1 ]); $user->assignRole($role2); @@ -174,6 +176,7 @@ class RolesSeeder extends Seeder 'name' => 'Teller', 'username' => 'Teller', 'email' => 'teller@example.com', + 'user_type' => 1 ]); $user->assignRole($role3); @@ -181,6 +184,7 @@ class RolesSeeder extends Seeder 'name' => 'Pengurus Cawangan', 'username' => 'PC', 'email' => 'penguruscawangan@example.com', + 'user_type' => 1 ]); $user->assignRole($role4); @@ -188,6 +192,7 @@ class RolesSeeder extends Seeder 'name' => 'Juru Lelong', 'username' => 'Juru Lelong', 'email' => 'jurulelong@example.com', + 'user_type' => 1 ]); $user->assignRole($role5); @@ -195,6 +200,7 @@ class RolesSeeder extends Seeder 'name' => 'Operasi', 'username' => 'Operasi', 'email' => 'operasi@example.com', + 'user_type' => 1 ]); $user->assignRole($role6); @@ -202,6 +208,7 @@ class RolesSeeder extends Seeder 'name' => 'Account', 'username' => 'Account', 'email' => 'account@example.com', + 'user_type' => 1 ]); $user->assignRole($role7); @@ -209,6 +216,7 @@ class RolesSeeder extends Seeder 'name' => 'Pembida', 'username' => 'Pembida', 'email' => 'pembida@example.com', + 'user_type' => 2 ]); $user->assignRole($role8); } diff --git a/routes/api.php b/routes/api.php index 9ea4ff19..c8537bd8 100644 --- a/routes/api.php +++ b/routes/api.php @@ -4,8 +4,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use App\Http\Controllers\AuthMobile\AuthController; use App\Http\Controllers\AuthMobile\UserController; -use App\Http\Controllers\CartController; -use App\Http\Controllers\AuthMobile\LelongController; +use App\Http\Controllers\AuthMobile\LelongMobileController; /* |-------------------------------------------------------------------------- @@ -35,10 +34,12 @@ Route::group(['middleware' => ['auth:sanctum']], function () { Route::post('/updateItem', [CartController::class, 'updateItem']); Route::get('/deleteItem/{id}', [CartController::class, 'deleteCart']); Route::post('/forgotPassword', [NewPasswordController::class, 'forgotPassword']); - Route::post('/resetPassword', [NewPasswordController::class, 'reset']); + Route::post('/reset', [NewPasswordController::class, 'reset']); Route::get('/user/profile', [UserController::class, 'getProfileUser']); Route::put('/userUpdate/profile', [UserController::class, 'updateProfileUser']); - Route::put('/lelong', [LelongController::class, 'listLelongDetails']); + Route::get('/details/lelong', [LelongMobileController::class, 'listLelongDetails']); + Route::get('/lelongDetails/today', [LelongMobileController::class, 'getlelongdetails']); + });