contract_service.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package contract
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "hongze/hongze_mobile_admin/models/tables/contract_service_detail"
  5. "time"
  6. )
  7. //合同的服务内容
  8. type ContractService struct {
  9. ContractServiceId int `orm:"column(contract_service_id);pk"`
  10. ContractId int `description:"合同id"`
  11. ProductId int `description:"产品id,1:ficc;2:权益"`
  12. ServiceTemplateId int `description:"合同服务模板id"`
  13. Title string `description:"套餐名称"`
  14. Value string `description:"套餐的值"`
  15. TableValue string `description:"表格数据,用于word生成时的json数据"`
  16. HasDetail string `description:"是否有详情,枚举值:是、否;默认:否"`
  17. CreateTime time.Time `description:"合同添加时间"`
  18. }
  19. //合同的服务内容
  20. type ContractServiceAndDetail struct {
  21. ContractServiceId int `orm:"column(contract_service_id);pk"`
  22. ContractId int `description:"合同id"`
  23. ProductId int `description:"产品id,1:ficc;2:权益"`
  24. ServiceTemplateId int `description:"合同服务模板id"`
  25. Title string `description:"套餐标题"`
  26. Value string `description:"套餐的值"`
  27. TableValue string `description:"表格数据,用于word生成时的json数据"`
  28. HasDetail string `description:"是否有详情,枚举值:是、否;默认:否"`
  29. ChartPermissionId int `description:"权限id"`
  30. DetailList []*contract_service_detail.ContractServiceDetail
  31. }
  32. //获取合同列表数据
  33. func GetContractServiceAndDetailList(contractId int) (list []*ContractServiceAndDetail, err error) {
  34. o := orm.NewOrm()
  35. sql := "select * from contract_service where contract_id = ? "
  36. _, err = o.Raw(sql, contractId).QueryRows(&list)
  37. return
  38. }