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.

53 lines
1.1 KiB
Go

5 months ago
package model
import (
"encoding/json"
"time"
)
type Project struct {
ID int
4 months ago
OrderNo string
5 months ago
Name string
TpID string
BdID string
BdName string
StartDate string
Amount string
4 months ago
InsureAmount string
5 months ago
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
4 months ago
Order *Order `gorm:"foreignKey:OrderNo;references:OrderNo"`
5 months ago
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),
})
}