| | |
| | | using SqlSugar; |
| | | using CoreCms.Net.Web.Admin.Infrastructure; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using NPOI.SS.Formula.PTG; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Services; |
| | | |
| | | namespace CoreCms.Net.Web.Admin.Controllers |
| | | { |
| | |
| | | { |
| | | private readonly IWebHostEnvironment _webHostEnvironment; |
| | | private readonly ICoreCmsbaifenProductsServices _CoreCmsProductsServices; |
| | | private readonly IBfbfComAPIService _fbfComAPIService; |
| | | private readonly ICoreCmsGoodsCategoryServices _coreCmsGoodsCategoryServices; |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | | ///</summary> |
| | | public CoreCmsbaifenProductsController(IWebHostEnvironment webHostEnvironment |
| | | ,ICoreCmsbaifenProductsServices CoreCmsProductsServices |
| | | ) |
| | | , IBfbfComAPIService bfbfComAPIService |
| | | , |
| | | ICoreCmsGoodsCategoryServices coreCmsGoodsCategoryServices) |
| | | { |
| | | _webHostEnvironment = webHostEnvironment; |
| | | _CoreCmsProductsServices = CoreCmsProductsServices; |
| | | _fbfComAPIService = bfbfComAPIService; |
| | | _coreCmsGoodsCategoryServices= |
| | | _coreCmsGoodsCategoryServices = coreCmsGoodsCategoryServices; |
| | | } |
| | | |
| | | #region 获取列表============================================================ |
| | | // POST: Api/CoreCmsProducts/GetPageList |
| | | /// <summary> |
| | | /// <summary> |
| | | /// 获取列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | where = where.And(p => p.price == price); |
| | | } |
| | | //商品分类 decimal |
| | | var Category = Request.Form["category"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(Category)) |
| | | var Category = Request.Form["categoryId"].FirstOrDefault().ToInt32OrDefault(); |
| | | if (Category>0) |
| | | { |
| | | where = where.And(p => p.Category.Contains(Category)); |
| | | where = where.And(p => p.CategoryID== Category); |
| | | } |
| | | //货品成本价 decimal |
| | | var costprice = Request.Form["costprice"].FirstOrDefault().ObjectToDecimal(0); |
| | |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("首页数据")] |
| | | public AdminUiCallBack GetIndex() |
| | | public async Task< AdminUiCallBack> GetIndex() |
| | | { |
| | | //返回数据 |
| | | var jm = new AdminUiCallBack { code = 0 }; |
| | | |
| | | var categories = await _coreCmsGoodsCategoryServices.QueryListByClauseAsync(p => p.isShow, p => p.sort, OrderByType.Asc, true, true); |
| | | jm.data = GoodsHelper.GetTree(categories, false); |
| | | return jm; |
| | | } |
| | | #endregion |