|
@@ -125,7 +125,8 @@ func GetSelectionByEnterpiseIdAndProductId(ctx context.Context, enterpriseId str
|
|
|
|
|
|
func GetSelectionList(ctx context.Context, enterpriseID string, pageSize, pageNum int64, conditions *common_model.SelectionConditions) ([]*gorm_model.YounggeeSelectionInfo, int64, error) {
|
|
|
db := GetReadDB(ctx)
|
|
|
- db = db.Debug().Model(gorm_model.YounggeeSelectionInfo{}).Where("enterprise_id = ?", enterpriseID)
|
|
|
+ //db = db.Debug().Model(gorm_model.YounggeeSelectionInfo{}).Where("enterprise_id = ?", enterpriseID)
|
|
|
+ db = db.Debug().Model(gorm_model.YounggeeSelectionInfo{})
|
|
|
conditionType := reflect.TypeOf(conditions).Elem()
|
|
|
conditionValue := reflect.ValueOf(conditions).Elem()
|
|
|
selectionStatus := ""
|
|
@@ -135,7 +136,11 @@ func GetSelectionList(ctx context.Context, enterpriseID string, pageSize, pageNu
|
|
|
tag := field.Tag.Get("condition")
|
|
|
value := conditionValue.FieldByName(field.Name)
|
|
|
if tag == "selection_status" {
|
|
|
- selectionStatus = fmt.Sprintf("%v", value.Interface())
|
|
|
+ selectionStatus = fmt.Sprintf("%v", conv.MustInt(value.Interface(), 0))
|
|
|
+ if selectionStatus != "0" {
|
|
|
+ db = db.Where("selection_status = ?", selectionStatus)
|
|
|
+ }
|
|
|
+
|
|
|
} else if tag == "search_value" {
|
|
|
searchValue = fmt.Sprintf("%v", value.Interface())
|
|
|
} else if tag == "submit_at" && value.Interface() != "" {
|