|
|
|
@ -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
|
|
|
|
|