storedetail
This commit is contained in:
@@ -95,7 +95,7 @@ func (s *StoreDetail) GetPricePerentage(price int) (pricePercentage int) {
|
||||
return pricePercentage
|
||||
}
|
||||
|
||||
func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID string) (storeDetail *StoreDetail, err error) {
|
||||
func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID, vendorOrgCode string) (storeDetail *StoreDetail, err error) {
|
||||
sql := `
|
||||
SELECT t1.*,
|
||||
t2.vendor_store_id, t2.status vendor_status, t2.delivery_fee_deduction_sill, t2.delivery_fee_deduction_fee, t2.sync_status, t2.vendor_org_code,
|
||||
@@ -145,6 +145,13 @@ func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID string) (sto
|
||||
sql += " AND t2.vendor_store_id = ?"
|
||||
sqlParams = append(sqlParams, vendorStoreID)
|
||||
}
|
||||
if vendorOrgCode != "" {
|
||||
sql += " AND t2.vendor_org_code = ?"
|
||||
sqlParams = append(sqlParams, vendorOrgCode)
|
||||
}
|
||||
if vendorID == model.VendorIDJDShop && vendorOrgCode == "" {
|
||||
sql += " AND t2.vendor_org_code = 1"
|
||||
}
|
||||
if err = GetRow(db, &storeDetail, sql, sqlParams...); err == nil {
|
||||
storeDetail.PricePercentagePackObj = PricePercentagePack2Obj(storeDetail.PricePercentagePackStr)
|
||||
storeDetail.FreightDeductionPackObj = FreightDeductionPack2Obj(storeDetail.FreightDeductionPackStr)
|
||||
@@ -163,15 +170,15 @@ func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID string) (sto
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func GetStoreDetail(db *DaoDB, storeID, vendorID int) (storeDetail *StoreDetail, err error) {
|
||||
return getStoreDetail(db, storeID, vendorID, "")
|
||||
func GetStoreDetail(db *DaoDB, storeID, vendorID int, vendorOrgCode string) (storeDetail *StoreDetail, err error) {
|
||||
return getStoreDetail(db, storeID, vendorID, "", vendorOrgCode)
|
||||
}
|
||||
|
||||
func GetStoreDetailByVendorStoreID(db *DaoDB, vendorStoreID string, vendorID int) (storeDetail *StoreDetail, err error) {
|
||||
func GetStoreDetailByVendorStoreID(db *DaoDB, vendorStoreID string, vendorID int, vendorOrgCode string) (storeDetail *StoreDetail, err error) {
|
||||
if vendorID != model.VendorIDJX {
|
||||
return getStoreDetail(db, 0, vendorID, vendorStoreID)
|
||||
return getStoreDetail(db, 0, vendorID, vendorStoreID, vendorOrgCode)
|
||||
}
|
||||
if storeDetail, err = getStoreDetail(db, int(utils.Str2Int64WithDefault(vendorStoreID, 0)), vendorID, ""); err == nil {
|
||||
if storeDetail, err = getStoreDetail(db, int(utils.Str2Int64WithDefault(vendorStoreID, 0)), vendorID, "", vendorOrgCode); err == nil {
|
||||
storeDetail.VendorStoreID = vendorStoreID
|
||||
}
|
||||
return storeDetail, err
|
||||
|
||||
Reference in New Issue
Block a user