I quote from Huang's Introduction to Statistical Mechanics (not the book Statistical Mechanics), page 266
Consider, for simplicity, a one-component order parameter, a scalar field $\phi(x)$ over a space of any number of dimensions. The state of the system is specified by $\phi(x)$, and the statistical ensemble describing the thermal properties of the system is a set of such fields, with assigned statistical weights given by the Boltzmann factor $$e^{-\beta E[\phi]}$$ where $\beta=(k_BT)^{-1}$. The functional $E[\phi]$, called the Landau free energy specifies the system.
Then in order to calculate the partition function $Q$ he used (in Eq. (19.4)) the following functional integral $$Q=\int D\phi e^{-\beta E[\phi]}\tag{1}$$ which appears to be the generalization of the canonical partition function formula $$Z=\sum\limits_{\rm{states}~ j} e^{-\beta E_j}\tag{2}$$ in the limit when $j$ becomes a continuous label. Therefore, as far as I can understand, $E[\phi]$ is essentially same as the energy levels of the system $E_j$. However, according to Huang's description, $E[\phi],$ is called Landau free energy.
$\bullet$ But the energy levels $E_j$ in expression (2) is independent of temperature and is determined from the classical or quantum dynamics of the system. All temperature dependencies in $Z$ enter through the factor $\beta$.
$\bullet$ However, the Landau free energy $E[\phi]$ is postulated to be of the form $$ E[\phi]=\int d^dx\Big[\frac{\epsilon^2}{2}|\nabla\phi(x)|^2+W(\phi(x))-h(x)\phi(x)\Big]$$ where $$W(\phi(x))=g_2\phi^2(x)+g_3\phi^3(x)+g_4\phi^4(x)+...$$ where the coupling constants $g_n$ are the phenomenological parameter of the theory, and may depend on the temperature. Therefore, $E[\phi]$ can be temperature-dependent.
Questions
A. Does it not mean that Landau free energy is different from the energy levels of the systems?
B. If yes, how can we use the formula (1) by generalizing (2)?
C. There is another possibility that $E[\phi]$ is defined after some coarse-graining and therefore, has temperature dependence built into it apart from $\beta$. If that is the case, (1) is not a straightforward generalization of (2). Please enlighten me.