@@ -36,18 +38,19 @@ func (a *ZyCronService) ZyDiscount(checkGoodsId string) {
...
@@ -36,18 +38,19 @@ func (a *ZyCronService) ZyDiscount(checkGoodsId string) {
page_size:=1000//查数据库每页大小
page_size:=1000//查数据库每页大小
OuterLoop:
OuterLoop:
fori=1;i<=1000;i++{
fori=0;i<1000;i++{
start:=0;
start:=0;
ifi==1{
ifi==0{
start=0;
start=0;
}else{
}else{
start=(i-1)*page_size
start=(i-1)*page_size
}
}
sql:="select goods_id,class_id2,brand_id,cost,ladder_price from lie_goods where self_supplier_type = 1 and stock >0 and status=1 limit "+common.MyIntToStr(page_size)+","+common.MyIntToStr(start);
sql:="select goods_id,class_id2,brand_id,cost,ladder_price from lie_goods where self_supplier_type = 1 and stock >0 and status=1 limit "+gconv.String(start)+","+gconv.String(page_size);
ifcheckGoodsId!=""{
ifcheckGoodsId!=""{
sql="select goods_id,class_id2,brand_id,cost,ladder_price from lie_goods where goods_id="+checkGoodsId;
sql="select goods_id,class_id2,brand_id,cost,ladder_price from lie_goods where goods_id="+checkGoodsId;
}
}
fmt.Println(sql)
goodsInfos,err:=dbSpu.QueryString(sql)
goodsInfos,err:=dbSpu.QueryString(sql)
iferr!=nil||len(goodsInfos)==0{
iferr!=nil||len(goodsInfos)==0{
fmt.Print("查询没有数据",err)
fmt.Print("查询没有数据",err)
...
@@ -61,7 +64,7 @@ func (a *ZyCronService) ZyDiscount(checkGoodsId string) {
...
@@ -61,7 +64,7 @@ func (a *ZyCronService) ZyDiscount(checkGoodsId string) {