Ver Fonte

fix bug

hongze há 3 anos atrás
pai
commit
8b2f01508f

+ 1 - 1
models/data_source_longzhong.go

@@ -174,7 +174,7 @@ type LzProductInfoDetailResp struct {
 	Page     int                    `json:"page"`
 }
 
-func GetLongzhonginfoByUnitId(classifyName string, unitId int64) (item *Longzhongdata, err error) {
+func GetLongzhonginfoByUnitId(classifyName string, unitId int64) (item *Longzhonginfo, err error) {
 	o := orm.NewOrm()
 	o.Using("edb")
 	sql := `SELECT * FROM longzhonginfo WHERE unitid=? AND classify_name=?`

+ 2 - 0
services/data_source_longzhong.go

@@ -265,6 +265,7 @@ func GetLzProductDetail() (err error) {
 			param.Add("page", strconv.Itoa(i))
 			utils.LzFileLog.Info("GetLzProductDetail Param: %s", param.Encode())
 			body, err := http.Post(postUrl, param.Encode())
+
 			if err != nil {
 				utils.LzFileLog.Info("Post Err:%s",err.Error())
 				return err
@@ -342,6 +343,7 @@ func GetLzProductDetail() (err error) {
 			//time.Sleep(1 * time.Second)
 		}
 	}
+	utils.LzFileLog.Info("end GetLzProductDetail")
 	return
 }
 

+ 3 - 0
services/task.go

@@ -49,6 +49,9 @@ func Task() {
 	//GetLzProductDetail()
 	//LzExportExcel()
 	//GetLzProductList()GetLzProductDetail
+
+	GetLzProductDetail()
+
 	fmt.Println("task end")
 }