Browse Source

同步历史数据

rdluck 4 years ago
parent
commit
5aef2e6a86
3 changed files with 4 additions and 4 deletions
  1. 1 1
      models/data_source_longzhong.go
  2. 2 2
      services/data_source_longzhong.go
  3. 1 1
      services/task.go

+ 1 - 1
models/data_source_longzhong.go

@@ -205,7 +205,7 @@ type LongzhonginfoList struct {
 func GetLongzhonginfoList() (items []*LongzhonginfoList, err error) {
 	o := orm.NewOrm()
 	o.Using("edb")
-	sql := ` SELECT * FROM longzhonginfo WHERE is_normal=1 `
+	sql := ` SELECT * FROM longzhonginfo WHERE classify_id IN(55,56) `
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
 }

+ 2 - 2
services/data_source_longzhong.go

@@ -356,8 +356,8 @@ func GetHistoryLzProductDetail() (err error) {
 
 	for ik, iv := range infoList {
 		fmt.Println(ik, iv.SecName)
-		startDate := "2020-01-01" //time.Now().AddDate(0, 0, 0).Format(utils.FormatDate)
-		endDate := "2020-08-31"   //time.Now().AddDate(0, 0, 0).Format(utils.FormatDate)
+		startDate := "2019-01-01" //time.Now().AddDate(0, 0, 0).Format(utils.FormatDate)
+		endDate := "2017-12-31"   //time.Now().AddDate(0, 0, 0).Format(utils.FormatDate)
 		//time.Sleep(1 * time.Second)
 		pageSize := 30
 

+ 1 - 1
services/task.go

@@ -40,7 +40,7 @@ func Task123() {
 
 func Task() {
 	fmt.Println("start")
-	GetLzProductDetail()
+	GetHistoryLzProductDetail()
 	fmt.Println("end")
 }