const system=require("../../system");
const Dao=require("../dao.base");
class MsgHistoryDao extends Dao{
  constructor(){
    super(Dao.getModelName(MsgHistoryDao));
  }
  extraWhere(obj,w){
     if(obj.ukstr && obj.ukstr!=""){
      //  w={[this.db.Op.or]:[
      //       {[this.db.Op.and]:[{sender:obj.ukstr},{target:obj.extra}]},
      //       {[this.db.Op.and]:[{sender:obj.extra},{target:obj.ukstr}]},
      //     ]
      //   };
       w[this.db.Op.or]=[
            {[this.db.Op.and]:[{sender:obj.ukstr},{target:obj.extra}]},
            {[this.db.Op.and]:[{sender:obj.extra},{target:obj.ukstr}]},
          ];
     }
     return w;
  }
  orderBy(){
    //return {"key":"include","value":{model:this.db.models.app}};
    return [["id","DESC"]];
  }
}
module.exports=MsgHistoryDao;
