The compounds according to formula (I), their pharmaceutically acceptable acid or base addition salts, and the uses thereof. These compounds and their pharmaceutically acceptable acid or base addition salts can be used for preparing medicaments for modulating estrogen related receptors (ERR), and treating metabolic diseases, such as high blood fat, fatty liver, hyperglycemia, diabetes, obesity. The substituents of the formula are defined in the description.