/// <summary> /// 查询某个人发布的(在售、下架)某台太车辆之前的车辆 /// </summary> /// <param name="openId"></param> /// <param name="carSell"></param> /// <param name="pageParam"></param> /// <param name="indexCarId"></param> /// <returns></returns> public List <ResCarConciseInfo> GetBeforeUserCars(string openId, CarSell carSell, PageParam pageParam, string indexCarId) { using (var dbs = WxDbFactory.GetDbContext("hch_dbs").MyDB) { var q = dbs.From <CarsConcise>().Join <CarsConcise, CarsDetails>((cc, cd) => cc.CarsDetailsId == cd.Id).Where(x => x.State == ValidityState.Enabled && x.CarSell == carSell && x.AccountId == openId).Select <CarsConcise, CarsDetails>((cc, cd) => new { cc.Id, CarInfoId = cc.Id, cc.CarsDetailsId, cc.Name, cc.GuidePrice, cc.SellingPrice, cc.SurfaceImage, cc.CarActivity, cc.UpdateTime, cd.CarLicenseTime, cd.Mileage }); var ret = dbs.Select <ResCarConciseInfo>(q).Where(x => x.Id.CompareTo(indexCarId) < 0).OrderByDescending(x => x.UpdateTime).Take(pageParam.PageSize).ToList(); return(ret); } }
public CarsConcise(string AccountId = null, string CarsDetailsId = null, string CorporationId = null, string Name = null, string BrandId = null, string SeriesId = null, Decimal GuidePrice = 0, Decimal SellingPrice = 0, Decimal BasePrice = 0, ValidityState State = ValidityState.Disabled, string SurfaceImage = null, CarSell CarSell = CarSell.Sale, CarActivity CarActivity = CarActivity.None) { this.AccountId = AccountId; this.CarsDetailsId = CarsDetailsId; this.CorporationId = CorporationId; this.CarSell = CarSell; this.BrandId = BrandId; this.SeriesId = SeriesId; this.CarActivity = CarActivity; this.Name = Name; this.GuidePrice = GuidePrice; this.SellingPrice = SellingPrice; this.BasePrice = BasePrice; this.State = State; this.SurfaceImage = SurfaceImage; this.UpdateTime = DateTime.Now; }
public ReqCar(string OpenId = null, string CorporationId = null, string CarId = null, CarSell CarSell = CarSell.Sale, CarBrandType BrandType = CarBrandType.None, string IndexCarId = null, string BrandId = null, string SeriesId = null, CarSeriesGrade SeriesGrade = CarSeriesGrade.None, CarBrandCountry BrandCountry = CarBrandCountry.None, CarActivity CarActivity = CarActivity.None, int CarAgeBegin = 0, int CarAgeEnd = 0, int MileageBegin = 0, int MileageEnd = 15, CarDrive CarDrive = CarDrive.None, CarEnergy CarEnergy = CarEnergy.None, CarGearbox CarGearbox = CarGearbox.None, CarSeat CarSeat = CarSeat.None) { this.OpenId = OpenId; this.CorporationId = CorporationId; this.CarId = CarId; this.CarSell = CarSell; this.BrandType = BrandType; this.IndexCarId = IndexCarId; this.BrandId = BrandId; this.SeriesId = SeriesId; this.SeriesGrade = SeriesGrade; this.BrandCountry = BrandCountry; this.CarActivity = CarActivity; this.CarAgeBegin = CarAgeBegin; this.CarAgeEnd = CarAgeEnd; this.MileageBegin = MileageBegin; this.MileageEnd = MileageEnd; this.CarDrive = CarDrive; this.CarEnergy = CarEnergy; this.CarGearbox = CarGearbox; this.CarSeat = CarSeat; }