1234567891011121314151617181920212223242526272829303132 |
- package service
-
- import (
- "time"
- "wsc-go/models"
- )
-
- func GetOrgTypes() (ots []*models.OrgType, err error) {
- err = readUserDb.Model(&models.OrgType{}).Where("status=1").Order("sort_no").Find(&ots).Error
- return
- }
-
- func UpdateOrgInfo(org *models.Org) (err error) {
- err = writeUserDb.Model(&models.Org{}).Where("id=?", org.Id).Update(org).Error
- return
- }
-
- func GetIllnessList() (ills []*models.Illness, err error) {
- err = readUserDb.Where("status=1").Find(&ills).Error
- return
- }
-
- func CreateOrgGalleryItem(item *models.OrgGallery) (err error) {
- err = writeUserDb.Create(item).Error
- return
- }
-
- func DeleteOrgGalleryItem(id int64) (err error) {
- err = writeUserDb.Model(&models.OrgGallery{}).Where("id=?", id).Update(map[string]interface{}{"Status": 0, "Mtime": time.Now().Unix()}).Error
- return
- }
|