1
This commit is contained in:
@@ -1566,16 +1566,17 @@ func GetStoreBrandInfos(storeID int) (date *BrandInfos, err error) {
|
|||||||
|
|
||||||
// 查询FreightTemplate
|
// 查询FreightTemplate
|
||||||
func QueryStoreBindInfo(storeID int) (*model.FreightTemplate, error) {
|
func QueryStoreBindInfo(storeID int) (*model.FreightTemplate, error) {
|
||||||
|
if storeID == model.NO {
|
||||||
|
return nil, errors.New("storeId 不能为0")
|
||||||
|
}
|
||||||
var (
|
var (
|
||||||
sqlParams []interface{}
|
sqlParams []interface{}
|
||||||
bindInfo *model.FreightTemplate
|
bindInfo *model.FreightTemplate
|
||||||
)
|
)
|
||||||
sql := "SELECT a.store_id,a.vendor_store_id,a.template_id,a.warehouse_id,a.fence_id,a.trade_limit_id FROM freight_template a "
|
sql := "SELECT a.store_id,a.vendor_store_id,a.template_id,a.warehouse_id,a.fence_id,a.trade_limit_id FROM freight_template a "
|
||||||
if storeID != 0 {
|
sql += "WHERE a.store_id = ? "
|
||||||
sql += "WHERE a.store_id = ? "
|
sqlParams = append(sqlParams, storeID)
|
||||||
sqlParams = append(sqlParams, storeID)
|
if err := GetRow(GetDB(), &bindInfo, sql, sqlParams...); err != nil {
|
||||||
}
|
|
||||||
if err := GetRow(GetDB(), &bindInfo, sql, sqlParams); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return bindInfo, nil
|
return bindInfo, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user