move code of the function of export_excel from models to controllers