diff --git a/app/Http/Controllers/Mobile/LelongMobileController.php b/app/Http/Controllers/Mobile/LelongMobileController.php index 44184048..2f2ce08b 100644 --- a/app/Http/Controllers/Mobile/LelongMobileController.php +++ b/app/Http/Controllers/Mobile/LelongMobileController.php @@ -14,6 +14,7 @@ use App\Models\Payment; use App\Models\Cart; use Carbon\Carbon; use App\Models\Cawangan; +use App\Models\CawanganLelong; use App\Models\FileMarhun; use App\Models\Resit; use App\Models\FileResit; @@ -1429,5 +1430,47 @@ class LelongMobileController extends Controller } return response()->json(['success' => true]); } + + public function listLelong() + { + $lelong_all = Lelong::select('id')->get(); + return response()->json($lelong_all); + } + + public function listCawangan(Request $request) + { + $cawangan_all = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id') + ->where('lelong_id', $request->lelong_id) + ->select('cawangan_lelong.caw_id', 'cawangan.caw_name')->get(); + return response()->json($cawangan_all); + } + + public function listLelongBid(Request $request) + { + $lelong_bid_all = LelongBid::with('fileMarhunMain') + ->where('caw_id', $request->caw_id) + ->where('lelong_id', $request->lelong_id) + ->select(['id','norujukan', 'marhun', 'nilaimarhun']) + ->get(); + + return response()->json($lelong_bid_all); + } + + public function showPhotoMarhun(Request $request) + { + $fileMarhun = FileMarhun::find($request->filemarhun_id, ['file_type']); + + $directory = "/{$request->norujukan}/overall_photo/"; + $imageExtension = $fileMarhun->file_type; + + $marhunImageFileName = "overall.{$imageExtension}"; + + if (Storage::disk('marhun')->exists("{$directory}${marhunImageFileName}")) { + $marhun_photo = Storage::disk('marhun')->get("{$directory}${marhunImageFileName}"); + return base64_encode($marhun_photo); + } else { + return 0; + } + } } diff --git a/resources/js/axios.js b/resources/js/axios.js new file mode 100644 index 00000000..c6ae5c1c --- /dev/null +++ b/resources/js/axios.js @@ -0,0 +1,6 @@ +import axios from "axios"; + +// const tokenKey = "token"; +// axios.defaults.headers.common['X-CSRF-TOKEN'] = tokenKey; + +axios.defaults.baseURL = "http://lelong-admin.test/api"; \ No newline at end of file diff --git a/resources/js/components/pengurusangambar/marhun/DisplayLelongBid.vue.vue b/resources/js/components/pengurusangambar/marhun/DisplayLelongBid.vue.vue new file mode 100644 index 00000000..5b320ab8 --- /dev/null +++ b/resources/js/components/pengurusangambar/marhun/DisplayLelongBid.vue.vue @@ -0,0 +1,50 @@ + + + \ No newline at end of file diff --git a/resources/js/components/pengurusangambar/marhun/MarhunImage.vue b/resources/js/components/pengurusangambar/marhun/MarhunImage.vue new file mode 100644 index 00000000..c8a3d026 --- /dev/null +++ b/resources/js/components/pengurusangambar/marhun/MarhunImage.vue @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/resources/js/components/pengurusangambar/marhun/SelectBatchLelong.vue b/resources/js/components/pengurusangambar/marhun/SelectBatchLelong.vue new file mode 100644 index 00000000..3493ef84 --- /dev/null +++ b/resources/js/components/pengurusangambar/marhun/SelectBatchLelong.vue @@ -0,0 +1,48 @@ + + + \ No newline at end of file diff --git a/resources/js/components/pengurusangambar/marhun/SelectCawangan.vue b/resources/js/components/pengurusangambar/marhun/SelectCawangan.vue new file mode 100644 index 00000000..a0b1d8b4 --- /dev/null +++ b/resources/js/components/pengurusangambar/marhun/SelectCawangan.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/resources/js/vue-app.js b/resources/js/vue-app.js index 1019d85b..9f658763 100644 --- a/resources/js/vue-app.js +++ b/resources/js/vue-app.js @@ -1,10 +1,14 @@ import { createApp } from 'vue' +import './axios' -import HelloComponent from "./components/HelloComponent.vue" -import ByeComponent from "./components/ByeComponent.vue" +// import HelloComponent from "./components/HelloComponent.vue" +// import ByeComponent from "./components/ByeComponent.vue" +import SelectBatchLelong from "./components/pengurusangambar/marhun/SelectBatchLelong.vue" -const appHelloComponent = createApp(HelloComponent); -const appByeComponent = createApp(ByeComponent); +// const appHelloComponent = createApp(HelloComponent); +// const appByeComponent = createApp(ByeComponent); +const appSelectBatchLelong = createApp(SelectBatchLelong); -appHelloComponent.mount("#appHelloComponent"); -appByeComponent.mount("#appByeComponent"); +// appHelloComponent.mount("#appHelloComponent"); +// appByeComponent.mount("#appByeComponent"); +appSelectBatchLelong.mount("#appSelectBatchLelong"); \ No newline at end of file diff --git a/routes/api.php b/routes/api.php index c405e659..c2cea1c1 100644 --- a/routes/api.php +++ b/routes/api.php @@ -144,6 +144,11 @@ Route::group(['middleware' => ['auth:sanctum']], function () { Route::get('/item','ApiController@biditem'); Route::get('/jeniskarat','ApiController@karat'); +Route::get('/listLelong', [LelongMobileController::class, 'listLelong']); +Route::get('/listCawangan', [LelongMobileController::class, 'listCawangan']); +Route::get('/listLelongBid', [LelongMobileController::class, 'listLelongBid']); +Route::get('/showPhotoMarhun', [LelongMobileController::class, 'showPhotoMarhun']); + // Route::get('/item',['as'=>'lelong.biditem','uses'=>'LelongController@biditem']); // Route::get('/lelongstop/{id}',['as'=>'lelong.stop','uses'=>'LelongController@stop']);