const system = require("../../system");
const ServiceBase = require("../sve.base");
const moment = require("moment");
class EcompanyeventService extends ServiceBase {
   constructor() {
      super(ServiceBase.getDaoName(EcompanyeventService));
   }

   async getList(params, currentPage, pageSize) {
      var where = {};

      if(params.ecompany_id) {
         where.ecompany_id = params.ecompany_id;
      }

      if(params.statusFlag) {
         where.status = params.statusFlag == '1' ? 1 : 0;
      }
      // whereObj.nickName = {[this.db.Op.like]: "%" + nickName + "%" };

      var attributesObj=["id", "ecompany_id", "user_id", "type", "biz_id", "content", "status", "created_at"];
      var result = await super.getPageList(Number(currentPage),Number(pageSize), where, [["id", 'DESC']], attributesObj);
      return result;
   }
}
module.exports = EcompanyeventService;