'use strict';

/**
 * 控制面板
 *
 * @author CaiAoLin
 * @date 2017/11/23
 * @version
 */

module.exports = app => {

    class DashboardController extends app.BaseController {

        /**
         * 控制面板页面
         *
         * @param {Object} ctx - egg全局变量
         * @return {void}
         */
        async index(ctx) {
            const auditTenders = await ctx.service.ledgerAudit.getAuditTender(ctx.session.sessionUser.accountId);
            const renderData = {
                auditTenders,
            };
            await this.layout('dashboard/index.ejs', renderData);
        }
    }

    return DashboardController;
};
