linkStoreCount

This commit is contained in:
gazebo
2020-02-05 10:57:08 +08:00
parent b8cd1b9e3f
commit bd863c2bf1
2 changed files with 15 additions and 13 deletions

View File

@@ -59,13 +59,14 @@ type StoreExt struct {
FloatLng float64 `json:"lng"`
FloatLat float64 `json:"lat"`
ProvinceCode int `json:"provinceCode"`
ProvinceName string `json:"provinceName"`
CityName string `json:"cityName"`
DistrictName string `json:"districtName"`
StoreMapStr string `json:"-"`
CourierMapStr string `json:"-"`
PayeeBankName string `json:"payeeBankName"` // 开户行名称
ProvinceCode int `json:"provinceCode"`
ProvinceName string `json:"provinceName"`
CityName string `json:"cityName"`
DistrictName string `json:"districtName"`
StoreMapStr string `json:"-"`
CourierMapStr string `json:"-"`
PayeeBankName string `json:"payeeBankName"` // 开户行名称
LinkStoreCount int `json:"linkStoreCount"`
// StoreMaps []map[string]interface{} `orm:"-"`
// CourierMaps []map[string]interface{} `orm:"-"`
StoreMaps []*model.StoreMap `json:"StoreMaps"`
@@ -452,7 +453,8 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
province.code province_code,
province.name province_name,
city.name city_name,
district.name district_name
district.name district_name,
(SELECT COUNT(*) FROM store t11 WHERE t11.link_store_id = t1.id) link_store_count
` + sql + `
ORDER BY t1.id DESC
`

View File

@@ -272,11 +272,11 @@ type Store struct {
DeliveryRangeType int8 `json:"deliveryRangeType"` // 参见相关常量定义
DeliveryRange string `orm:"type(text)" json:"deliveryRange"` // 如果DeliveryRangeType为DeliveryRangeTypePolygon则为逗号分隔坐标分号分隔的坐标点坐标与Lng和Lat一样都是整数比如 121361504,31189308;121420555,31150238。否则为半径单位为米
Status int `json:"status"`
AutoEnableAt *time.Time `orm:"type(datetime);null" json:"autoEnableAt"` // 自动营业时间(临时休息用)
ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核
SMSNotify int8 `orm:"column(sms_notify);" json:"smsNotify"` // 是否通过短信接收订单消息
AutoReplyType int8 `json:"autoReplyType"` // 订单评价自动回复类型
LinkStoreID int `orm:"column(link_store_id);default(0)" json:"linkStoreID"` // 关联门店ID
AutoEnableAt *time.Time `orm:"type(datetime);null" json:"autoEnableAt"` // 自动营业时间(临时休息用)
ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核
SMSNotify int8 `orm:"column(sms_notify);" json:"smsNotify"` // 是否通过短信接收订单消息
AutoReplyType int8 `json:"autoReplyType"` // 订单评价自动回复类型
LinkStoreID int `orm:"column(link_store_id);default(0);index" json:"linkStoreID"` // 关联门店ID
PrinterDisabled int8 `orm:"default(0)" json:"printerDisabled"` // 是否禁用网络打印机
PrinterFontSize int8 `orm:"default(0)" json:"printerFontSize"` // 打印字体-10正常1