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