You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
|
3 years ago
|
package models
|
||
|
|
|
||
|
|
import "key_performance_indicators/overall"
|
||
|
|
|
||
|
|
//系统管理员属性资料
|
||
|
|
type SystemUserAttribute struct {
|
||
|
|
IdAttr int64 `json:"id" gorm:"column:ua_id;type:bigint(50) unsigned;not null;comment:Id"`
|
||
|
|
NameAttr string `json:"name" gorm:"column:ua_name;type:varchar(20);not null;comment:姓名"`
|
||
|
|
Tel string `json:"tel" gorm:"column:ua_tel;type:varchar(30);not null;default:0;comment:电话"`
|
||
|
|
TimeAttr int64 `json:"time" gorm:"column:ua_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func (SystemUserAttribute *SystemUserAttribute) TableName() string {
|
||
|
|
return "system_user_attribute"
|
||
|
|
}
|
||
|
|
|
||
|
|
//获取详情
|
||
|
|
func (cont *SystemUserAttribute) GetCont(where interface{}, filed ...string) error {
|
||
|
|
gormDb := overall.CONSTANT_DB_Master.Where(where)
|
||
|
|
if len(filed) > 0 {
|
||
|
|
for _, v := range filed {
|
||
|
|
gormDb = gormDb.Select(v)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
err := gormDb.First(&cont).Error
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
//编辑内容
|
||
|
|
func (cont *SystemUserAttribute) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
|
||
|
|
err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error
|
||
|
|
return
|
||
|
|
}
|