user_seller_relation.go 970 B

12345678910111213141516171819202122232425262728
  1. package models
  2. import (
  3. "eta/eta_api/global"
  4. "eta/eta_api/utils"
  5. "time"
  6. )
  7. type UserSellerRelation struct {
  8. RelationId int64 `gorm:"column:relation_id;primaryKey;autoIncrement"`
  9. UserId int `description:"用户id"`
  10. CompanyId int `description:"企业用户id"`
  11. SellerId int `description:"销售id"`
  12. Seller string `description:"销售员名称"`
  13. ProductId int `description:"产品id"`
  14. Mobile string `description:"手机号"`
  15. Email string `description:"邮箱"`
  16. ModifyTime time.Time `description:"修改时间"`
  17. CreateTime time.Time `description:"创建时间"`
  18. }
  19. // DeleteUserSellerRelationByProductId 根据产品id删除销售员与员工的关系
  20. func DeleteUserSellerRelationByProductId(userId, productId int) (err error) {
  21. o := global.DbMap[utils.DbNameWeekly]
  22. sql := ` DELETE FROM user_seller_relation WHERE user_id=? and product_id = ?`
  23. err = o.Exec(sql, userId, productId).Error
  24. return
  25. }