aa
This commit is contained in:
@@ -234,3 +234,28 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, maxRadius
|
||||
func GetVendorOrgCode(ctx *jxcontext.Context, vendorID int, vendorOrgCode, vendorType string) (vendorOrgs []*model.VendorOrgCode, err error) {
|
||||
return dao.GetVendorOrgCode(dao.GetDB(), vendorID, vendorOrgCode, vendorType)
|
||||
}
|
||||
|
||||
func UpdateVendorOrgCode(ctx *jxcontext.Context, ID int, payload map[string]interface{}) (err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
vendorOrgCode = &model.VendorOrgCode{}
|
||||
)
|
||||
vendorOrgCode.ID = ID
|
||||
err = dao.GetEntity(db, vendorOrgCode)
|
||||
valid := dao.StrictMakeMapByStructObject(payload, vendorOrgCode, ctx.GetUserName())
|
||||
if len(valid) > 0 {
|
||||
dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
dao.Rollback(db)
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
if _, err = dao.UpdateEntityLogically(db, vendorOrgCode, valid, ctx.GetUserName(), nil); err != nil {
|
||||
dao.Rollback(db)
|
||||
return err
|
||||
}
|
||||
dao.Commit(db)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user