update code surkon

This commit is contained in:
2024-12-06 09:23:45 +07:00
parent a824b768c7
commit 044e82419e
5 changed files with 223 additions and 69 deletions

No files matched your search

@@ -0,0 +1,24 @@
package lokasiruang
import (
"bridging-rssa/config"
"errors"
"log"
"gorm.io/gorm"
)
func GetDaftarLokasiRuang(idSimgos string) (int, error) {
var idRuangan int
query := `select dlr."id" from "daftar_lokasi_ruang" dlr where dlr."Id_location_simgos" = ?`
err := config.SatuDataDB.Debug().Raw(query, idSimgos).First(&idRuangan).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
log.Println(err)
return 128, nil
}
log.Println(err)
return 0, err
}
return idRuangan, nil
}