|
@@ -22,15 +22,17 @@ func GetFullProjectList(ctx context.Context, enterpriseID int64, pageSize, pageN
|
|
|
db := GetReadDB(ctx)
|
|
|
// 根据企业id过滤
|
|
|
db = db.Debug().Model(gorm_model.ProjectInfo{}).Where("enterprise_id = ?", enterpriseID)
|
|
|
+ logrus.Printf("db:%V",db)
|
|
|
// 根据Project条件过滤
|
|
|
- conditionType := reflect.TypeOf(condition)
|
|
|
- conditionValue := reflect.ValueOf(condition)
|
|
|
- for i := 0; i < conditionValue.NumField(); i++ {
|
|
|
+ conditionType := reflect.TypeOf(condition).Elem()
|
|
|
+ conditionValue := reflect.ValueOf(condition).Elem()
|
|
|
+ for i := 0; i < conditionType.NumField(); i++ {
|
|
|
field := conditionType.Field(i)
|
|
|
tag := field.Tag.Get("condition")
|
|
|
value := conditionValue.FieldByName(field.Name)
|
|
|
db = db.Where(fmt.Sprintf("%s = ?", tag), value)
|
|
|
}
|
|
|
+ logrus.Printf("db:%V",db)
|
|
|
// 查询总数
|
|
|
var total int64
|
|
|
var fullProjects []*gorm_model.ProjectInfo
|