enterprise/common/model/user_config.go

34 lines
1.1 KiB
Go

package model
import "encoding/json"
var (
CheckinOndutyMoneyEnable = "checkin.onduty.money.enable" //上班打卡红包
CheckinOffdutyMoneyEnable = "checkin.offduty.money.enable" //下班打卡红包
CheckinOndutyMoney = "checkin.onduty.money" //上班打卡金额
CheckinOffdutyMoney = "checkin.offduty.money" //下班打卡金额
StaffSalaryExpDiscount = "staff.salary.exp.discount" //试用期薪资折扣
StaffSalarySocialInsurence = "staff.salary.social.insurence" //社保扣除金额
StaffSalaryPerDay = "staff.salary.per.day" //按天计算的工资
StaffSalaryNotify = "staff.salary.notify" //是否发送工资单
)
var (
UserConfigStatusNormal = 1
UserConfigStatusDisable = 2
)
type UserConfig struct {
Id int64
Username string
Config string
Status int
CreateTime int64
UpdateTime int64
}
func (u *UserConfig) Get(key string) interface{} {
config := make(map[string]interface{})
json.Unmarshal([]byte(u.Config), &config)
return config[key]
}