Sfoglia il codice sorgente

增加提现手续费

abiao 3 anni fa
parent
commit
2b64b0e95f

+ 20 - 1
go/gopath/src/fohow.com/apps/controllers/balance_controller/balance_controller.go

@@ -102,6 +102,25 @@ func (self *BalanceController) GetBalanceDetail() {
 	self.ServeJSON()
 }
 
+//佣金详情
+func (self *BalanceController) GetCashBalanceDetail() {
+	_id := self.Ctx.Input.Param(":id")
+	id, _ := strconv.ParseInt(_id, 10, 64)
+	//uId := self.GetCurrentUserId()
+	wxUId := self.GetCurrentWxUserIdByToken()
+	item := balance_model.GetCashBalanceById(id)
+	if item == nil {
+		self.ReturnError(403, apps.NoExist, "", nil)
+	}
+	if item.WxUId != wxUId {
+		self.ReturnError(403, apps.BalanceNotExist, "", nil)
+	}
+	item.CTime = item.CreatedAt.Unix()
+	item.SourceName = item.GetSourceName()
+	self.Data["json"] = item
+	self.ServeJSON()
+}
+
 //现金账户变动列表
 func (self *BalanceController) GetCashBalanceList() {
 	page, _ := self.GetInt64("page", 1)
@@ -241,7 +260,7 @@ func (self *BalanceController) GetTakeCashLimit() {
 	limitInfo := new(LimitInfo)
 	limitInfo.MaxLimitCash = TAKE_CASH_AMOUNT_LIMIT_MAX
 	limitInfo.MinLimitCash = TAKE_CASH_AMOUNT_LIMIT_MIN
-	limitInfo.FeeBl = int64(0)
+	limitInfo.FeeBl = sys_config.GetTakeCashTax()
 
 	if beego.AppConfig.String("RunMode") == "dev" {
 		limitInfo.MinLimitCash = 1

+ 12 - 0
go/gopath/src/fohow.com/apps/models/balance_model/cash_balance.go

@@ -400,3 +400,15 @@ func GetCashToBalanceCountByWxUId(wxUId int64, s string) int64 {
 	count, _ := o.QueryTable(item).Filter("wx_uid", wxUId).Filter("source", s).Count()
 	return count
 }
+
+func GetCashBalanceById(id int64) *CashBalance {
+	item := &CashBalance{}
+	if err := orm.NewOrm().QueryTable(item).
+		Filter("id", id).Limit(1).
+		One(item); err != nil {
+		beego.BeeLogger.Debug("GetCashBalanceById(%s), err=%s",
+			id, err)
+		return nil
+	}
+	return item
+}

+ 6 - 2
go/gopath/src/fohow.com/routers/routes.go

@@ -201,10 +201,14 @@ func init() {
 	beego.Router("/v1/user/balance/:id([0-9]+)", &balance_controller.BalanceController{}, "get:GetBalanceDetail")
 	//提货券账户余额
 	beego.Router("/v1/user/balance/info", &balance_controller.BalanceController{}, "get:GetBalanceInfo")
-	//现金账户变动列表
+
+	//佣金账户变动列表
 	beego.Router("/v1/user/cash/balances", &balance_controller.BalanceController{}, "get:GetCashBalanceList")
-	//金账户余额
+	//金账户余额
 	beego.Router("/v1/user/cash/balance/info", &balance_controller.BalanceController{}, "get:GetCashBalanceInfo")
+	//佣金账户变更详情
+	beego.Router("/v1/user/cash/balance/:id([0-9]+)", &balance_controller.BalanceController{}, "get:GetBalanceDetail")
+
 	//提现
 	beego.Router("/v1/user/takecash", &balance_controller.BalanceController{}, "post:TakeCash")
 	//提现流