The scalar field can behave like a fluid with equation of state pϕ=wρϕ, where w∈[−1,1]. In this Letter we derive a class of the scalar field potentials for which w=const. Scalar field with such a potential can mimic ordinary matter, radiation, cosmic strings, etc. We perform our calculations in the framework of the loop cosmology with holonomy corrections. We solve the model analytically for the whole parameter space. Subsequently, we perform similar consideration for the model with a phantom field (w<−1). We show that scalar field is monotonic function in both cases. This indicates that it can be treated as a well-defined internal time for these models. Moreover we perform preliminary studies of the scalar field perturbations with this potential. We indicate that non-Gaussian features are present admitting for the possible observational constraints of the model.