From 51080571c8ed6466f9fc6faeb296a8ef80cff026 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 29 Nov 2024 17:56:13 +0800 Subject: [PATCH 1/3] update --- src/model/fin_withdraw_setting.go | 38 ++++++++++++++++++------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/model/fin_withdraw_setting.go b/src/model/fin_withdraw_setting.go index f620e26..e8bb921 100644 --- a/src/model/fin_withdraw_setting.go +++ b/src/model/fin_withdraw_setting.go @@ -1,20 +1,26 @@ package model +import ( + "time" +) + type FinWithdrawSetting struct { - Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` - FrequencySet string `json:"frequency_set" xorm:"not null comment('频率设置') TEXT"` - WithdrawType int `json:"withdraw_type" xorm:"not null default 1 comment('提现方式(1:支付宝 2:微信)') TINYINT(1)"` - VipLevelLimit int `json:"vip_level_limit" xorm:"not null default 0 comment('提现等级限制') INT(11)"` - IsRealName int `json:"is_real_name" xorm:"not null default 0 comment('是否实名(0:否 1:是)') TINYINT(1)"` - WithdrawNumsLimit int `json:"withdraw_nums_limit" xorm:"not null default 0 comment('提现次数限制(对应上方设置周期,0为不限制,失败、驳回不计数 )') TINYINT(3)"` - WithdrawAmountLimit string `json:"withdraw_amount_limit" xorm:"not null comment('提现金额限制(0为不限制,大于等于该金额才可以申请提现 )') DECIMAL(10,2)"` - WithdrawMultipleLimit string `json:"withdraw_multiple_limit" xorm:"not null comment('提现倍数限制(0为不限制,金额限制倍数才可以申请提现 )') DECIMAL(10,2)"` - IsSupportDecimalPoint int `json:"is_support_decimal_point" xorm:"not null default 0 comment('是否支持小数点(0:否 1:是)') TINYINT(1)"` - IsAuto int `json:"is_auto" xorm:"not null default 0 comment('是否开启自动提现(0:否 1:是)') TINYINT(1)"` - IsAutoAmountLimit string `json:"is_auto_amount_limit" xorm:"not null default 0.00 comment('自动提现金额限制') DECIMAL(10,2)"` - WithdrawTimeInterval string `json:"withdraw_time_interval" xorm:"not null default '' comment('提现时段') VARCHAR(255)"` - WithdrawFeeSet string `json:"withdraw_fee_set" xorm:"not null comment('提现手续费设置') TEXT"` - FirstWithdrawSet string `json:"first_withdraw_set" xorm:"not null comment('首次提现设置') TEXT"` - CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('申请时间') TIMESTAMP"` - UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('处理时间') TIMESTAMP"` + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + FrequencySet string `json:"frequency_set" xorm:"not null comment('频率设置') TEXT"` + WithdrawType int `json:"withdraw_type" xorm:"not null default 1 comment('提现方式(1:支付宝 2:微信)') TINYINT(1)"` + VipLevelLimit int `json:"vip_level_limit" xorm:"not null default 0 comment('提现等级限制') INT(11)"` + IsRealName int `json:"is_real_name" xorm:"not null default 0 comment('是否实名(0:否 1:是)') TINYINT(1)"` + WithdrawNumsLimit int `json:"withdraw_nums_limit" xorm:"not null default 0 comment('提现次数限制(对应上方设置周期,0为不限制,失败、驳回不计数 )') TINYINT(3)"` + WithdrawAmountLimit string `json:"withdraw_amount_limit" xorm:"not null comment('提现金额限制(0为不限制,大于等于该金额才可以申请提现 )') DECIMAL(10,2)"` + WithdrawMultipleLimit string `json:"withdraw_multiple_limit" xorm:"not null comment('提现倍数限制(0为不限制,金额限制倍数才可以申请提现 )') DECIMAL(10,2)"` + IsSupportDecimalPoint int `json:"is_support_decimal_point" xorm:"not null default 0 comment('是否支持小数点(0:否 1:是)') TINYINT(1)"` + IsAuto int `json:"is_auto" xorm:"not null default 0 comment('是否开启自动提现(0:否 1:是)') TINYINT(1)"` + IsAutoAmountLimit string `json:"is_auto_amount_limit" xorm:"not null default 0.00 comment('自动提现金额限制') DECIMAL(10,2)"` + WithdrawTimeInterval string `json:"withdraw_time_interval" xorm:"not null default '' comment('提现时段') VARCHAR(255)"` + WithdrawFeeSet string `json:"withdraw_fee_set" xorm:"not null comment('提现手续费设置') TEXT"` + PendingOrdersIsCanApply int `json:"pending_orders_is_can_apply" xorm:"not null comment('存在待处理记录是否允许再次申请提现(0:禁止,1:允许)') TINYINT(1)"` + ConditionIsOpne int `json:"condition_is_opne" xorm:"not null comment('提现条件是否开启(0:关闭, 1:开启)') TINYINT(1)"` + FirstWithdrawSet string `json:"first_withdraw_set" xorm:"not null comment('首次提现设置') TEXT"` + CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('申请时间') TIMESTAMP"` + UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('处理时间') TIMESTAMP"` } From 0b9d7beb58cc42bf1f760c2304e76afbd2fae227 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 29 Nov 2024 17:59:02 +0800 Subject: [PATCH 2/3] update --- src/model/fin_withdraw_setting.go | 40 ++++++++++++++----------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/model/fin_withdraw_setting.go b/src/model/fin_withdraw_setting.go index e8bb921..2266bf0 100644 --- a/src/model/fin_withdraw_setting.go +++ b/src/model/fin_withdraw_setting.go @@ -1,26 +1,22 @@ package model -import ( - "time" -) - type FinWithdrawSetting struct { - Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` - FrequencySet string `json:"frequency_set" xorm:"not null comment('频率设置') TEXT"` - WithdrawType int `json:"withdraw_type" xorm:"not null default 1 comment('提现方式(1:支付宝 2:微信)') TINYINT(1)"` - VipLevelLimit int `json:"vip_level_limit" xorm:"not null default 0 comment('提现等级限制') INT(11)"` - IsRealName int `json:"is_real_name" xorm:"not null default 0 comment('是否实名(0:否 1:是)') TINYINT(1)"` - WithdrawNumsLimit int `json:"withdraw_nums_limit" xorm:"not null default 0 comment('提现次数限制(对应上方设置周期,0为不限制,失败、驳回不计数 )') TINYINT(3)"` - WithdrawAmountLimit string `json:"withdraw_amount_limit" xorm:"not null comment('提现金额限制(0为不限制,大于等于该金额才可以申请提现 )') DECIMAL(10,2)"` - WithdrawMultipleLimit string `json:"withdraw_multiple_limit" xorm:"not null comment('提现倍数限制(0为不限制,金额限制倍数才可以申请提现 )') DECIMAL(10,2)"` - IsSupportDecimalPoint int `json:"is_support_decimal_point" xorm:"not null default 0 comment('是否支持小数点(0:否 1:是)') TINYINT(1)"` - IsAuto int `json:"is_auto" xorm:"not null default 0 comment('是否开启自动提现(0:否 1:是)') TINYINT(1)"` - IsAutoAmountLimit string `json:"is_auto_amount_limit" xorm:"not null default 0.00 comment('自动提现金额限制') DECIMAL(10,2)"` - WithdrawTimeInterval string `json:"withdraw_time_interval" xorm:"not null default '' comment('提现时段') VARCHAR(255)"` - WithdrawFeeSet string `json:"withdraw_fee_set" xorm:"not null comment('提现手续费设置') TEXT"` - PendingOrdersIsCanApply int `json:"pending_orders_is_can_apply" xorm:"not null comment('存在待处理记录是否允许再次申请提现(0:禁止,1:允许)') TINYINT(1)"` - ConditionIsOpne int `json:"condition_is_opne" xorm:"not null comment('提现条件是否开启(0:关闭, 1:开启)') TINYINT(1)"` - FirstWithdrawSet string `json:"first_withdraw_set" xorm:"not null comment('首次提现设置') TEXT"` - CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('申请时间') TIMESTAMP"` - UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('处理时间') TIMESTAMP"` + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + FrequencySet string `json:"frequency_set" xorm:"not null comment('频率设置') TEXT"` + WithdrawType int `json:"withdraw_type" xorm:"not null default 1 comment('提现方式(1:支付宝 2:微信)') TINYINT(1)"` + VipLevelLimit int `json:"vip_level_limit" xorm:"not null default 0 comment('提现等级限制') INT(11)"` + IsRealName int `json:"is_real_name" xorm:"not null default 0 comment('是否实名(0:否 1:是)') TINYINT(1)"` + WithdrawNumsLimit int `json:"withdraw_nums_limit" xorm:"not null default 0 comment('提现次数限制(对应上方设置周期,0为不限制,失败、驳回不计数 )') TINYINT(3)"` + WithdrawAmountLimit string `json:"withdraw_amount_limit" xorm:"not null comment('提现金额限制(0为不限制,大于等于该金额才可以申请提现 )') DECIMAL(10,2)"` + WithdrawMultipleLimit string `json:"withdraw_multiple_limit" xorm:"not null comment('提现倍数限制(0为不限制,金额限制倍数才可以申请提现 )') DECIMAL(10,2)"` + IsSupportDecimalPoint int `json:"is_support_decimal_point" xorm:"not null default 0 comment('是否支持小数点(0:否 1:是)') TINYINT(1)"` + IsAuto int `json:"is_auto" xorm:"not null default 0 comment('是否开启自动提现(0:否 1:是)') TINYINT(1)"` + IsAutoAmountLimit string `json:"is_auto_amount_limit" xorm:"not null default 0.00 comment('自动提现金额限制') DECIMAL(10,2)"` + WithdrawTimeInterval string `json:"withdraw_time_interval" xorm:"not null default '' comment('提现时段') VARCHAR(255)"` + WithdrawFeeSet string `json:"withdraw_fee_set" xorm:"not null comment('提现手续费设置') TEXT"` + PendingOrdersIsCanApply int `json:"pending_orders_is_can_apply" xorm:"not null comment('存在待处理记录是否允许再次申请提现(0:禁止,1:允许)') TINYINT(1)"` + ConditionIsOpen int `json:"condition_is_open" xorm:"not null comment('提现条件是否开启(0:关闭, 1:开启)') TINYINT(1)"` + FirstWithdrawSet string `json:"first_withdraw_set" xorm:"not null comment('首次提现设置') TEXT"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('申请时间') TIMESTAMP"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('处理时间') TIMESTAMP"` } From 6bf3ba96c5b11959a3ac0aa42b8c2259d82c608f Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 29 Nov 2024 18:15:01 +0800 Subject: [PATCH 3/3] update --- src/dao/fin_withdraw_apply_dao.go | 1 + src/implement/fin_withdraw_apply_implement.go | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/dao/fin_withdraw_apply_dao.go b/src/dao/fin_withdraw_apply_dao.go index fa643e5..24b286f 100644 --- a/src/dao/fin_withdraw_apply_dao.go +++ b/src/dao/fin_withdraw_apply_dao.go @@ -8,4 +8,5 @@ import ( type FinWithdrawApplyDao interface { FinWithdrawApplyGetBySession(session *xorm.Session, startAt, endAt string, params map[string]interface{}) (*[]model.FinWithdrawApply, error) FinWithdrawApplyInsertOneBySession(session *xorm.Session, m *model.FinWithdrawApply) (int64, error) + FinWithdrawApplyAmountGetByParams(params map[string]interface{}) (float64, error) } diff --git a/src/implement/fin_withdraw_apply_implement.go b/src/implement/fin_withdraw_apply_implement.go index b6830d9..6e1b17a 100644 --- a/src/implement/fin_withdraw_apply_implement.go +++ b/src/implement/fin_withdraw_apply_implement.go @@ -44,3 +44,13 @@ func (f FinWithdrawApplyDb) FinWithdrawApplyGetBySession(session *xorm.Session, return m, nil } + +func (f FinWithdrawApplyDb) FinWithdrawApplyAmountGetByParams(params map[string]interface{}) (float64, error) { + var m model.FinWithdrawApply + var query = fmt.Sprintf("%s =?", params["key"]) + total, err := f.Db.Where(query, params["value"]).Sum(m, "amount") + if err != nil { + return 0, err + } + return total, nil +}