| 1234567891011121314151617181920212223242526272829303132333435363738 |
- package cust
- import (
- "context"
- "github.com/gogf/gf/errors/gerror"
- "github.com/gogf/gf/frame/g"
- "dashoo.cn/micro/app/dao/cust"
- model "dashoo.cn/micro/app/model/cust"
- "dashoo.cn/micro/app/service"
- )
- type customerbelongService struct {
- *service.ContextService
- Dao *cust.CustCustomerBelongDao
- }
- func NewCustomerBelongService(ctx context.Context) (svc *customerbelongService, err error) {
- svc = new(customerbelongService)
- if svc.ContextService, err = svc.Init(ctx); err != nil {
- return nil, err
- }
- svc.Dao = cust.NewCustCustomerBelongDao(svc.Tenant)
- return svc, nil
- }
- //获取客户归属信息
- func (c *customerbelongService) GetEntityById(CustId int) (Info []*model.CustomerBelongInfo, err error) {
- Model := c.Dao.M
- err = Model.Where(c.Dao.Columns.CustId, CustId).Where(c.Dao.Columns.DeletedTime + " is null ").Scan(&Info)
- if err != nil {
- g.Log().Error(err)
- err = gerror.New("获取联系人信息失败")
- return
- }
- return
- }
|