package models import ( "eta/eta_api/global" "eta/eta_api/utils" "time" ) type UserSellerRelation struct { RelationId int64 `gorm:"column:relation_id;primaryKey;autoIncrement"` UserId int `description:"用户id"` CompanyId int `description:"企业用户id"` SellerId int `description:"销售id"` Seller string `description:"销售员名称"` ProductId int `description:"产品id"` Mobile string `description:"手机号"` Email string `description:"邮箱"` ModifyTime time.Time `description:"修改时间"` CreateTime time.Time `description:"创建时间"` } // DeleteUserSellerRelationByProductId 根据产品id删除销售员与员工的关系 func DeleteUserSellerRelationByProductId(userId, productId int) (err error) { o := global.DbMap[utils.DbNameWeekly] sql := ` DELETE FROM user_seller_relation WHERE user_id=? and product_id = ?` err = o.Exec(sql, userId, productId).Error return }