Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Route::middleware('auth:api')->get('/{electionId}/form/image/d/{wilayahId}', 'ApiFormDController@getImageAtWilayah');
- public function getImageAtWilayah($electionId, $wilayahId)
- {
- $result = FormDImageDetail::with('formd_image')
- ->where('jenis_pemilihan', $electionId)
- ->where('id_wilayah', $wilayahId)
- ->where('versi', function($query) use($electionId) {
- $query->select(DB::raw('max(versi)'))
- ->from('formd_image')
- ->whereColumn('id_wilayah', 'formd_image_detail.id_wilayah')
- ->where('flag_aktif', true)
- ->where('jenis_pemilihan', $electionId);
- });
- return $result;
- }
- <template>
- <div>
- <div id="imageScroll">
- <ul>
- <li v-for="items in formd" id="listForm">
- <img :src="'/storage/image/formc/'+items.form_image" class="view-form-d-image"/>
- </li>
- </ul>
- </div>
- </div>
- </template>
- methods:{
- getResult(url){
- eventBus.$on("wilayah-change", (wilayahId) => {
- url = "/api/" + this.electionId + "/form/image/d/" + wilayahId;
- axios.get(url)
- .then((response) => {
- if (response.data) {
- this.formd = response.data.data;
- this.makePagination(response.data);
- }
- });
- });
Add Comment
Please, Sign In to add comment