Commit 454a5abc by huangchengyi

1.0

parent 24775923
Showing with 12 additions and 3 deletions
......@@ -2,6 +2,7 @@ package main
import (
"fmt"
"github.com/syyongx/php2go"
"sort"
)
......@@ -31,4 +32,11 @@ func main() {
sort.Sort(SorterRatio(slic))
fmt.Printf("%+v", slic)
fmt.Println(php2go.Stripos(",10005,10006,","100205",0))
return
if php2go.Stripos("10005",",10005,10006,",0) > -1 {
fmt.Println("1002 不参与分类的商品")
return
}
}
......@@ -22,6 +22,7 @@ type ZyCronService struct {
/*
计算自营折扣信息
@param checkGoodsId 单独一个sku运行
fmt.Println(php2go.Stripos("10005,10006","10006",0))
*/
func (a *ZyCronService) ZyDiscount(checkGoodsId string) {
......@@ -120,21 +121,21 @@ func (a *ZyCronService) ZyDiscount(checkGoodsId string) {
fmt.Println(info)
//不参与系数的商品
if info["goods_id"] != "" {
if php2go.Stripos(info["goods_id"],","+now_goods_id+",",0) > -1 {
if php2go.Stripos(info["goods_id"],","+now_goods_id+",",0) == -1 {
fmt.Println("1001 本商品不参与系数"+now_goods_id)
continue;
}
}
//不参与分类的商品
if info["class_id"] != "" {
if php2go.Stripos(info["class_id2"],","+now_class_id+",",0) > -1 {
if php2go.Stripos(info["class_id"],","+now_class_id+",",0) == -1 {
fmt.Println("1002 不参与分类的商品"+now_goods_id)
continue;
}
}
//不参与分类的商品
if info["brand_id"] != "" {
if php2go.Stripos(info["brand_id"],","+now_brand_id+",",0) > -1 {
if php2go.Stripos(info["brand_id"],","+now_brand_id+",",0) == -1 {
fmt.Println("1003 不参与分类的商品"+now_goods_id)
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment