|
|
|
@ -1,10 +1,11 @@
|
|
|
|
|
package company
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"recook/internal/v2/model/recook/manage"
|
|
|
|
|
|
|
|
|
|
"github.com/golangkit/formatime"
|
|
|
|
|
"github.com/jinzhu/gorm"
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type State uint
|
|
|
|
@ -86,7 +87,8 @@ func (o *Info) TableName() string {
|
|
|
|
|
return "jyy_company_info"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (o *Info) AfterFind(db *gorm.DB) error {
|
|
|
|
|
func (o *Info) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
fmt.Println(123)
|
|
|
|
|
o.ProcessUserName = o.ProcessUserInfo.Name
|
|
|
|
|
o.ApplyUserName = o.ApplyUserInfo.Name
|
|
|
|
|
o.StateStr = o.State.Str()
|
|
|
|
@ -98,17 +100,17 @@ type Log struct {
|
|
|
|
|
ID uint `json:"id"`
|
|
|
|
|
Text string `json:"text"`
|
|
|
|
|
UserID uint `json:"-"`
|
|
|
|
|
ManageUserInfo manage.RecookManageUserInfoModel `json:"-" gorm:"foreignKey:user_id"`
|
|
|
|
|
ManageUserInfo manage.RecookManageUserInfoModel `json:"-" gorm:"references:user_id;foreignKey:id"`
|
|
|
|
|
ManageUserName string `json:"manage_user_name" gorm:"-"`
|
|
|
|
|
CreatedAt formatime.Second `json:"created_at"`
|
|
|
|
|
CompanyID uint `json:"company_i"`
|
|
|
|
|
CompanyID uint `json:"company_id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (o Log) TableName() string {
|
|
|
|
|
return "jyy_company_log"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (o *Log) AfterFind(db *gorm.DB) error {
|
|
|
|
|
func (o *Log) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
o.ManageUserName = o.ManageUserInfo.Name
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|