21 lines
412 B
Go
21 lines
412 B
Go
|
package hospital
|
||
|
|
||
|
import (
|
||
|
"health-go/config"
|
||
|
"health-go/model"
|
||
|
)
|
||
|
|
||
|
func Modify(hospital model.Hospital) (bool, error) {
|
||
|
result := config.DB.
|
||
|
Table("hospital").
|
||
|
Where("hospital_id = ?", hospital.HospitalID).
|
||
|
Updates(map[string]interface{}{
|
||
|
"hospital_name": hospital.HospitalName,
|
||
|
"address": hospital.Address,
|
||
|
})
|
||
|
if result.Error != nil {
|
||
|
return false, result.Error
|
||
|
}
|
||
|
return true, nil
|
||
|
}
|