aa
This commit is contained in:
@@ -1214,6 +1214,37 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
|
||||
return 0, err
|
||||
}
|
||||
|
||||
func CreateStoreByUser(ctx *jxcontext.Context, mobile string) (id int, err error) {
|
||||
store := &model.Store{}
|
||||
db := dao.GetDB()
|
||||
store.Lng = jxutils.StandardCoordinate2Int(104.3975)
|
||||
store.Lat = jxutils.StandardCoordinate2Int(30.504679)
|
||||
store.Address = "成都市简阳市简阳市"
|
||||
store.Name = "无名称" + utils.Int64ToStr(time.Now().Unix())
|
||||
store.DeliveryRangeType = model.DeliveryRangeTypeRadius
|
||||
store.DeliveryRange = "3000"
|
||||
store.PayPercentage = 100
|
||||
store.Status = model.StoreStatusClosed
|
||||
store.OpenTime1 = 700
|
||||
store.CloseTime1 = 1900
|
||||
store.Tel1 = mobile
|
||||
store.CityCode = 510100
|
||||
store.DistrictCode = 510185
|
||||
store.BrandID = 1
|
||||
if store.StoreLevel == "" {
|
||||
store.StoreLevel = "C"
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(store, ctx.GetUserName())
|
||||
if err = dao.CreateEntity(db, store); err == nil {
|
||||
if globals.IsAddEvent {
|
||||
err = AddEventDetail(db, ctx, model.OperateAdd, store.ID, model.ThingTypeStore, store.ID, "", "")
|
||||
}
|
||||
TryAddStoreBossRole4StoreByMobile(ctx, store.ID, []string{mobile})
|
||||
return store.ID, err
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
|
||||
func GetStoreVendorMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, vendorID int) (storeMaps []*model.StoreMap, err error) {
|
||||
cond := map[string]interface{}{
|
||||
model.FieldStoreID: storeID,
|
||||
|
||||
Reference in New Issue
Block a user