The compounds according to formula (I), their pharmaceutically acceptable acid or base addition salts, and the uses thereof is disclosed. These compounds and their pharmaceutically acceptable acid or base addition salts can be used for the preparing a medicament for modulating estrogen related receptor (ERR), and treating metabolic diseases, such as high blood fat, fatty liver, hyperglycemia, diabetes, obesity, etc. The definition of the groups of the formula is defined as the description.