fix filtering
This commit is contained in:
@@ -11,6 +11,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
CheckupCategory_Code *string `json:"checkupCategory_code"`
|
CheckupCategory_Code *string `json:"checkupCategory_code"`
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
|
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
|
||||||
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
|
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Id *uint `json:"item_id"`
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Id *uint `json:"item_id"`
|
||||||
|
|||||||
@@ -13,6 +13,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||||
Medicine_Id *uint `json:"medicine_id"`
|
Medicine_Id *uint `json:"medicine_id"`
|
||||||
Dose *uint8 `json:"dose"`
|
Dose *uint8 `json:"dose"`
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
MedicineGroup_Code *string `json:"medicineGroup_code"`
|
MedicineGroup_Code *string `json:"medicineGroup_code"`
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
IHS_Number *string `json:"ihs_number"`
|
IHS_Number *string `json:"ihs_number"`
|
||||||
|
|
||||||
@@ -18,7 +24,6 @@ type ReadListDto struct {
|
|||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
NoPagination int `json:"no_pagination"`
|
NoPagination int `json:"no_pagination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id uint16 `json:"id"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
IHS_Number *string `json:"ihs_number"`
|
IHS_Number *string `json:"ihs_number"`
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,23 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
BirthDate *time.Time `json:"birthDate,omitempty"`
|
||||||
|
BirthRegency_Code *string `json:"birthRegency_code"`
|
||||||
|
Gender_Code *erp.GenderCode `json:"gender_code"`
|
||||||
|
ResidentIdentityNumber *string `json:"residentIdentityNumber"`
|
||||||
|
Religion_Code *erp.ReligionCode `json:"religion_code"`
|
||||||
|
Education_Code *erp.EducationCode `json:"education_code"`
|
||||||
|
Ocupation_Code *erp.OcupationCode `json:"occupation_code"`
|
||||||
|
Ocupation_Name *string `json:"occupation_name"`
|
||||||
|
Ethnic_Code *string `json:"ethnic_code"`
|
||||||
|
|
||||||
Page int `json:"page"`
|
Page int `json:"page"`
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
NoPagination int `json:"no_pagination"`
|
NoPagination int `json:"no_pagination"`
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
IHS_Number *string `json:"ihs_number"`
|
IHS_Number *string `json:"ihs_number"`
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
Doctor_Id *uint `json:"doctor_id"`
|
Doctor_Id *uint `json:"doctor_id"`
|
||||||
Unit_Code *string `json:"unit_code"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Day_Code *erc.DayCode `json:"day_code"`
|
Day_Code *erc.DayCode `json:"day_code"`
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ type CreateDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
|
FilterDto
|
||||||
|
Includes string `json:"includes"`
|
||||||
|
Preloads []string `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilterDto struct {
|
||||||
Installation_Id *uint16 `json:"installation_id"`
|
Installation_Id *uint16 `json:"installation_id"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Mc
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.McuSrc{}).
|
Model(&e.McuSrc{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Me
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.MedicalActionSrcItem{}).
|
Model(&e.MedicalActionSrcItem{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Me
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.MedicalActionSrc{}).
|
Model(&e.MedicalActionSrc{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Me
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.MedicineMixItem{}).
|
Model(&e.MedicineMixItem{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Me
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.Medicine{}).
|
Model(&e.Medicine{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Nu
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.Nurse{}).
|
Model(&e.Nurse{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Nu
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.Nutritionist{}).
|
Model(&e.Nutritionist{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Pe
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.Person{}).
|
Model(&e.Person{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Ph
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.Pharmacist{}).
|
Model(&e.Pharmacist{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Pr
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.PracticeSchedule{}).
|
Model(&e.PracticeSchedule{}).
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Includes) > 0 {
|
||||||
|
input.Preloads = pu.GetPreloads(input.Includes)
|
||||||
|
}
|
||||||
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,10 +51,16 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Un
|
|||||||
tx = dg.I
|
tx = dg.I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(input.Preloads) > 0 {
|
||||||
|
for _, preload := range input.Preloads {
|
||||||
|
tx = tx.Preload(preload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx = tx.
|
tx = tx.
|
||||||
Model(&e.Unit{}).
|
Model(&e.Unit{}).
|
||||||
Preload("Installation").
|
Preload("Installation").
|
||||||
Scopes(gh.Filter(input)).
|
Scopes(gh.Filter(input.FilterDto)).
|
||||||
Count(&count).
|
Count(&count).
|
||||||
Scopes(gh.Paginate(input, &pagination)).
|
Scopes(gh.Paginate(input, &pagination)).
|
||||||
Order("\"CreatedAt\" DESC")
|
Order("\"CreatedAt\" DESC")
|
||||||
|
|||||||
Reference in New Issue
Block a user