Browse Source

fix:bug

token_replace
黄梓健 4 years ago
parent
commit
faa8bdf698
  1. 14
      controllers/client/good.go
  2. 3
      main.go
  3. 2
      models/area_store.go
  4. 4
      utils/define/config.go

14
controllers/client/good.go

@ -46,15 +46,25 @@ func (t *GoodCtl) ListGood() {
activityId := t.MustGetInt("activity_id")
areaId := t.MustGetInt("area_id")
area := &models.AreaStore{}
exist, err := models.Get(area, areaId)
t.CheckErr(err)
t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "地区不存在")
if area.IsMainArea != 1 && area.AreaGoodsRuleSwitch == 1 {
exist, err = area.GetMainAreaById(activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "地区不存在")
}
option := new(models.CustomerOrderOption)
exist, err := option.GetByActivityId(activityId)
exist, err = option.GetByActivityId(activityId)
t.CheckErr(err)
if !exist {
t.JSON([]interface{}{})
return
}
goods, err := models.GetGoodsByActivityId(activityId, areaId)
goods, err := models.GetGoodsByActivityId(activityId, area.Id)
t.CheckErr(err)
for index := range goods {

3
main.go

@ -6,11 +6,12 @@ import (
"hudongzhuanjia/controllers/client"
"hudongzhuanjia/controllers/common"
"hudongzhuanjia/controllers/pc"
"hudongzhuanjia/utils/define"
//_ "net/http/pprof"
)
func main() {
//define.SetDebug(true)
define.SetDebug(true)
// pc
core.GetInstanceRouterManage().Registered(new(pc.WsCtl)) // 用户

2
models/area_store.go

@ -17,7 +17,7 @@ type AreaStore struct {
Address string `json:"address" xorm:"not null default('') comment('地址') VARCHAR(255)"`
ActivityId int `json:"activity_id" xorm:"not null comment('主活动id') BIGINT(20)"`
CustomerId int `json:"customer_id" xorm:"not null default 0 comment('客户id') INT(11)"`
IsMainArea bool `json:"is_main_area" xorm:"not null default(0) comment('是否主地区1是') TINYINT(1)"`
IsMainArea int `json:"is_main_area" xorm:"not null default(0) comment('是否主地区1是') TINYINT(1)"`
AreaServicePhone string `json:"area_service_phone" xorm:"not null default '' comment('地区客服电话') VARCHAR(128)"`
AdminName string `json:"admin_name" xorm:"not null default '' comment('地区管理员名称') VARCHAR(128)"`
Phone string `json:"phone" xorm:"not null default '' comment('地区管理员账号即手机号') VARCHAR(128)"`

4
utils/define/config.go

@ -10,10 +10,10 @@ func SetDebug(modes ...bool) {
}
if IsDebugging {
//RoomPrefix = "test_"
HOST = "https://hdzj.utools.club"
HOST = "https://ouxuanhudong.utools.club"
H5Host = "http://ouxuanhudongtest.t.3pr.com.cn/web"
SendUrl = "https://wsouxuanhudong.utools.club/PcClient/Ws/MessageCtl/Receive"
CallbackOrderUrl = "https://hdzj.utools.club/PcClient/common/WeChatOauthCtl/callbackOrder"
CallbackOrderUrl = "https://ouxuanhudong.utools.club/PcClient/common/WeChatOauthCtl/callbackOrder"
}
}

Loading…
Cancel
Save