diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 6269034f9..8586fc310 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -5472,6 +5472,3 @@ func UpdateStoreTemplate(ctx *jxcontext.Context, storeID int, content, sound str _, err = dao.UpdateEntity(db, store, "PrinterTemplate", "PrinterSound") return err } -func GetStoreBrandID(ctx *jxcontext.Context, storeID int) (brandID int, err error) { - return dao.GetStoreBrandID(dao.GetDB(), storeID) -} diff --git a/business/model/dao/store.go b/business/model/dao/store.go index 4d38ba836..27119cd39 100644 --- a/business/model/dao/store.go +++ b/business/model/dao/store.go @@ -68,9 +68,6 @@ type StoreDetail struct { BrandIsOpen int `json:"brandIsOpen"` BrandIsPrint int `json:"brandIsPrint"` } -type BrandID struct { - BrandID int `orm:"column(brand_id)" json:"brandID"` -} // 带快递门店信息的 type StoreDetail2 struct { @@ -1489,13 +1486,3 @@ func InsertBrandCategories(db *DaoDB, userName string, brandID int) (err error) _, err = ExecuteSQL(db, sql, sqlParams) return err } -func GetStoreBrandID(db *DaoDB, storeID int) (brandID int, err error) { - sql := ` - SELECT * - FROM store - WHERE store_id = ? - ` - sqlparams := []interface{}{utils.DefaultTimeValue, storeID} - err = GetRows(db, &brandID, sql, sqlparams) - return brandID, err -} diff --git a/business/model/store.go b/business/model/store.go index 2cce628d6..19e42c211 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -815,7 +815,6 @@ func (*StoreAudit) TableIndex() [][]string { type Brand struct { ModelIDCULD - ID int `json:"Brand_id"` Name string `orm:"size(255)" json:"name"` //品牌名 Logo string `orm:"size(255)" json:"logo"` //品牌logo BrandType int `json:"brandType"` //品牌类型 @@ -916,7 +915,6 @@ type StoreAcct struct { StoreID int `orm:"column(store_id)" json:"storeID"` //门店ID AccountBalance int `json:"accountBalance"` //账户余额 - BrandID int `orm:"column(brand_id)" json:"brandID"` } func (v *StoreAcct) TableUnique() [][]string { diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index f936251df..b7811d2e5 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -584,8 +584,7 @@ func OnPayFinished(orderPay *model.OrderPay) (err error) { storeOrder.OrderFinishedAt = time.Now() storeOrder.Status = model.OrderStatusFinished if _, err = dao.UpdateEntity(dao.GetDB(), storeOrder, "OrderFinishedAt", "Status"); err == nil { - brandID, _ := dao.GetStoreBrandID(dao.GetDB(), storeOrder.StoreID) - partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, brandID, storeOrder.ActualPayPrice, 1, 1, "") + partner.CurStoreAcctManager.InsertStoreAcctIncomeAndUpdateStoreAcctBalance(nil, storeOrder.StoreID, storeOrder.ActualPayPrice, partner.StoreAcctTypeIncomePay, orderPay.VendorOrderID, 0) } } case model.PayTypeTL_BrandBillCharge: @@ -603,6 +602,7 @@ func OnPayFinished(orderPay *model.OrderPay) (err error) { priceDefendOrders, _ := dao.GetPriceDefendOrder(dao.GetDB(), orderPay.VendorOrderID, nil, nil, []int{jxutils.GetDefendPriceIssue()}, 0, -1, -1, 0, "", utils.ZeroTimeValue, utils.ZeroTimeValue, false) if len(priceDefendOrders) > 0 { priceDefendOrders[0].IsPay = model.YES + dao.UpdateEntity(dao.GetDB(), priceDefendOrders[0], "IsPay") err = nil } } diff --git a/business/partner/purchase/jx/localjx/order_test.go b/business/partner/purchase/jx/localjx/order_test.go new file mode 100644 index 000000000..6965e1146 --- /dev/null +++ b/business/partner/purchase/jx/localjx/order_test.go @@ -0,0 +1,26 @@ +package localjx + +import ( + "testing" + + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/globals/testinit" +) + +func init() { + testinit.Init() +} + +func TestGenOrderNo(t *testing.T) { + orderNo := GenOrderNo(jxcontext.AdminCtx) + t.Log(orderNo) +} + +func TestGetAvailableDeliverTime(t *testing.T) { + timeInfo, err := GetAvailableDeliverTime(jxcontext.AdminCtx, 100118) + if err != nil { + t.Fatal(err) + } + t.Log(utils.Format4Output(timeInfo, false)) +}