| | |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.Receipt.Id = params.Id |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.Receipt.Id = params.Id |
| | | |
| | | errCode := service.NewReceiptService().UpdateReceipt(¶ms.Receipt) |
| | | if errCode != ecode.OK { |
| | |
| | | return |
| | | } |
| | | |
| | | receipt, total, errCode := service.NewReceiptService().GetReceiptList() |
| | | receipt, total, errCode := service.NewReceiptService().GetReceiptList(params) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | ctx.OkWithDetailed(response.ListResponse{ |
| | | Data: receipt, |
| | | Data: receipt, |
| | | Count: total, |
| | | }) |
| | | } |