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

52 lines
1.1 KiB
Go

5 months ago
package model
import (
"encoding/json"
"time"
)
type Project struct {
ID int
OrderSn string
Name string
TpID string
BdID string
BdName string
StartDate string
Amount string
Province string
City string
District string
BzjEtime string
CreateTime string
PlanDate string
BuildPrice string
BuildPlace string
TenderProjectType string
ValidPeriod string
TenderNoticeUrl string
TenderFileUrl string
TenderFileUrlMd5 string
ProjectApprovalNo string
Order *Order `gorm:"foreignKey:OrderSn;references:OrderSn"`
CreatedAt time.Time
UpdatedAt time.Time `json:"-"`
}
func (Project) TableName() string {
return "project"
}
func (a Project) MarshalJSON() ([]byte, error) {
type Alias Project
return json.Marshal(&struct {
CreatedAt string
UpdatedAt string
*Alias
}{
CreatedAt: a.CreatedAt.Format("2006-01-02 15:04:05"),
UpdatedAt: a.UpdatedAt.Format("2006-01-02 15:04:05"),
Alias: (*Alias)(&a),
})
}