public int GetPayRequireRecordsSum(_PayType PayType, string Year, string Month) { return(GetSession().Linq <PayRequireRecords>() .Where(p => p._PayType == PayType) .Where(p => p.Year == Convert.ToInt32(Year)) .WhereIf(p => p.Month == Convert.ToInt32(Month), Month.Trim() != "全部") .Sum(p => p.PayRequireNum)); }
//取出最近4次的付款记录,因为服务费和提成是分开的,所以也就是本次和上一次的记录。 // 此处还没写完,不应取出所以的,应该取出前几条就可以了。 public List <PayRecords> GetPayRecords(string shopID, _PayType payType) { return(this.GetAll() .Where(it => it._Shop.ID == Convert.ToInt32(shopID)) .Where(it => it._PayType == payType) .OrderByDescending(it => it.UpdateTime) .Take(12) .ToList()); }