- GetStoreDetail返回CityName

This commit is contained in:
gazebo
2019-06-28 09:05:20 +08:00
parent fc3bbcecbc
commit 3e69149124
3 changed files with 12 additions and 3 deletions

View File

@@ -1286,13 +1286,14 @@ func SendAlarmVendorSnapshot(ctx *jxcontext.Context, parentTask tasksch.ITask, p
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
mobile := batchItemList[0].(string)
var dataList []map[string]interface{}
captionList := []string{"京西门店ID", "门店名"}
captionList := []string{"京西门店ID", "门店名", "城市"}
isFirstRow := true
for storeID := range userMap[mobile] {
prevSnapshotMap := alarmMap[storeID]
data := map[string]interface{}{
"京西门店ID": storeID,
"门店名": storeDetailMap[storeID].Store.Name,
"城市": storeDetailMap[storeID].CityName,
}
for _, vendorID := range []int{model.VendorIDJD, model.VendorIDEBAI, model.VendorIDMTWM} {
if isFirstRow {

View File

@@ -15,6 +15,9 @@ func SendUserMessage(userID, title, content string) (err error) {
authList, err := auth2.GetUserBindAuthInfo(userID)
findOneMethod := false
if err == nil {
if title != "" {
content = title + "\n" + content
}
for _, auth := range authList {
if auth.Type == dingding.AuthTypeStaff {
findOneMethod = true

View File

@@ -23,6 +23,8 @@ type StoreDetail struct {
model.Place // district info
DistrictName string `json:"-"`
CityName string
}
type StoreDetail2 struct {
@@ -38,10 +40,13 @@ func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID string) (sto
SELECT t1.*,
t2.vendor_store_id, t2.status vendor_status, t2.delivery_fee, t2.sync_status,
t2.price_percentage, t2.auto_pickup, t2.delivery_type, t2.delivery_competition, t2.is_sync,
district.code, district.name district_name, district.parent_code, district.level, district.tel_code, district.jd_code, district.ebai_code, district.enabled, district.mtps_price
district.code, district.name district_name, district.parent_code, district.level, district.tel_code,
district.jd_code, district.ebai_code, district.enabled, district.mtps_price,
city.name city_name
FROM store t1
JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? AND t2.deleted_at = ?
LEFT JOIN place district ON t1.district_code = district.code
LEFT JOIN place city ON city.code = t1.city_code
LEFT JOIN place district ON district.code = t1.district_code
WHERE t1.deleted_at = ?
`
sqlParams := []interface{}{