This commit is contained in:
邹宗楠
2021-12-30 16:04:07 +08:00
parent 84a2921cfa
commit cbf0b09d11
5 changed files with 28 additions and 20 deletions

View File

@@ -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)
}

View File

@@ -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
}

View File

@@ -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 {

View File

@@ -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
}
}

View File

@@ -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))
}