var system = require("../../system")
var settings = require("../../../config/settings");
const CtlBase = require("../ctl.base");
const moment = require("moment");

class offlinecompanyCtl extends CtlBase {
    constructor() {
        super(CtlBase.getServiceName(offlinecompanyCtl));
    }

    async allList(queryobj, qobj, req) {
        try {
            var params = qobj;
            var page = await this.service.pageByCondition(params);
            console.log(page)
            return system.getResult2(page);
        } catch (e) {
            console.log(e);
            return system.getErrResult2("您的网络不稳, 请稍后重试");
        }
    }


    async getinfo(queryobj, qobj, req){
        console.log(qobj)
        let channel = await this.service.findById(qobj.id);
        return system.getResult2(channel);
    }

    async companylSave(queryobj, qobj, req){

        try {
            var rs = await this.service.updateCreate(qobj);
            return rs;
        } catch (e) {
            console.log(e);
            return system.getErrResult2("出现异常，请联系管理员");
        }

    }
}
module.exports = offlinecompanyCtl;
