user_seller_relation.go 943 B

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