Problem is i cant filter by date range to date. It gives me zero data. But i have many data at 2019/5/7
timeT := "2019-5-8"
startT, err := time.Parse(time.RFC3339, timeT)
xxx := now.New(startT).BeginningOfMonth()
yyy := now.New(startT).EndOfMonth()
_, err = o.QueryTable("BillDetail").Filter("OriginalID", id).Filter("Date", xxx).Filter("Date", yyy).All(&bills)
if err != nil {
return nil, err
}
return bills, err
I used
"time"
"github.com/jinzhu/now"
"github.com/astaxie/beego/orm"
I used debug and i found this output on console
[ORM]2019/05/08 15:12:22 -[Queries/default] - [ OK / db.Query / 16.9ms] - [SELECT T0.`i_d`, T0.`date`, T0.`name`, T0.`original_i_d`, T0.`value` FROM `bill_detail` T0 WHERE T0.`original_i_d` = ? AND T0.`date` = ? AND T0.`date` = ? ] - `6`, `0001-01-01 08:00:00`, `0001-01-01 08:00:00`
Pay your attention here
`0001-01-01 08:00:00`, `0001-01-01 08:00:00`