This commit is contained in:
richboo111
2023-04-25 09:46:26 +08:00
parent 69040cd1cf
commit a5f750ad67
21 changed files with 1552 additions and 32 deletions

View File

@@ -2,6 +2,9 @@ package model
// VendorIDJD, VendorIDMTWM与VendorIDELM的定义和老系统是兼容的
const (
IMVendorIDMT = "10" //美团IM
IMVendorIDELM = "11" //饿了么im
VendorTypeUnknown = 0 // 未知
VendorTypePurchase = 1 // 购物平台
VendorTypeDelivery = 2 // 快递平台

View File

@@ -1646,3 +1646,17 @@ func BindJXPrintToStore(storeId int64, printSn, printKey string) error {
_, err := ExecuteSQL(GetDB(), sql, []interface{}{printSn, printKey, model.VendorIDJxprint, model.NO, storeId})
return err
}
// GetStoreBaseByVendorStoreID 根据vendorStoreID获取门店基本信息
func GetStoreBaseByVendorStoreID(vendorStoreID string, vendorID int) (storeDetail *model.Store, err error) {
if len(vendorStoreID) == 0 {
return nil, errors.New("vendorStoreID不能为空")
}
DefaultTimeValue := utils.Str2Time("1970-01-01 00:00:00")
sql := `SELECT t.* FROM store t WHERE t.id = (SELECT s.store_id FROM store_map s WHERE s.vendor_store_id= ? AND s.vendor_id= ? AND s.deleted_at= ? )`
if err := GetRow(GetDB(), &storeDetail, sql, []interface{}{vendorStoreID, vendorID, DefaultTimeValue}); err != nil {
return nil, err
}
return storeDetail, err
}