diff --git a/plugin/mcfish/main.go b/plugin/mcfish/main.go index cde0b25b28..5ecd5ba8ef 100644 --- a/plugin/mcfish/main.go +++ b/plugin/mcfish/main.go @@ -593,8 +593,8 @@ func (sql *fishdb) refreshStroeInfo() (ok bool, err error) { thingInfo := store{} _ = sql.db.Find("store", &thingInfo, "where Name = '"+name+"'") if thingInfo.Number > 150 { - // 通货膨胀 - thing.Discount = (1000 - 5*(thingInfo.Number-150)) / 10 + // 商品贬值,价格区间 -50%到0% + thing.Discount = 50 + rand.Intn(50) } err = sql.db.Insert("stroeDiscount", &thing) if err != nil { @@ -826,6 +826,10 @@ func (sql *fishdb) selectCanSalesFishFor(uid int64, sales int) int { if time.Now().Day() != time.Unix(userInfo.Duration, 0).Day() { userInfo.Duration = time.Now().Unix() userInfo.SalesFish = 0 + err := sql.db.Insert("buff", &userInfo) + if err != nil { + return residue + } } maxSales := 100 - userInfo.SalesFish if maxSales < 0 {