...
|
...
|
@@ -140,7 +140,7 @@ func NewFormulaCalculate(table *domain.Table, queryComponent *domain.QueryCompon |
|
|
}
|
|
|
if queryComponent.Formula != nil {
|
|
|
formula := queryComponent.Formula
|
|
|
res.DatabaseTableName = formula.TableFields[0].TableSqlName
|
|
|
// res.DatabaseTableName = formula.TableFields[0].TableSqlName
|
|
|
// TODO:支持常量
|
|
|
res.DatabaseTableName = ""
|
|
|
if len(formula.TableFields) > 0 {
|
...
|
...
|
@@ -158,6 +158,14 @@ func NewFormulaCalculate(table *domain.Table, queryComponent *domain.QueryCompon |
|
|
CalculateFieldName: table.DataFields[0].SQLName,
|
|
|
})
|
|
|
}
|
|
|
if len(queryComponent.Formula.TableFields) == 0 && len(queryComponent.Formula.ExprSql) > 0 {
|
|
|
res.FormulaCalculateFields = append(res.FormulaCalculateFields, &FormulaCalculateField{
|
|
|
DatabaseTableName: "",
|
|
|
FieldSchema: NewFieldSchema(domain.TableField{}),
|
|
|
CalculateExpression: exprSql,
|
|
|
CalculateFieldName: table.DataFields[0].SQLName,
|
|
|
})
|
|
|
}
|
|
|
//res.FormulaCalculateFields = append(res.FormulaCalculateFields, &FormulaCalculateField{
|
|
|
// DatabaseTableName: res.DatabaseTableName,
|
|
|
// FieldSchema: NewFieldSchemaFromField(table.DataFields[0]),
|
...
|
...
|
|