|
|
@@ -3,7 +3,9 @@ package balance_controller
|
|
|
import (
|
|
|
"fmt"
|
|
|
"fohow.com/libs/lib_redis"
|
|
|
+ "fohow.com/libs/tool"
|
|
|
"github.com/astaxie/beego"
|
|
|
+ "strings"
|
|
|
|
|
|
// "crypto/md5"
|
|
|
// "encoding/hex"
|
|
|
@@ -139,12 +141,13 @@ func (self *BalanceController) GetCashBalanceInfo() {
|
|
|
info.Available = balance_model.GetCashTotalBalance(wxUser.Id)
|
|
|
info.Total = balance_model.GetCashEnterBalance(wxUser.Id)
|
|
|
info.CanTransfer = true
|
|
|
- specialDepart, err := beego.AppConfig.Int64("SpecialDepart")
|
|
|
- if err != nil {
|
|
|
- beego.BeeLogger.Error("%s", err)
|
|
|
- return
|
|
|
- }
|
|
|
- if wxUser.Depart == specialDepart {
|
|
|
+ specialDepartStr := beego.AppConfig.String("SpecialDepart")
|
|
|
+
|
|
|
+ specialDeparts := strings.Split(specialDepartStr, ".")
|
|
|
+ departUser := fmt.Sprintf("%d", wxUser.Depart)
|
|
|
+ contain := tool.StringsContains(specialDeparts, departUser)
|
|
|
+
|
|
|
+ if contain >= 0 {
|
|
|
info.CanTransfer = false
|
|
|
}
|
|
|
self.Data["json"] = info
|
|
|
@@ -308,13 +311,13 @@ func (self *BalanceController) TransferToBalance() {
|
|
|
self.ReturnError(403, apps.TakeCashAmountInvalid, "", nil)
|
|
|
}
|
|
|
|
|
|
- specialDepart, err := beego.AppConfig.Int64("SpecialDepart")
|
|
|
- if err != nil {
|
|
|
- beego.BeeLogger.Error("%s", err)
|
|
|
- return
|
|
|
- }
|
|
|
+ specialDepartStr := beego.AppConfig.String("SpecialDepart")
|
|
|
+ specialDeparts := strings.Split(specialDepartStr, ".")
|
|
|
+ departUser := fmt.Sprintf("%d", wxUser.Depart)
|
|
|
+ contain := tool.StringsContains(specialDeparts, departUser)
|
|
|
+
|
|
|
//三部会员禁止转提货券
|
|
|
- if wxUser.Depart == specialDepart {
|
|
|
+ if contain >= 0 {
|
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
|
}
|
|
|
|