feat: 时间

master
howell 3 years ago
parent 4f450da3d0
commit 8642a0da56

@ -660,11 +660,16 @@ func (o logic) CompanyInfo(id uint) (res company.Info) {
type ApplyListReq struct {
bean.Page
ID uint `json:"-"`
ID uint `json:"-"`
Month *time.Time `json:"month"`
}
func (o logic) CompanyApplyList(args ApplyListReq) (res []company.Apply, total int64) {
query := mysql.Db.Table((&company.Apply{}).TableName()).Where("user_id = ?", args.ID)
start := args.Month
end := args.Month.AddDate(0, 1, 0)
query := mysql.Db.Table((&company.Apply{}).TableName()).
Where("user_id = ?", args.ID).
Where("created_at between ? and ?", start, end)
query.Count(&total)
query.Order("id desc").Find(&res)
return

@ -131,6 +131,7 @@ type Apply struct {
Tax int `json:"tax" validate:"oneof=1 2"`
LogisticsName string `json:"logistics_name"`
WaybillCode string `json:"waybill_code"`
ManageUserID int `json:"manage_user_id" gorm:"<-:update"`
}
func (o Apply) TableName() string {

Loading…
Cancel
Save