im
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user