aa
This commit is contained in:
@@ -67,9 +67,6 @@ type StoreDetail struct {
|
||||
BrandLogo string `json:"brandLogo"`
|
||||
BrandIsOpen int `json:"brandIsOpen"`
|
||||
BrandIsPrint int `json:"brandIsPrint"`
|
||||
|
||||
CoverArea float64 `json:"coverArea"`
|
||||
MarketScale int `json:"marketScale"` //市场规模
|
||||
}
|
||||
|
||||
// 带快递门店信息的
|
||||
@@ -115,7 +112,6 @@ func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID, vendorOrgCo
|
||||
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,
|
||||
t2.price_percentage, t2.auto_pickup, t2.delivery_type, t2.delivery_competition, t2.is_sync, t2.vendor_store_name, t2.is_order, t2.yb_app_id, t2.yb_app_key, t2.yb_store_prefix,
|
||||
t2.jds_street_code, t2.jds_street_name, t2.is_supply_goods, t2.vendor_pay_percentage, t2.mtwm_token, t2.ebai_supplier_id, t2.create_delivery_type,
|
||||
t2.market_scale, t2.cover_area,
|
||||
t3.value price_percentage_pack_str,
|
||||
t4.value freight_deduction_pack_str,
|
||||
province.name province_name,
|
||||
@@ -1168,3 +1164,48 @@ func GetStoreAcctExpendLastCreateWayBillFee(db *DaoDB, vendorOrderID string) (la
|
||||
err = GetRow(db, &expend, sql, sqlParams)
|
||||
return expend.ExpendPrice, err
|
||||
}
|
||||
|
||||
type GetStoreManageStateResult struct {
|
||||
StoreName string `json:"storeName"`
|
||||
VendorStoreID string `orm:"column(vendor_store_id)" json:"vendorStoreID"`
|
||||
MarketScale int `json:"marketScale"` //市场规模
|
||||
Comment string `json:"comment"`
|
||||
DefaultCoverArea float64 `json:"defaultCoverArea"`
|
||||
model.StoreManageState
|
||||
}
|
||||
|
||||
func GetStoreManageState(db *DaoDB, storeIDs []int, vendorID, sortType, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||
var requestList []*GetStoreManageStateResult
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS DISTINCT a.*, b.name store_name, c.vendor_store_id, c.market_scale, b.comment, c.cover_area default_cover_area
|
||||
FROM store_manage_state a
|
||||
LEFT JOIN store b ON b.id = a.store_id
|
||||
LEFT JOIN store_map c ON c.store_id = a.store_id AND c.vendor_id = a.vendor_id
|
||||
WHERE 1 = 1
|
||||
`
|
||||
sqlParams := []interface{}{}
|
||||
if len(storeIDs) > 0 {
|
||||
sql += " AND a.store_id IN (" + GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storeIDs)
|
||||
}
|
||||
if vendorID != -1 {
|
||||
sql += " AND a.vendor_id = ?"
|
||||
sqlParams = append(sqlParams, vendorID)
|
||||
}
|
||||
if sortType != 0 {
|
||||
sql += " ORDER BY"
|
||||
sqlParams = append(sqlParams, sortType)
|
||||
}
|
||||
sql += " LIMIT ? OFFSET ?"
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
Begin(db)
|
||||
defer Commit(db)
|
||||
if err = GetRows(db, &requestList, sql, sqlParams...); err == nil {
|
||||
return &model.PagedInfo{
|
||||
TotalCount: GetLastTotalRowCount(db),
|
||||
Data: requestList,
|
||||
}, nil
|
||||
}
|
||||
return pagedInfo, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user