| | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (ReceiptService) GetReceiptList() ([]*model.Receipt, int64, int) { |
| | | list, total, err := model.NewReceiptSearch().Find() |
| | | func (ReceiptService) GetReceiptList(params request.GetReceiptList) ([]*model.Receipt, int64, int) { |
| | | list, total, err := model.NewReceiptSearch(). |
| | | SetPage(params.Page, params.PageSize). |
| | | SetSourceType(params.SourceType). |
| | | SetSourceId(params.SourceId). |
| | | SetClientId(params.ClientId). |
| | | SetPrincipalIds(params.PrincipleIds). |
| | | Find() |
| | | if err != nil { |
| | | return nil, 0, ecode.DBErr |
| | | } |
| | |
| | | } |
| | | } |
| | | err = model.WithTransaction(func(db *gorm.DB) error { |
| | | err = model.NewReceiptSearch().SetId(receipt.Id).Save(receipt) |
| | | err = model.NewReceiptSearch().SetId(receipt.Id).Update(receipt) |
| | | if err != nil { |
| | | return err |
| | | } |