const system=require("../../../system");
const Dao=require("../../dao.base");
class NewschannelDao extends Dao{
  constructor(){
    super(Dao.getModelName(NewschannelDao));
  }
  async findAgreenment(queryobj,qobj,req){
     var result =await this.model.findAll({
       where:{id:1},
       include:{
         model:this.db.models.article,
         limit:1,
         offset:0
       },
   });
     console.log("---------------------------------------------------------------zhangjiao");
     console.log(result);
     return result;
  }
  orderBy(){
    //return {"key":"include","value":{model:this.db.models.app}};
    return [["orderNo","ASC"]];
  }
  async findPrev5(queryobj,qobj){
    console.log(qobj);
    return this.model.findAll({
      where:{isPubed:1},
      include:{
        model:this.db.models.article,
        limit:5,
        offset:0
      },
      limit:6,
      offset:0,
    });
  }
}
module.exports=NewschannelDao;
