You cannot 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.3 KiB
Go

package model
import (
"gorm.io/plugin/soft_delete"
"time"
)
type FinancialFormSetting struct {
ID uint64 `gorm:"primaryKey;column:id" json:"id"` // ID
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at" json:"deletedAt"` // 删除时间
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"` // 创建时间
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
SettingType string `json:"settingType" gorm:"column:setting_type;type:varchar(255);comment:财务付款单设置,paymentCompany|transactionDepartment|payment"`
Name string `json:"name" gorm:"column:name;type:varchar(1024)"`
}
// TableName get sql table name.获取数据库表名
func (m *FinancialFormSetting) TableName() string {
return "financial_form_setting"
}
//func GetName(in *approval.GetNameRequest) (*approval.GetNameResponse, error) {
// settings := make([]*FinancialFormSetting, 0)
// err := DB.Model(&FinancialFormSetting{}).Where("settingType = ?", in.SettingType).Find(&settings).Error
// if err != nil {
// return nil, err
// }
// response := new(approval.GetNameResponse)
// for i := 0; i < len(settings); i++ {
// response.Name = append(response.Name, settings[i].Name)
// }
// return response, nil
//}