互动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
662 B

5 years ago
  1. package activity_service
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "hudongzhuanjia/models"
  5. )
  6. func GetModuleService(moduleName string, activityId int64) (*models.ActivityModuleService, bool, error) {
  7. hids := make([]int64, 0)
  8. err := core.GetXormAuto().Table(new(models.ModuleServiceHistory)).Select("id").
  9. Where("is_delete=0 and name=?", moduleName).Find(&hids)
  10. if err != nil {
  11. return nil, false, err
  12. }
  13. moduleService := new(models.ActivityModuleService)
  14. exist, err := core.GetXormAuto().Where("is_delete=0 and activity_id=?", activityId).
  15. In("service_module_history_id", hids).Get(moduleService)
  16. return moduleService, exist, err
  17. }