const system=require("../../../system");
const Dao=require("../../dao.base");
class PmQuestionDao extends Dao{
  constructor(){
    super(Dao.getModelName(PmQuestionDao));
  }
  extraModelFilter(){
    return {
      "key":"include","value":[
        {model:this.db.models.user,as:"subber"},
        {model:this.db.models.user,as:"exector"},
        {model:this.db.models.pmproject,as:"pmproject"},
      ]
    };
  }
    extraWhere(obj,w,qc,linkAttrs){
      if(obj.codepath && obj.codepath!=""){
        if(obj.codepath.split("/").indexOf("mysubs")>0){//说明是应用管理员的查询
          console.log(obj);
          w["subber_id"]=obj.uid;
        }
        if(obj.codepath.split("/").indexOf("myquestions")>0){//说明是应用管理员的查询
          console.log(obj);
          w["exector_id"]=obj.uid;
        }
      }
  }
}
module.exports=PmQuestionDao;
