|
|
@@ -56,10 +56,10 @@ import (
|
|
|
// 校验当前用户是否登录
|
|
|
func (self *UserController) CheckLogin() {
|
|
|
type UserInfo struct {
|
|
|
- UserId int64 `json:"user_id"`
|
|
|
- WxUserId int64 `json:"wx_user_id"`
|
|
|
- MerchantId int64 `json:"merchant_id"`
|
|
|
- IsSuperAdmin bool `json:"is_super_admin"` //商家中的超级管理员
|
|
|
+ UserId int64 `json:"user_id"`
|
|
|
+ WxUserId int64 `json:"wx_user_id"`
|
|
|
+ MerchantId int64 `json:"merchant_id"`
|
|
|
+ Rank int64 `json:"rank"` //级别
|
|
|
}
|
|
|
userInfo := new(UserInfo)
|
|
|
useCache, err := self.GetBool("cache", true)
|
|
|
@@ -83,9 +83,8 @@ func (self *UserController) CheckLogin() {
|
|
|
merchantUser := merchant_model.GetMerchantUserRelationByUserId(merchant_user_id, false) //一个商户对应多个用户
|
|
|
if merchantUser != nil {
|
|
|
userInfo.MerchantId = merchantUser.MerchantId
|
|
|
- userInfo.IsSuperAdmin = merchantUser.IsSuperAdmin
|
|
|
}
|
|
|
-
|
|
|
+ userInfo.Rank = wxUser.Rank
|
|
|
self.Data["json"] = userInfo
|
|
|
self.ServeJSON()
|
|
|
}
|
|
|
@@ -392,7 +391,6 @@ func (self *UserController) ShopApplication() {
|
|
|
district := self.GetString("district")
|
|
|
remark := self.GetString("remark")
|
|
|
name := self.GetString("name")
|
|
|
- total, _ := self.GetInt64("total")
|
|
|
|
|
|
if len(mobile) != 11 {
|
|
|
self.ReturnError(404, apps.ParamsError, "", nil)
|
|
|
@@ -412,6 +410,10 @@ func (self *UserController) ShopApplication() {
|
|
|
if wxUser.Rank > user_model.WX_USER_RANK_ONE {
|
|
|
self.ReturnError(403, apps.AlreadyShop, "", nil)
|
|
|
}
|
|
|
+ total := int64(16800)
|
|
|
+ if wxUser.Rank == user_model.WX_USER_RANK_ONE {
|
|
|
+ total = int64(13800)
|
|
|
+ }
|
|
|
k := fmt.Sprintf("%s%s", sms_model.SHOP_APPLICATION, mobile)
|
|
|
if cacheCode, ok := cache.Cache.Get(k).(string); ok {
|
|
|
if code != cacheCode {
|