func (p *Hidden) SetupRender() *exit.Exit { fmt.Println("=============================================") starttime, err := time.Parse("2006-01-02", "2016-03-25") if err != nil { panic(err) } endtime, err := time.Parse("2006-01-02", "2016-03-28") if err != nil { panic(err) } fmt.Println("Time is from / to: ", starttime, endtime) // startTime, err := time.Parse("2006-01-02", starttime) // if nil != err { // panic(err) // } // endTime, err2 := time.Parse("2006-01-02", endtime) // if nil != err2 { // panic(err2) // } p.Data = model.NewTestProductSalesTable() //(startTime, endTime) pst, err := settleaccountdao.SettleAccount(starttime, endtime, 17) if err != nil { fmt.Println(err) return exit.Error(err) } p.Data = pst fmt.Println("m : ", p.Data) return nil }
func (p *FactorySettleAccount) SetupRender() *exit.Exit { // parameter time if !utils.IsValidTime(p.TimeFrom) { p.TimeFrom = time.Date(2015, time.January, 1, 0, 0, 0, 0, time.Local) } if !utils.IsValidTime(p.TimeTo) { p.TimeTo = time.Now() } fmt.Println("Time is from / to: ", p.TimeFrom, p.TimeTo) // p.Data = model.NewTestProductSalesTable() //(startTime, endTime) pst, err := settleaccountdao.SettleAccount(p.TimeFrom, p.TimeTo, p.Provider) if err != nil { fmt.Println(err) return exit.Error(err) } p.Data = pst return nil }