SQL账表实现超始日期为最近7天

 


 

 

 

    [HotUpdate]
    /// <sumnary>/// 关联方往来对账表过源框插件
    ///</summary>
    [Description("客户对账表过滤框插件")]
    public class InnerCheckFilter : AbstractCommonFilterPlugIn
    {
        public override void BeforeBindData(EventArgs e)
        {
            base.BeforeBindData(e);
            SQLReportFilterModel sqlModel = this.Model as SQLReportFilterModel;
                if (sqlModel==null)
                {
                    return;
                }
            var sqlfilterFlds = sqlModel.SQLFilterObject.FilterFieldList.FirstOrDefault(x=>x.KeyWord== "@sdate@");
            if (sqlfilterFlds!=null)
            {
                sqlfilterFlds.DefaultValue= DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
            }



           
        } 
    }

 

posted @ 2023-07-31 19:53  superstar  阅读(16)  评论(0编辑  收藏  举报