package test

import (
	"database/sql"
	"fmt"
	"go-admin/app/admin/models"
	orm "go-admin/common/global"
	"go-admin/logger"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"gorm.io/gorm/schema"
	"math/rand"
	"strconv"
	"testing"
	"time"
)

func TestStock(t *testing.T) {
	InitDBTest()
	var goods []models.GameCardGoods
	err := DBTest.Table("game_card_goods").Where("store_id=?", 19).Find(&goods).Error
	if err != nil {
		fmt.Println("err:", err)
	}
	count := 0
	for _, good := range goods {
		atoi, err := strconv.Atoi(good.SerialNumber)
		if err != nil {
			fmt.Println("err:", err)
		}
		//fmt.Println("atoi:", atoi)
		if atoi > 9810218 && atoi < 9810273 {
			//fmt.Println("good:", good.SerialNumber)
			fmt.Println("good:", good.ID, good.GameCardId, good.StoreId, good.Status, good.SerialNumber)
			//if atoi == 9810267 {
			//	continue
			//}
			////count++
			////DBTest.Table("game_card_goods").Where("id=?", good.ID).Delete()
			//sql := fmt.Sprintf("UPDATE game_card_goods_stock SET store_stock=store_stock-1,rent_stock=rent_stock-1 WHERE store_id =%d  AND game_card_id =%d ;", good.StoreId, good.GameCardId)
			//fmt.Println("sql:", sql)
			//
			//err := DBTest.Exec(sql).Error
			//if err != nil {
			//	fmt.Println("err:", err)
			//}
		}

	}

	fmt.Println("count:", count)

}

func TestFindRightErpStockCommodityId(t *testing.T) {

	usedStockCommodityIdList := make(map[uint32][]uint32)
	commodityId := 23
	var stockCommodity []models.ErpStockCommodity
	//stockCommodity1 := models.ErpStockCommodity{}
	//stockCommodity1.ID = 4350
	//
	//stockCommodity2 := models.ErpStockCommodity{}
	//stockCommodity2.ID = 4351
	//
	//stockCommodity = append(stockCommodity, stockCommodity1)
	//stockCommodity = append(stockCommodity, stockCommodity2)

	rightId, _ := models.FindRightErpStockCommodityId(usedStockCommodityIdList, uint32(commodityId), stockCommodity)
	fmt.Println("rightId is:", rightId)
}

func TestSetGameCardStock(t *testing.T) {
	SetGameCardStock()
}

func SetGameCardStock() {
	//InitDBTest()
	InitDBProd()

	gdb := DBProd
	var cardStocks []models.GameCardGoodsStock
	err := gdb.Table("game_card_goods_stock").Order("id DESC").Find(&cardStocks).Error
	if err != nil {
		fmt.Println("err:", err)
	}

	for i, _ := range cardStocks {
		//cardStocks[i]
		//models.Order{}
		//models.GameCardGoods{}
		var orderCount int64
		err := gdb.Table("order").Where("game_card_id=?", cardStocks[i].GameCardId).
			Where("store_id=?", cardStocks[i].StoreId).Where("card_status=?", models.OrderCardStatusCompleted).Count(&orderCount).Error
		if err != nil {
			fmt.Println("err:", err)
		}

		//var userHoldCount int64
		//err = DBTest.Table("order").Where("game_card_id", cardStocks[i].GameCardId).
		//	Where("store_id", cardStocks[i].StoreId).Where("card_status in (?)", 2, 3).Total(&userHoldCount).Error
		//if err != nil {
		//	fmt.Println("err:", err)
		//}
		var userHoldCount int64
		err = gdb.Table("game_card_goods").Where("game_card_id=?", cardStocks[i].GameCardId).
			Where("store_id=?", cardStocks[i].StoreId).Where("status=?", 3).Count(&userHoldCount).Error
		if err != nil {
			fmt.Println("err:", err)
		}

		var totalCount int64
		err = gdb.Table("game_card_goods").Where("game_card_id=?", cardStocks[i].GameCardId).
			Where("store_id=?", cardStocks[i].StoreId).Count(&totalCount).Error
		if err != nil {
			fmt.Println("err:", err)
		}

		sql := fmt.Sprintf("UPDATE game_card_goods_stock SET user_hold_stock=%d, order_count=%d, total_stock=%d WHERE store_id=%d AND game_card_id=%d",
			userHoldCount, orderCount, totalCount, cardStocks[i].StoreId, cardStocks[i].GameCardId)
		err = gdb.Exec(sql).Error
		if err != nil {
			fmt.Println("err:", err)
		}

	}

}

func TestSetStoreGameCardOrder(t *testing.T) {
	SetStoreGameCardOrder()
}

func SetStoreGameCardOrder() {
	InitDBProd()

	gdb := DBProd

	var games []models.GameCard
	err := gdb.Table("game_card").Order("-id").Find(&games).Error
	if err != nil {
		fmt.Println("err:", err)
	}

	for i, _ := range games {
		var orderCount int64
		err := gdb.Table("order").Where("game_card_id=?", games[i].ID).
			Where("card_status=?", models.OrderCardStatusCompleted).Where("pay_status=?", 2).
			Count(&orderCount).Error
		if err != nil {
			fmt.Println("err:", err)
		}

		sql := fmt.Sprintf("UPDATE game_card SET order_count=%d WHERE id = %d;", orderCount, games[i].ID)
		err = gdb.Exec(sql).Error
		if err != nil {
			fmt.Println("err:", err)
		}
	}

}

var IODBTest *gorm.DB

func InitIODBTest() {
	//db, err := gorm.Open(sqlite.Open("test.db"), &gorm.Config{
	//	NamingStrategy: schema.NamingStrategy{
	//		SingularTable: true,
	//	},
	//})
	//if err != nil {
	//	panic("failed to connect database")
	//}

	//driver := "mysql"
	source := "mh_dev:d9qy46ONI0ZTF9eH@tcp(112.33.14.191:3306)/mh_dev?charset=utf8&parseTime=True&loc=Local&timeout=1000ms"
	//source := "mh_dev:m5h4parZsXjbeiFh@tcp(39.108.188.218:3306)/mh_dev?charset=utf8&parseTime=True&loc=Local&timeout=1000ms"
	//global.Source = source
	//global.Logger.Info(tools.Green(global.Source))
	db, err := sql.Open("mysql", source)
	if err != nil {
		//global.Logger.Fatal(tools.Red(driver+" connect error :"), err)
	}
	//global.Cfg.SetDb(&config.DBConfig{
	//	Driver: "mysql",
	//	DB:     db,
	//})
	//global.Eloquent, err = e.Open(db, &gorm.Config{
	//	NamingStrategy: schema.NamingStrategy{
	//		SingularTable: true,
	//	},
	//})
	IODBTest, err = gorm.Open(mysql.New(mysql.Config{Conn: db}), &gorm.Config{
		NamingStrategy: schema.NamingStrategy{
			SingularTable: true,
		},
	})
	//if err != nil {
	//	global.Logger.Fatal(tools.Red(driver+" connect error :"), err)
	//} else {
	//	global.Logger.Info(tools.Green(driver + " connect success !"))
	//}
	//
	//if global.Eloquent.Error != nil {
	//	global.Logger.Fatal(tools.Red(" database error :"), global.Eloquent.Error)
	//}

	//if toolsConfig.LoggerConfig.EnabledDB {
	//	global.Eloquent.Logger = logger.New(log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Config{
	//		SlowThreshold: time.Second,
	//		Colorful:      true,
	//		LogLevel:      logger.Info,
	//	})
	//}
	//IODBTest = db
}

var IODBPro *gorm.DB

func InitIODBPro() {
	//db, err := gorm.Open(sqlite.Open("test.db"), &gorm.Config{
	//	NamingStrategy: schema.NamingStrategy{
	//		SingularTable: true,
	//	},
	//})
	//if err != nil {
	//	panic("failed to connect database")
	//}

	//driver := "mysql"
	//source := "mh_dev:m5h4parZsXjbeiFh@tcp(39.108.188.218:3306)/mh_dev?charset=utf8&parseTime=True&loc=Local&timeout=1000ms"
	source := "mh_pro:fLeytnBFCRB553ab@tcp(39.108.188.218:3306)/mh_pro?charset=utf8&parseTime=True&loc=Local&timeout=1000ms"
	//global.Source = source
	//global.Logger.Info(tools.Green(global.Source))
	db, err := sql.Open("mysql", source)
	if err != nil {
		//global.Logger.Fatal(tools.Red(driver+" connect error :"), err)
	}
	//global.Cfg.SetDb(&config.DBConfig{
	//	Driver: "mysql",
	//	DB:     db,
	//})
	//global.Eloquent, err = e.Open(db, &gorm.Config{
	//	NamingStrategy: schema.NamingStrategy{
	//		SingularTable: true,
	//	},
	//})
	IODBPro, err = gorm.Open(mysql.New(mysql.Config{Conn: db}), &gorm.Config{
		NamingStrategy: schema.NamingStrategy{
			SingularTable: true,
		},
	})
	//if err != nil {
	//	global.Logger.Fatal(tools.Red(driver+" connect error :"), err)
	//} else {
	//	global.Logger.Info(tools.Green(driver + " connect success !"))
	//}
	//
	//if global.Eloquent.Error != nil {
	//	global.Logger.Fatal(tools.Red(" database error :"), global.Eloquent.Error)
	//}

	//if toolsConfig.LoggerConfig.EnabledDB {
	//	global.Eloquent.Logger = logger.New(log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Config{
	//		SlowThreshold: time.Second,
	//		Colorful:      true,
	//		LogLevel:      logger.Info,
	//	})
	//}
	//IODBTest = db
}

func TestSendMessageMemberRenewal(t *testing.T) {
	InitIODBTest()
	orm.Eloquent = IODBTest

	//InitIODBPro()
	//orm.Eloquent = IODBPro

	models.SendMessageMemberRenewal()
}

func TestIndexMemberStatistic(t *testing.T) {
	//InitIODBTest()
	//orm.Eloquent = IODBTest

	InitIODBPro()
	orm.Eloquent = IODBPro

	models.IndexMemberStatistic()
}

func TestAddIndexMemberStatistic(t *testing.T) {
	rand.Seed(time.Now().UnixNano())
	InitIODBTest()
	orm.Eloquent = IODBTest

	levels := []uint32{2, 4, 5}
	mapAccumulative := make(map[uint32]int64)
	for i := 0; i < 30; i++ {
		date := models.TodayZero().AddDate(0, 0, i-31)

		for i, _ := range levels {
			in := rand.Int31n(15)
			exp := rand.Int31n(10)

			daily := &models.MemberStatisticDaily{
				MemberLevel: levels[i],
				Date:        date.Format(models.DateFormat),
				DateTime:    date,
				//Increase:     0,
				//Expire:       0,
				//Net:          0,
				//Accumulative: 9 ,
			}
			daily.Increase = ((10)-int64(levels[i]))*10 - int64(in)

			mapAccumulative[levels[i]] += int64(daily.Increase)

			daily.Expire = int64(exp)
			daily.Net = daily.Increase - int64(exp)
			daily.Accumulative = mapAccumulative[levels[i]]

			orm.Eloquent.Create(daily)
		}
	}

}

func TestExportUserMemberList(t *testing.T) {
	InitIODBPro()
	orm.Eloquent = IODBPro
	models.ExportUserMemberList(0, 2, 0, "", "", "", "")
}

func TestSetGameLink(t *testing.T) {
	//InitIODBTest()
	//orm.Eloquent = IODBTest
	InitIODBPro()
	orm.Eloquent = IODBPro
	linkMap := map[uint32]string{
		748: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484049&idx=1&sn=1e687ae7fd19ea4f7e98afc96dc226c7&chksm=ce21dabbf95653ad34f20f7de6711f1132e419a9b30a061a60d0d9c6078dd9275d39715bd1c1#rd",
		749: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484050&idx=1&sn=9406e5f2f40b1c2292e94eb75288cc38&chksm=ce21dab8f95653ae14545b3e578d81bb80e340a664034fd427e8b76e1cbf46e96fd4462ad7be#rd",
		750: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484051&idx=1&sn=4ecb6fe2fd1072621e28fca5299034c7&chksm=ce21dab9f95653afa3b9202cdff7f8a909207afda12eed439e481d8f523ff93370b2927b5e5c#rd",
		751: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484052&idx=1&sn=1ffe62a85d079fa389c2b0c00e83b126&chksm=ce21dabef95653a8799d8405b037c7815de4c123f03fd1682583c391105a0048f123e7966a76#rd",
		752: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484053&idx=1&sn=1c5113d1134aa899a4cfdf658c6ff333&chksm=ce21dabff95653a92e1dd7b2b53fc55d45576c058ebaaeb50e3d768939acb8b81b677660d090#rd",
		753: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484054&idx=1&sn=5416b679625460a47c020b04d0f8a8f6&chksm=ce21dabcf95653aa74ca317768c97b30df38b8620867c3d7dc1c399d7ae50d10fd2e6c1d4117#rd",
		754: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484055&idx=1&sn=92271b9a9e9cebc0dca00c5418a9380a&chksm=ce21dabdf95653ab23d130bbed403ce9885ee013ee816729d65925877e25597a778735963eb7#rd",
		755: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484056&idx=1&sn=7c64852a339888b2d440aae36d08685e&chksm=ce21dab2f95653a4aa1e2c553a60811fc59687c8a9c2245554e1405e3ce3c08b1e4c8f33e6b5#rd",
		758: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484057&idx=1&sn=fe57a2ad5bb28485f95d60abcbd49907&chksm=ce21dab3f95653a58f3e2eae72e73ade43c5d5d75d6f321715ef46854a044a95f6ce5201e778#rd",
		759: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484058&idx=1&sn=631f3eb678966cbf45475d992ac9f872&chksm=ce21dab0f95653a6e04ea3afa461f5ab976532da6383ae03525f030ccffa192071e462e9adfd#rd",
		760: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484059&idx=1&sn=e32abe24efbb123a3a92f93a11c27b28&chksm=ce21dab1f95653a7b0ae2592c0e606d12ca978049e0fe0d67b0dec6fe5530060cd6483467f65#rd",
		761: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484060&idx=1&sn=22ee4b680bdc5b26a0bd9395f68c9ece&chksm=ce21dab6f95653a0cdf76c0c2065cd9acec3a49e5c9910a5fe2722f32a0ae4f559aa4c2c12b6#rd",
		762: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484061&idx=1&sn=0cd686070f9dc01930ce78b5cef80513&chksm=ce21dab7f95653a1746216119e30ca86e28a4965d154359827ab7d74a38b2b06a182e37ee38c#rd",
		763: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484062&idx=1&sn=3749c9dc470455f5f3b385575e923911&chksm=ce21dab4f95653a2ddb2e1b8594be96d328ef2ecf609b7526302ae1bf5e1c3aaddce02e21a77#rd",
		764: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484063&idx=1&sn=82848af7f973e1e5f87b1079d1e1bf95&chksm=ce21dab5f95653a3e1e6523dce7de0a423403e137650e06cb539afa2fe5f06404f07a1ff954a#rd",
		765: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484064&idx=1&sn=c0b9f0baf91671601332f93d3e924afa&chksm=ce21da8af956539cc69b458e3c150938fc9f92743f61dae4f568dac0619a99f8b85530f44169#rd",
		766: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484065&idx=1&sn=c39e11c34350533ad67cd8056be9a2e3&chksm=ce21da8bf956539d45b047f70ce67f6d675541b3b1f0224259841573beb8a6790cfb2d858666#rd",
		767: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484066&idx=1&sn=cc01872edf3b11f580c32b1b3629fa17&chksm=ce21da88f956539e96a72babd5935d467c50e3c042511048cf9cf901857d80137c04dd110f29#rd",
		768: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484067&idx=1&sn=c41691668c1fafc6eb30f4d80483f98f&chksm=ce21da89f956539fdbd565aee871ba703dc40764b1776ed3340adc8ece6c7e0cfb165cacef9e#rd",
		769: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484068&idx=1&sn=2820405a37c1dfca3f92d79c1ecdfecb&chksm=ce21da8ef956539896e38c0c67c1757f89cbc20b8c3e69f2eef1cf398c982f4d4c144cec6067#rd",
		770: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484069&idx=1&sn=22fd33521fa64fa20f8791cf8e14eb98&chksm=ce21da8ff956539949ae63d202649e4d7ff2c2787cba6615599428df5b70f073bf3809f1c0f1#rd",
		771: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484070&idx=1&sn=10524311e24593cbfd328537b4416916&chksm=ce21da8cf956539a8280f3fbee96c5bf11899a7a1591c6d300442c509a5ace7d96f9b0cebe05#rd",
		772: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484071&idx=1&sn=b2bd3323636026a5e089d49da93b5a53&chksm=ce21da8df956539bef7ebbf33b0845a99f7d5de45159004410b667e616793d8f094612af560e#rd",
		773: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484072&idx=1&sn=80d7317126eccfd22a61b6f6ae0f60e2&chksm=ce21da82f9565394990179e9e401ab8f49707a96a0c4afb58cb06656accbe0dd522e7bd3ea5d#rd",
		774: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484073&idx=1&sn=e09cc15790dfe31d95f03edc623c8b2b&chksm=ce21da83f9565395e0210481537d9021c9af76c80a90074227f8901f58d71b629681696b8992#rd",
		775: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484074&idx=1&sn=e4d580da8444e3c6736c49f9ef223cc5&chksm=ce21da80f956539677c76b23edbb18efecb2287c114d23056b6d682accd9c7750c5cbae888ba#rd",
		776: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484075&idx=1&sn=bbc39bfd7e1c70964919860ac31710b2&chksm=ce21da81f95653978762b539577d7a029f447da60998e35914d60d98887c20f8bf1aa5b10c4b#rd",
		777: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484076&idx=1&sn=f0a7049942c8e934a3fc610e40479e1e&chksm=ce21da86f95653901b0848cdf77291533e386754b88ec00124c2ce3b004b51e3042409b837dc#rd",
		778: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484077&idx=1&sn=dd5158fef97c9398c4a553e9b464bd0d&chksm=ce21da87f95653918dbc6716a02a8437805ae666d311516f049cdac8772dd6b1f8acf9af9b48#rd",
		779: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484018&idx=1&sn=baca8df08ef7e0ca0d92aa46bc16fedf&chksm=ce21da58f956534ea5048c5534fd34bdb636d75681f228a14763b3b969542975761f5074e50e#rd",
		780: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484019&idx=1&sn=4bbde793203586e1bbbd666d65316390&chksm=ce21da59f956534f615c68ae4275f84a2a1d09a0665a7720ee242ff6b5d2e4395e115f5c0eb0#rd",
		781: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484020&idx=1&sn=fafac55a042595a1cd2bc0a4def0d4e3&chksm=ce21da5ef95653488381867f2ba420b16df5e0a055af89cd0626e81725f0a3e6042081e885f8#rd",
		782: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484021&idx=1&sn=9164e16c47ba4cfb1be03438c203e48a&chksm=ce21da5ff9565349226680d1cb3b71f6667f69dce4034ae0137de8dd3fb112b364f759a37701#rd",
		783: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484022&idx=1&sn=c12639441da4b76eb8f1f7f5ba8d42fa&chksm=ce21da5cf956534a65fbf1fd252569305d98d4358707af320096ccb725dc2550eef71ccb571b#rd",
		784: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484023&idx=1&sn=4dadb87b5ddb666abec8077a51e0598d&chksm=ce21da5df956534b4fd639967f0a14caedb5cc36acf84a7d5d92b7feb2a6754f5d321795a4d5#rd",
		785: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484024&idx=1&sn=3afca40270a0f332a9916e86926c31a4&chksm=ce21da52f9565344e18a9a2fcb10e460d9158f6622275094320dfce7ebfe05ab79b00622a1b1#rd",
		786: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484025&idx=1&sn=3a031e03f5a5fe117cd2e056ddd5b2b7&chksm=ce21da53f956534519d0436a2b43cd3b2193d7439ca78a2d411148ad90a2b7de7ca492bc4104#rd",
		787: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484026&idx=1&sn=6191dbfc6c10ac4bd13ceecd2c3a3dc6&chksm=ce21da50f956534620b0b750c82f9c4d41d28221be7e38c8efe0f3afeea7bb197afbe3a53ff8#rd",
		788: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484027&idx=1&sn=d5dbccb8a2210b756be1f67b6ed1ac9a&chksm=ce21da51f956534703b91883da5260af477e3c0f2232ef36581d40fe6eb3be38f568d07602d0#rd",
		789: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484028&idx=1&sn=620799d1f8417982e4eebf1f3e6d1cce&chksm=ce21da56f9565340c68c9e4d8262ce1f0ccd7edf84142b49f8bf0dc7ba40bda17dfe7600ad79#rd",
		790: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484029&idx=1&sn=9501ecc701e6d5b96e01c50a399d3063&chksm=ce21da57f95653418d71b46f67bf19d73f77daa5bf12d427c392926e28548b1934bddab48f4c#rd",
		791: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484030&idx=1&sn=f28a11db46de464d1d8d5d5688534766&chksm=ce21da54f956534200a6f36da154c0903b19ae83464dc1357e83d7007df211bd2c2048e672b4#rd",
		792: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484031&idx=1&sn=69a4fd8176137e7aea5905516b9e966b&chksm=ce21da55f9565343448abb3a85a53abfdc83e448e849188d44288778b7af21d65dcda94be962#rd",
		793: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484032&idx=1&sn=1bdce7fbe685675b6cd1b3dc04514b36&chksm=ce21daaaf95653bc452402fc6cb72b2638c8c781727d3b9c30c1914235057fbf799a539976ca#rd",
		794: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484033&idx=1&sn=e647faff2e77ceeb11dd348e44b124be&chksm=ce21daabf95653bd2411ce23f8b979f2ea537a76c0d322619bfeae39a463d3a380c6d3111418#rd",
		795: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484034&idx=1&sn=07fec750f8fed2de16aa963ce6ccb3df&chksm=ce21daa8f95653be9543e22df3aa88a0cdd442908878584c1df138cd1d5c4a5c4c768c5ea7f4#rd",
		796: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484035&idx=1&sn=62853daf0450678530f236470365f677&chksm=ce21daa9f95653bf09a87778bc3b899506b2c89dfdecca5db338c414393d6796a045cc436ce5#rd",
		797: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484036&idx=1&sn=4202d6eae6d0b324f72049b44f3bf3d5&chksm=ce21daaef95653b89af416f3e62d4747466772fb55c59a8823fe9b64145355fb10dc075971b5#rd",
		798: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484037&idx=1&sn=fad6ab62c5c45d23bdb33806d9e5d52e&chksm=ce21daaff95653b93f15331dcbb8b6158c45fc9c9bed895f9663d8068eaf1ed06ca35730bb3b#rd",
		799: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484038&idx=1&sn=4a6a55f0c36ce858172c13aa4b907ab9&chksm=ce21daacf95653ba9445487d2fe4a0cbafb17b83fd466b4a90f90460b09ec0da26d8ddbfb4c1#rd",
		800: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484039&idx=1&sn=c3e83e9f357917866f1aca28efb82831&chksm=ce21daadf95653bb391fc0330e3feb7fe0ce38450e63a098c83af7b3855358ee215a6c936bbf#rd",
		801: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484040&idx=1&sn=9ae6e5e9ff264f916c1efaa0eae2c7f6&chksm=ce21daa2f95653b4660c58e51438b693dc2c1652af4faee4b451b2598143b2f601a9fd92c8bd#rd",
		802: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484041&idx=1&sn=c68006e4170a95ebb86b844876973e05&chksm=ce21daa3f95653b5249660544da5f2dd6a8917e72f4d1f6b51de781e85ef6d6237fd3ce9f2c0#rd",
		803: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484042&idx=1&sn=4f6d2100924553a0252c573a9135d0e5&chksm=ce21daa0f95653b609a15b2280379ce897b585665ecb6b027b07086d071d429201ab33affedd#rd",
		804: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484043&idx=1&sn=9e964bd116a85898ecfe04e9edecce66&chksm=ce21daa1f95653b7dccf404f28245a6161bccd7d75bb8f39d7fe88503a21aab9eba3c8a3782f#rd",
		805: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484044&idx=1&sn=3e7dd5ad2dc21f46ccc5173edf9ce290&chksm=ce21daa6f95653b0739798e74bf225929c81a7789a32094e167a90ca04b21b2926ea537db483#rd",
		806: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484045&idx=1&sn=d3a13f1c9e72a951964c41ae89a75eb2&chksm=ce21daa7f95653b181535a9adff5a164ae32058c0aff30d68088bace2857fd65bf7547228fe4#rd",
		807: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484046&idx=1&sn=a201fc386476af6ed90be42f9645afd2&chksm=ce21daa4f95653b2b9bbe24935283fa10055d5dabf0def5d6afc1817547373f80e18c121b113#rd",
		808: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484047&idx=1&sn=27020fd351696c2658f5221be9cd5d89&chksm=ce21daa5f95653b34999b42899b7206cca1808ca09c64ae5186bf781bda6031c724ac7cae72c#rd",
		809: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484048&idx=1&sn=2ad58ed746ad46f4f4527ab8752e1089&chksm=ce21dabaf95653ac955776700c43792da6cd35697e7f85225791662f52bbd8c568583ae87060#rd",
		810: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483718&idx=1&sn=a294835c8d21e1b8cc4a38b4dcb69b42&chksm=ce21d96cf956507a92d350a27e4d97186152815ad765732f9008b8f8e11fce6d3a9f9209a47f#rd",
		811: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483719&idx=1&sn=f7ba057f1d3c5bf7098304f8a68576b9&chksm=ce21d96df956507bd0523cb7ba7d5ff4c93ec601921b25a11ae7b2cee21284ccba03c69df2ac#rd",
		812: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483726&idx=1&sn=36e84a9d11ffb20259d965e24a3c3a33&chksm=ce21d964f956507279c7906275fa346fdb085286611f02514cff1a79fea383c65dca5c220589#rd",
		813: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483732&idx=1&sn=099adf5e75bd6f4534319a98d091bd3e&chksm=ce21d97ef95650683e547b7a49d9100eedd86f0d43ce3ae48f87f79d0bc8670ee0cab50663eb#rd",
		814: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483733&idx=1&sn=584387cfb0e8b2a7ced8ba25966d5172&chksm=ce21d97ff9565069ab3cd1e62b03a8cd5dcb60b2ec52eb18cf1f7346225a99355ce1dfd2c402#rd",
		815: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483909&idx=1&sn=e457a4e7e55585df0202f6a039912786&chksm=ce21da2ff9565339cb2ed37e51fe05d059ec578abbbbe389e401d6c900c3ee1f09e40c8052cb#rd",
		816: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483910&idx=1&sn=2fa1115829589149e0d7686a5c7a36b2&chksm=ce21da2cf956533ad93687cca63f82cf66aba8230760fa5978b73c84e9f6511392e6b5eb439b#rd",
		822: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483911&idx=1&sn=752b23cffff17657e71e51f176fb307a&chksm=ce21da2df956533bb966989da665b14c008ad320f0254990578c100d90e1c37eb356f35a4e0f#rd",
		823: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483912&idx=1&sn=cc84987bb728b18030e2366f5fa636c4&chksm=ce21da22f95653341cd2db61a6863d8a33da3c426bcaba7e1a4b63bb61448ba7214840cc7111#rd",
		824: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483913&idx=1&sn=074b3e3361920d559ac9d18d3912ba91&chksm=ce21da23f9565335ad86357fd16896ca1a5b4e105a2551dd7eb2f58c15fd12e9d8499ba41d56#rd",
		825: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483914&idx=1&sn=2016c661f2f171a0763f210a644fcd77&chksm=ce21da20f95653362c012f51860d2ad4a1528d701bc1c5b81e35dcbff37244eadad54f179063#rd",
		826: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483915&idx=1&sn=3423cb0872484b4d9313f9437bb1223b&chksm=ce21da21f95653373d16105a21673a047fa2145316995e9bb93100a26570efe23f02137c1a83#rd",
		827: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483916&idx=1&sn=b2cc0d80ed2d00b1f34355244253481d&chksm=ce21da26f956533025e4af9b957406e4138d7d5e422a36c955f4696793f24ffd930e536ba93b#rd",
		828: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483917&idx=1&sn=0f9c7338952d72044d495141677cf26f&chksm=ce21da27f956533178fb27bbcbf48b813cafe5f378b1b417c2d8a5ebc35e958bc68d15c9d0d3#rd",
		829: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483918&idx=1&sn=2a935633c29efd549fdd53bd1aec42b6&chksm=ce21da24f95653323dae74d2e996b03ae4e87b5dc3ea9ad4c0306cab3f333adf8ec2b91e5819#rd",
		830: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483919&idx=1&sn=e0937ddc77d6d2dcdb81cce618e911f5&chksm=ce21da25f95653331bc4c3b2e004aba852587d2d84e859b5715e9734f49e6bc0c4fbace6527b#rd",
		831: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483920&idx=1&sn=0e966648535c2cfb1c8de2e26d01b83e&chksm=ce21da3af956532cf4f2aa8206d7f6cea3ee8fe7414082ec792c338a2b1f0c4ff14149d87e13#rd",
		832: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483921&idx=1&sn=4777a4dd651827105ae2527379d56a6d&chksm=ce21da3bf956532d28de2d2b87d29e5da514e198d2b6521d3587bda8c1a3f5246b75bb1f55ad#rd",
		833: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483922&idx=1&sn=cde1eeb7a2455618d489d938dacaa8b4&chksm=ce21da38f956532e4a15d69c16f0101ffced9f313188cfb117cc63a0462a4c953dc8746b4324#rd",
		834: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483923&idx=1&sn=7d04a16565643ea039c799206946e02a&chksm=ce21da39f956532f7e7d7ec7750b76e9f4b881a0e4558593a1ec24df10dfb4bed5a7b1a05b47#rd",
		835: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483924&idx=1&sn=c9217eab5cbce6e2374511390b5b7391&chksm=ce21da3ef956532806a934fff4e4b82bf19b819f3b5d89a2a8af7133b1cb0714724708a428a7#rd",
		836: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483925&idx=1&sn=cddebc533f07c7dbeace8413a76a5be0&chksm=ce21da3ff95653298526c969e242de4256605d95648a47960b3ee3984ca2dc2f69f2f6a7738b#rd",
		837: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483926&idx=1&sn=b4dbc61ba65f86706a9ab430a39d25d8&chksm=ce21da3cf956532a1e89b5d8aca38d811bf7aaf344b0a5c5b1a51bc7cde7d9646831f62a0eef#rd",
		838: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483927&idx=1&sn=8842485d4b886efd59bcd5d086ae31e8&chksm=ce21da3df956532b144fd3dbd970b8ae64dcab2269be40ab157ea1fb23f265d0557990040475#rd",
		839: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483928&idx=1&sn=63ad55396084b09ffac6089c19c1768b&chksm=ce21da32f956532481358787c983b0afa7f4a2fecb7717d9b2ba12cc04f4a6baaa3feafc7878#rd",
		840: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483929&idx=1&sn=5b4e6c589eddb099af81193df2643280&chksm=ce21da33f9565325f82135c2d525ec92ddd6d1c912901aa68b6aa70bf80d8b48520541134d6d#rd",
		841: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483930&idx=1&sn=84b90af0526b2ab7b5eb1be04cbaae5e&chksm=ce21da30f9565326250fdf5736d864842c6feee4ca938dd342eff3a24f3f8299fd87289e41ae#rd",
		842: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483931&idx=1&sn=b4095d15404f92a6bab0eb29901b0bab&chksm=ce21da31f95653279f1796fe836f90a65f514ba944918ee78999dad830f032de98af9052242b#rd",
		843: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483932&idx=1&sn=fb7fc0c5579ae402e4ba0f1d6e316a71&chksm=ce21da36f9565320e9c6b720473deb0d9fc5b0ffefff906ef40283ceca2e2460cc3667a0eb23#rd",
		844: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483933&idx=1&sn=73f85458842c6ea67726e34ddf0a203e&chksm=ce21da37f95653217e5a0918104e478c2a21dbe6c322e0b1c352f5ecdaf0a0bbae7278a16357#rd",
		845: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483934&idx=1&sn=bb30d508b335a6fa749307117dfb3159&chksm=ce21da34f95653226778afad71b7d0d57e3dfb2e28e1aeafa57401953e258ead440b1a6b7a9a#rd",
		846: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483935&idx=1&sn=03285a64c2ef55f632d9957543a53b8e&chksm=ce21da35f95653233b5a0503d712303d0c70b7e55edf762c458a149ea56519634f470d58637f#rd",
		847: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483936&idx=1&sn=fa668682fafc8dd11e1f4beb3787868a&chksm=ce21da0af956531cca246162f328bb154c6bda6c4d097e95d0786728965e6fef0827d5f1cafd#rd",
		848: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483937&idx=1&sn=78f020770919fd800676578767c68fee&chksm=ce21da0bf956531d2d4a8dec86976932ace69b06a17016e015e80e527febac71fd268222958d#rd",
		849: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483938&idx=1&sn=8cfca11f84aadfa1ab79b5de11e44492&chksm=ce21da08f956531e9f57cb236fb6ec177055937bf5f593eb09584c7ef3dacb18ff0b88c2b5a3#rd",
		850: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483939&idx=1&sn=e220f499968735eac0fee487af18a517&chksm=ce21da09f956531fcf19a183fe17b3d023e8c5f933b47947abdb8fdd3c0e62abc6ce66a3ecbf#rd",
		851: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483940&idx=1&sn=0c2fe2aa20b2884a5941370bd98e7d3e&chksm=ce21da0ef9565318e3f65d00f971b307100367a6e54f862032d8f320643cd9bf5f2659b3e28c#rd",
		852: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483941&idx=1&sn=ca0f9ac6aea5f93600f96c99aff87d85&chksm=ce21da0ff95653191b4216912a21cc80326fc9a046085e72b6ae6cda54b8aea0e36325250f6e#rd",
		853: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483942&idx=1&sn=71dda78a595c5b0cbaf0411226b83796&chksm=ce21da0cf956531aeffaf77482a5aaad94c49e4cfd387b872cbed4cb60699f5e0ed1808493b5#rd",
		854: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483943&idx=1&sn=f8067d61ace73f7f7269c6d4be247885&chksm=ce21da0df956531b40fdddac88596808b0e828d3385239923896aa84ade84391c98cf5bde6f2#rd",
		855: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483944&idx=1&sn=a013ad265c5615d8ee0e383c4ae48683&chksm=ce21da02f9565314991d2f0c1d002da16bc3ae629c995743d4a1e1ce5491f5ebc1a1304ba863#rd",
		856: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483945&idx=1&sn=2a1e124eec59a4a5d9ef9ba5f84bb2db&chksm=ce21da03f956531529d6db0ce43ed96684306c99ba193f806ca339bc78e9ce8940122dfe2891#rd",
		857: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483946&idx=1&sn=0cbcb61a80c5136dfaab4329c2adc780&chksm=ce21da00f956531627f02140920e94f65f37e3a26c3078ccee1fda8681fda7f2391294346f97#rd",
		858: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483947&idx=1&sn=011baae1e89d6f36155bd628118a2b4f&chksm=ce21da01f95653179baca1bd19094479da7afd094fc3525f568c510c7165d135fe9c27dcaf0d#rd",
		859: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483948&idx=1&sn=4e0a882ef56d76d471d36b2c09dfb046&chksm=ce21da06f956531007fe1df550c8756d6a834cdc55b31d497ef7148ae1e31f90247ea681f749#rd",
		860: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483949&idx=1&sn=b2c23520f8f6807906aa4092ced75375&chksm=ce21da07f95653113041f62837ac5d16eae78e2cf88fc0cb004bd8a3555ffb105c198e3f5b61#rd",
		862: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483950&idx=1&sn=8d832e0410311cc08c587d010163c495&chksm=ce21da04f95653121c3e045f8fe1eff7818136e630158601075993f7a2ee8cd17d15756f8515#rd",
		863: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483951&idx=1&sn=83cc1ff507dd4d8ff18dd2b39e188ba5&chksm=ce21da05f95653130d52e91397e117154a9babba95c45d6940fb3cae12ec35d9504e98e3eb1f#rd",
		864: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483952&idx=1&sn=b07ee6e8e43568cad026f03bd0d471ca&chksm=ce21da1af956530c561a04fd26734ba44f3845a53dc47d376e001c1aa7a487449ddbece74864#rd",
		865: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483953&idx=1&sn=6fd9ed034cb2bc3d8642213d6d8622c9&chksm=ce21da1bf956530d8a3bd6924f6b5af1c56b3279155be5ce73f20ea4b0ab96c4d0a0e43a685e#rd",
		866: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483954&idx=1&sn=9053367c1374022e41d67b3c45f468c6&chksm=ce21da18f956530e5e6e18c4e59ff143e4f08328b031b410bf20a3e91a2c4b4602454b7d63ca#rd",
		867: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483955&idx=1&sn=9c590496b28f7ea47d156eadebc11d00&chksm=ce21da19f956530ffac5201b30caefda031c5c6551c7f2e2b63849c24590023cd7432ed7b126#rd",
		868: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483956&idx=1&sn=30f6a5622ca59628382b08980a40a65a&chksm=ce21da1ef9565308062920a4b38f720aac2090147effd1b509b6e4a99f1ffa4a163b775c8fc8#rd",
		869: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483957&idx=1&sn=1d3220d471666cfeb6d5ab3a6067efa3&chksm=ce21da1ff9565309e456d3ae1eaa93be2d0203197db354a11c3ae3ed827caa37bf3045a76818#rd",
		871: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483958&idx=1&sn=7e2203670dd559eab0a52985f091fff8&chksm=ce21da1cf956530a0cfe2268229e685a860fad031830fb214694d61a8a1a4431c7149f34e8b1#rd",
		872: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483959&idx=1&sn=c7206a3c5ce71fd3c83341d2aa64cd79&chksm=ce21da1df956530bba0cf1e41ee0b337f92913309ef254ec231be1185371d72f78a1152b44ce#rd",
		873: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483960&idx=1&sn=a8a56c5e25405a76453cf5225da299cd&chksm=ce21da12f956530494139696c17c680d5a732992cb0c8ae6c55779486a03a5884f71a3440f10#rd",
		874: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483961&idx=1&sn=b37594f757dbf6dde175ebbc9c7dcb61&chksm=ce21da13f9565305bdbd84ac97c387464247d55c97c8afcfb6d6ae7fc6b104c7f8f720ce4447#rd",
		875: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483962&idx=1&sn=e4b9f4177d5bd4d36e8dd60e9a554cc5&chksm=ce21da10f9565306c307b25577f4fff41e5bb5a7208f158330e706233ebb0b293667093f2721#rd",
		876: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483963&idx=1&sn=79561e3e36207496877dc6f53fa06a77&chksm=ce21da11f956530731658c879fc445c58212fb1274e899f7cea885e8502ee3dcad264a95ff87#rd",
		877: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483964&idx=1&sn=c1b5f4ba4f1e5acd21bfdc9e26955ecd&chksm=ce21da16f95653000ae4701577d0de6efee27426963fe1bf8ad17182459b7c7af9f9de61b33f#rd",
		878: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483965&idx=1&sn=5b4f6f6ca19799ecdad229852b2a4717&chksm=ce21da17f9565301f9c5b951a2614f676fbfcdc0bb552833506bc5c8412bbc29379dccbd71b2#rd",
		879: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483966&idx=1&sn=156777dbea0c6df423f2ad92bef2e801&chksm=ce21da14f95653026064342a81be8f85e37947b5cfcc4391903a895eb7215f6fe04ab9956e05#rd",
		880: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484079&idx=1&sn=780bf8ec0190c80b1c322809689b6d03&chksm=ce21da85f95653939dbb78f586b9ad89962183a5d0a69e19cb0d2745564a14b50affe1d6c404#rd",
		881: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483968&idx=1&sn=d7388333230f122b3b459204e2836ca1&chksm=ce21da6af956537c13bfcfbfb03a98bea96e346107ba0b1ce0e1fd2c6507137d56ede359785c#rd",
		882: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483969&idx=1&sn=9351021dca33af3d260a0b4aab1ff63d&chksm=ce21da6bf956537d13c3d9e8818038c98b5362153fe7b960a2fd2fb62845008e1650770a5077#rd",
		883: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483970&idx=1&sn=de5c98ecb178efa297d0a7b24b4aa9b1&chksm=ce21da68f956537efdf19f46f4028628cd5f8c01fe4f965a3cbf1683761c83c3cfdae7360d61#rd",
		884: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483971&idx=1&sn=935d4dae6aaecf2a1915485f6ff33835&chksm=ce21da69f956537f8a6290d0612505fa96772b123a04f40262e2492592e9d4c347e8f4ef5911#rd",
		885: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483972&idx=1&sn=b4fdb5cf3c015c4af9c144cad67e42a0&chksm=ce21da6ef95653785cad2b96ca04bce0dc30f60a9865427c83b1503e134987a324d6068c3886#rd",
		886: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483973&idx=1&sn=7a4727985d1aac70fec8b4b18f680c89&chksm=ce21da6ff95653798b7d0847d54fb555b48b0302f4b20f40ed00546631711a1a6c3818696902#rd",
		887: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483974&idx=1&sn=a5f1b63a69924794972daf76b4a89cec&chksm=ce21da6cf956537acfe473ef34524b5e0791d497327e2559d76d717e60ac1e15210d87198201#rd",
		888: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483975&idx=1&sn=827966ecfb52e12c2b4f92a6f8c22c60&chksm=ce21da6df956537beeb4f46b30b24332365dd59cc89be698f05aac66e8962072680c7d41ec43#rd",
		889: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483976&idx=1&sn=571dd76eed987036dd0662fbb2858828&chksm=ce21da62f9565374e8cae9f01b58a0ececf6b31f1c4559bbb79a01b9d9661aec635255988cfe#rd",
		890: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483977&idx=1&sn=d61e3c3fae4edad284e88399dae6af2e&chksm=ce21da63f95653759aa66843a50372c4fc2ec8d176a4d4e87768c0f50745c6133f910c7738fd#rd",
		891: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483978&idx=1&sn=4ca6b5277802dc3cd26adc42c108eeaf&chksm=ce21da60f9565376d31bd1633de653d6788cd637c8ed785d511853d54790dfeb1db55544d260#rd",
		892: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483979&idx=1&sn=ebb6c8a58f2f2884831cd5b4f299398d&chksm=ce21da61f9565377734b9d42f7f326c4b3e5256f51ac3295a1ee9b52533e9ceb59beaa9328ef#rd",
		893: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483980&idx=1&sn=72bd870c9fe2af8df3f32c4bec73bd5b&chksm=ce21da66f95653700adf710f739b922e68ac831de9f53a2a978fc2def8f067bdf5678a13b883#rd",
		894: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483981&idx=1&sn=b61842ad3f4cc1dd1f204ddbc9ee9317&chksm=ce21da67f95653711e310ecfdce8a1f7594a9f876d2029cdc0ad7c7618a8122b73989e9caffd#rd",
		895: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483982&idx=1&sn=25d6334dd6fa548bbcc68daf9ac1fa1e&chksm=ce21da64f956537238101d19e92df589c67ac23b4e687eb6f4b2efd267b2f1c80430829ff641#rd",
		896: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483983&idx=1&sn=7a5ae9500e93a0959178cec0ecf9d49a&chksm=ce21da65f95653737c59e4d0c46a47594825dca9c914c7159b5de7a5e8e26c244c8556648524#rd",
		897: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483984&idx=1&sn=6fa6633207fa677437f3fbde4de1823f&chksm=ce21da7af956536cf52fb661f1bde10bb468da713c46ab331fc2c240eda10694a563b1b059af#rd",
		898: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483985&idx=1&sn=19038a28b1ce4fd1447e903427b7564a&chksm=ce21da7bf956536d310e5784875afbf56f84f3caf4652cf41a44465ad8a69e95e28cf7106b06#rd",
		899: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483986&idx=1&sn=666724d846df10ab36437979bdbe297e&chksm=ce21da78f956536e4d17cdc80cab7661119e83b68d4743a3981e9d3c4d0aae8b74ee33bd774b#rd",
		900: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483987&idx=1&sn=678420673d131081708c205f33f6059c&chksm=ce21da79f956536ffdfe92a0bcad7e974cda9dc05ee0a56a6fe908aa761ca9b73bde36797b5d#rd",
		901: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483988&idx=1&sn=89b1f05de0a21d8aec182a06f86ff6e0&chksm=ce21da7ef95653684eaf8dc1f6b6dfd2df89177339916208ff79e8e2dae13ee766bde2a13c6f#rd",
		902: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483989&idx=1&sn=fb0ba5431bf0e8007bf54e4a058f4c35&chksm=ce21da7ff9565369591f37f75c27c67e08f6c847c88940fd89eee12e5b9a0965f278be21b0ae#rd",
		903: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483990&idx=1&sn=5bb26f68ea69bfeef1d19d1a6a9c0323&chksm=ce21da7cf956536adea3e2da6437b50720bae87a3bad26cb124e1d242f8505056c3d046f573f#rd",
		904: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483991&idx=1&sn=fbe8689656e9f0ccef33cfc797918f72&chksm=ce21da7df956536ba49fbcec0082a027d6c2519dd97f694dd21af51b7a069ea4b68695dd73b7#rd",
		905: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483992&idx=1&sn=5d6d669c0f028e1068b9451c18e82a5a&chksm=ce21da72f9565364a0b8eb06df8b109c0b4ccbad010f27322788cf22ed044bc070ee65875c72#rd",
		906: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483993&idx=1&sn=276a2a1e96b723d3372de92d639dad41&chksm=ce21da73f956536595a0ab0de10cfab535b79d572911875798a282aa6fb55cc4734e2702ffbd#rd",
		907: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483994&idx=1&sn=fadabe9c4acab0c6089d18ed316ca4f2&chksm=ce21da70f95653665124825f5c1ef45f863448cc6caa0ec4e4551dd16de698538bf2b8bbcd9a#rd",
		908: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483995&idx=1&sn=e80be5e3befa3053ae185f7adda65bf0&chksm=ce21da71f956536713b1ff4ee735d29f0399e7fe0cd9b227f76a8036417f5425f4f9613e637f#rd",
		909: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483996&idx=1&sn=04f47ef5a6d496622e099e82913ae1e7&chksm=ce21da76f9565360eac619a753d4afdb4307493d362f94e93679645d65de800a1fe705d17572#rd",
		910: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483997&idx=1&sn=57bef6716c2e5d3bdd313ed82f6cf80b&chksm=ce21da77f95653616ce852a9524835fdf3db7c1d5cef9fcab6bbd27c4b37c73fd36a96418558#rd",
		911: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483998&idx=1&sn=b23ffcb17f0c45fd7c9d6640f396e28e&chksm=ce21da74f95653625926eebbeb5ccdd22e392cce35a82e7cb5ca8bf7a45c59936a1c8188ece3#rd",
		912: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247483999&idx=1&sn=96bae205d2c49a35e39d1f9fb208f25b&chksm=ce21da75f9565363ec64e808ca58b4ec51f99d76634dd6d2ee01a635c96ef6ff4532e96eb97d#rd",
		913: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484000&idx=1&sn=0b8c8ae540391844b7530ff6a4efa840&chksm=ce21da4af956535c21d40060c970e94429e91dbc0b256d1e180e3215abce852caef1d4099579#rd",
		915: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484001&idx=1&sn=2cf508d7983e1937c67fd5cb648352a7&chksm=ce21da4bf956535da97cb7f0d353352df91d6371bad998f92c0ce180fe73c6d7f085be0efebe#rd",
		916: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484002&idx=1&sn=ea25e98a95ec57aa1d3e6524e5b527dd&chksm=ce21da48f956535e130472be2c2a4b02ab2d879eba280785d6e7b98a2c260d266f0607231622#rd",
		917: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484003&idx=1&sn=4def9d9e1fab844d9d96bc3fc0f8a8dd&chksm=ce21da49f956535f41cc9970b38284dde328e395e235b794d6967feac046d6f480675778ea3d#rd",
		918: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484004&idx=1&sn=cfd277dc0c21feef989f35ceaadabf8a&chksm=ce21da4ef95653584d5ef1d7b1374be468e5cca712045e9534924dbda0e44f207f725aa46258#rd",
		919: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484005&idx=1&sn=c3a0db6f37d2f43b798ec7abf2b76084&chksm=ce21da4ff95653590d2ad9034af11f584f4df9626415cc606b63c628571df3ed4e08e86f6a58#rd",
		920: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484006&idx=1&sn=2f48d5749108b2b394498a57eaad6431&chksm=ce21da4cf956535a95de48227b7378274f50427fdb913b565a95756477eb4142968cdccbf18f#rd",
		921: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484007&idx=1&sn=f2add16ee161796fda1d9f2576f66aae&chksm=ce21da4df956535b9912645a6e8247d39479e99d2575251f01c00dcf81924ec3a8b724d21e13#rd",
		922: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484008&idx=1&sn=344da2624011629280994fadfe918c8d&chksm=ce21da42f956535499d960ed0399906e7561da09a3f099742d5d5def5d1d00b087f5e001e87d#rd",
		923: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484009&idx=1&sn=de6574db8fc968863030421f05359b72&chksm=ce21da43f95653556e340327b98add97b784e44a91c693fbf4656e71a8730885da4de2ac9589#rd",
		924: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484010&idx=1&sn=ef647fd3180f17309dccba9f73fdcd7a&chksm=ce21da40f9565356fb4fa190dc4946b3a56e4359f7887b5d2208a66b59f9ccb5d6376103d79b#rd",
		925: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484011&idx=1&sn=efb45a603071873446bbf21ccb84fdd1&chksm=ce21da41f956535757720e6053192d36c37455e6ef4538e2dd1d7137650e0211e606d07a086e#rd",
		926: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484012&idx=1&sn=c28b15a22cabcc0d207195e1162ac6c1&chksm=ce21da46f9565350ed3779e395af0648c054c2a26044d2fa04d734ac44c36cb27ec190f276de#rd",
		927: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484013&idx=1&sn=e0ce501c30c73a5e236f196d61cc1ccc&chksm=ce21da47f9565351a9e2a7749681dfb22a368acf2a66a62ed4205e9ef7e360b89a70ae5aedca#rd",
		928: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484014&idx=1&sn=16fae9f1d4086462a11118a7d1f313b2&chksm=ce21da44f9565352584e30ad177d5ce3496cafcf0ddfd85a72762ca38687a8d91e9f74069114#rd",
		929: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484015&idx=1&sn=dd9be4e30b24b2a07c18fac84f5484fa&chksm=ce21da45f956535333859ede743318429131812875218f4523c022db8efa7bec65ed2ef38ca7#rd",
		930: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484016&idx=1&sn=5e18cded6d865ee37707639df8a9e3e6&chksm=ce21da5af956534c478b6ee2f673a484225720322877025f1c6e73d48db64842d9155b8bc0de#rd",
		931: "https://mp.weixin.qq.com/s?__biz=Mzg2MDgxOTc4MQ==&mid=2247484017&idx=1&sn=aca7675b55765ab2be522ddcc1aebbd2&chksm=ce21da5bf956534d0e25ea2dc65386ae027a316722e5f8fdf462be8cc5cd149c411f4a5d795b#rd",
	}
	var games []models.GameCard
	orm.Eloquent.Table("game_card").Find(&games)

	for i, _ := range games {
		err := orm.Eloquent.Table("game_card").Where("id=?", games[i].ID).Update("video_link", linkMap[games[i].ID]).Error
		if err != nil {
			fmt.Println("err:", err)
		}
	}

}

func TestMemberExpirationReminder(t *testing.T) {
	InitIODBTest()
	orm.Eloquent = IODBTest
	models.MemberExpirationReminder()
}

func TestExpireMemberSMSSendDay(t *testing.T) {
	InitIODBTest()
	orm.Eloquent = IODBTest
	models.ExpireMemberSMSSend()

	//nowTime := time.Now()
	//models.ExpireMemberSMSSendDay(1, nowTime)
}

func TestCreateInviteMemberReport(t *testing.T) {
	models.CreateInviteMemberReport()
}

// 店员邀请
func TestCreateInviteMemberReportScript(t *testing.T) {
	CreateInviteMemberReportScript()
}

func CreateInviteMemberReportScript() {
	//InitIODBPro()
	//orm.Eloquent = IODBPro
	InitIODBTest()
	orm.Eloquent = IODBTest

	//date := time.Now().AddDate(0, 0, 1)
	//if date.Day() != 1 {
	//	return
	//}
	date, _ := time.Parse("2006-01-02", "2023-03-01")
	for i := 0; i < 7; i++ {
		if i > 0 {
			return
		}
		end := date.AddDate(0, i*(-1), 0)
		//end := models.InDayZero(1)
		start := end.AddDate(0, -1, 0)

		var cooperatives []models.CooperativeBusiness
		err := orm.Eloquent.Table("cooperative_business").Find(&cooperatives).Error
		if err != nil {
			logger.Errorf("cooperative err:", err)
			return
		}
		for i, _ := range cooperatives {
			//cooperatives[i].InviteMemberReport()
			var users []models.UserInfo
			err := orm.Eloquent.Table("user").Where("cooperative_business_id=?", cooperatives[i].ID).Where("user_type=2").Find(&users).Error
			if err != nil {
				logger.Errorf("cooperative err:", err)
				return
			}
			for j, _ := range users {
				//m.UserInviteReport(users[i])
				userInfo := users[j]

				var userInvites []models.UserInvite
				qs := orm.Eloquent.Table("user_invite").Where("from_uid=?", userInfo.Uid).
					Where("member_status=?", 2).Where("user_type=?", 2).
					Where("member_open_time>?", start).Where("member_open_time<?", end)
				qs = qs.Where("action=2").Where("spend_type=2")
				err = qs.Find(&userInvites).Error
				if err != nil && err != models.RecordNotFound {
					logger.Errorf("cooperative err:", err)
					return
				}
				m := cooperatives[i]

				reportTime := start.Format("2006-01")
				fmt.Println("reportTime:", reportTime)
				//m.SetMemberDeductConfig()
				m.SetAssistantMemberDeductConfig(uint32(userInfo.StoreId))
				if m.CooperativeAssistantMemberDeduct == nil {
					logger.Error("cooperative assistant member deduct is nil")
					return
				}
				//exist, err := models.QueryRecordExist(fmt.Sprintf(
				//	"SELECT * FROM invite_member_report WHERE cooperative_business_id=%d AND date='%s' AND store_id=%d AND uid=%d",
				//	userInfo.CooperativeBusinessId, reportTime, userInfo.StoreId, userInfo.Uid))
				//if err != nil {
				//	logger.Error("cooperative member promotion record exist err:", err)
				//	return
				//}
				var reportSource models.InviteMemberReport
				err := orm.Eloquent.Table("invite_member_report").Where("cooperative_business_id=?", userInfo.CooperativeBusinessId).
					Where("date=?", reportTime).Where("store_id=?", userInfo.StoreId).Where("uid=?", userInfo.Uid).Find(&reportSource).Error
				if err != nil {
					logger.Errorf("err:", err)
				}

				report := &models.InviteMemberReport{
					Uid:                   userInfo.Uid,
					StoreId:               uint32(userInfo.StoreId),
					Date:                  reportTime,
					DeductAmount:          0,
					CooperativeBusinessId: userInfo.CooperativeBusinessId,
					CooperativeName:       userInfo.CooperativeName,
					GoldDeduct:            m.CooperativeAssistantMemberDeduct.GoldDeduct,
					PlatinumDeduct:        m.CooperativeAssistantMemberDeduct.PlatinumDeduct,
					BlackGoldDeduct:       m.CooperativeAssistantMemberDeduct.BlackGoldDeduct,
				}

				for i, _ := range userInvites {
					switch userInvites[i].MemberLevel {
					case 2:
						report.GoldCount += 1
					case 4:
						report.PlatinumCount += 1
					case 5:
						report.BlackGoldCount += 1
					}
				}
				report.DeductAmount += report.GoldCount * m.CooperativeAssistantMemberDeduct.GoldDeduct
				report.DeductAmount += report.PlatinumCount * m.CooperativeAssistantMemberDeduct.PlatinumDeduct
				report.DeductAmount += report.BlackGoldCount * m.CooperativeAssistantMemberDeduct.BlackGoldDeduct

				if reportSource.Uid > 0 {
					//err = orm.Eloquent.Save(report).Error
					//if err != nil {
					//	logger.Error("invite member report err:", err)
					//}

					//fmt.Println(report.Uid, report.GoldCount, report.PlatinumCount, report.BlackGoldCount, report.DeductAmount)
					//fmt.Println("reportSource", reportSource.Uid, reportSource.GoldCount, reportSource.PlatinumCount, reportSource.BlackGoldCount, reportSource.DeductAmount)
					err := orm.Eloquent.Table("invite_member_report").Where("id=?", reportSource.ID).Updates(map[string]interface{}{
						"deduct_amount":     report.DeductAmount,
						"gold_deduct":       report.GoldDeduct,
						"platinum_deduct":   report.PlatinumDeduct,
						"black_gold_deduct": report.BlackGoldDeduct,
						"updated_at":        start,
					}).Error
					if err != nil {
						logger.Errorf("err=?", err)
					}
				} else {
					fmt.Println("不存在", report.Uid, report.GoldCount, report.PlatinumCount, report.BlackGoldCount)
					report.UpdatedAt = start
					err := orm.Eloquent.Create(report).Error
					if err != nil {
						logger.Errorf("err=?", err)
					}
				}

				//if len(userInvites) == 0 {
				//	err = orm.Eloquent.Create(report).Error
				//	if err != nil {
				//		logger.Error("Create report err:", err)
				//	}
				//	return
				//}

				//err = orm.Eloquent.Create(report).Error
				//if err != nil {
				//	logger.Error("Create report err:", err)
				//}

			}
		}

	}

}

//func (m *CooperativeBusiness) InviteMemberReport() {
//	var users []models.UserInfo
//	err := orm.Eloquent.Table("user").Where("cooperative_business_id=?", m.ID).Where("user_type=2").Find(&users).Error
//	if err != nil {
//		logger.Error("cooperative err:", err)
//		return
//	}
//	for i, _ := range users {
//		m.UserInviteReport(users[i])
//	}
//}

//func (m *CooperativeBusiness) UserInviteReport(userInfo UserInfo) {
//	end := InDayZero(1)
//	start := end.AddDate(0, -1, 0)
//
//	//var userInvites []UserInvite
//	//qs := orm.Eloquent.Table("user_invite").Where("from_uid=?", userInfo.Uid).
//	//	Where("member_status=?", 2).Where("user_type=?", 2).
//	//	Where("member_open_time>?", start).Where("member_open_time<?", end)
//	//qs = qs.Where("action=2").Where("spend_type=2")
//	//err := qs.Find(&userInvites).Error
//	//if err != nil && err != RecordNotFound {
//	//	logger.Error("cooperative err:", err)
//	//	return
//	//}
//	reportTime := start.Format("2006-01")
//	//m.SetMemberDeductConfig()
//	m.SetAssistantMemberDeductConfig(uint32(userInfo.StoreId))
//	if m.CooperativeAssistantMemberDeduct == nil {
//		logger.Error("cooperative assistant member deduct is nil")
//		return
//	}
//	exist, err := QueryRecordExist(fmt.Sprintf(
//		"SELECT * FROM invite_member_report WHERE cooperative_business_id=%d AND date='%s' AND store_id=%d AND uid=%d",
//		userInfo.CooperativeBusinessId, reportTime, userInfo.StoreId, userInfo.Uid))
//	if err != nil {
//		logger.Error("cooperative member promotion record exist err:", err)
//		return
//	}
//	report := &InviteMemberReport{
//		Uid:                   userInfo.Uid,
//		StoreId:               uint32(userInfo.StoreId),
//		Date:                  reportTime,
//		DeductAmount:          0,
//		CooperativeBusinessId: userInfo.CooperativeBusinessId,
//		CooperativeName:       userInfo.CooperativeName,
//		GoldDeduct:            m.CooperativeAssistantMemberDeduct.GoldDeduct,
//		PlatinumDeduct:        m.CooperativeAssistantMemberDeduct.PlatinumDeduct,
//		BlackGoldDeduct:       m.CooperativeAssistantMemberDeduct.BlackGoldDeduct,
//	}
//
//	//for i, _ := range userInvites {
//	//	switch userInvites[i].MemberLevel {
//	//	case 2:
//	//		report.GoldCount += 1
//	//	case 4:
//	//		report.PlatinumCount += 1
//	//	case 5:
//	//		report.BlackGoldCount += 1
//	//	}
//	//}
//	report.DeductAmount += report.GoldCount * m.CooperativeAssistantMemberDeduct.GoldDeduct
//	report.DeductAmount += report.PlatinumCount * m.CooperativeAssistantMemberDeduct.PlatinumDeduct
//	report.DeductAmount += report.BlackGoldCount * m.CooperativeAssistantMemberDeduct.BlackGoldDeduct
//
//	if exist {
//		err = orm.Eloquent.Save(report).Error
//		if err != nil {
//			logger.Error("invite member report err:", err)
//		}
//		return
//	}
//
//	//if len(userInvites) == 0 {
//	//	err = orm.Eloquent.Create(report).Error
//	//	if err != nil {
//	//		logger.Error("Create report err:", err)
//	//	}
//	//	return
//	//}
//
//	err = orm.Eloquent.Create(report).Error
//	if err != nil {
//		logger.Error("Create report err:", err)
//	}
//}
