/// <summary> /// 获取我关注的产品列表 /// </summary> /// <param name="userGuid">用户id</param> /// <param name="pageDto">请求参数</param> /// <returns></returns> public GetMyProductsResponseDto GetMyProductsList(string userGuid, BasePageRequestDto pageDto, string platformType = "CloudDoctor") { var sql = $@"SELECT product.product_guid AS ProductGuid, product.product_name AS ProductName, CONCAT( acce.base_path, acce.relative_path ) AS ProductPicture, product.price AS ProductPrice, product.market_price AS MarketPrice, product.product_form, collection.last_updated_date AS CollectionDate FROM t_consumer_collection AS collection LEFT JOIN t_mall_product AS product ON collection.target_guid = product.product_guid left join t_merchant as mer on product.merchant_guid=mer.merchant_guid LEFT JOIN t_utility_accessory AS acce ON acce.accessory_guid = product.picture_guid AND acce.`enable` = 1 WHERE collection.`enable` = 1 AND product.`enable` = 1 AND product.on_sale = 1 AND mer.`enable` = 1 AND collection.target_type = 'product' AND collection.user_guid = '{userGuid}' AND collection.platform_type='{platformType}' ORDER BY collection.creation_date DESC" ; return(MySqlHelper.QueryByPage <BasePageRequestDto, GetMyProductsResponseDto, GetMyProductsItemDto>(sql, pageDto)); }
/// <summary> /// 按UserId分页查询 /// </summary> /// <param name="userId"></param> /// <param name="page"></param> /// <param name="enable"></param> /// <returns></returns> public List <TopicModel> GetListByUserId(string userId, BasePageRequestDto page, bool enable = true) { const string sql = @"SELECT * FROM t_utility_topic WHERE (sponsor_guid =@userId OR receiver_guid =@userId) AND ENABLE = @enable ORDER BY creation_date desc LIMIT @pageIndex, @pageSize "; return(MySqlHelper.Select <TopicModel>(sql, new { userId, enable, pageIndex = (page.PageIndex - 1) * page.PageSize, pageSize = page.PageSize }).ToList()); }
/// <summary> /// 获取双美我收藏的产品列表 /// </summary> /// <param name="userGuid">用户id</param> /// <param name="pageDto">请求参数</param> /// <returns></returns> public async Task <GetMyProductOfCosmetologyResponseDto> GetMyProductsListOfCosmetologyAsync(string userGuid, BasePageRequestDto pageDto) { var sql = $@"SELECT product.product_guid AS ProductGuid, product.product_name AS ProductName, CONCAT( acce.base_path, acce.relative_path ) AS ProductPicture, product.price AS ProductPrice, product.market_price AS MarketPrice, collection.creation_date AS CollectionDate FROM t_consumer_collection AS collection LEFT JOIN t_mall_product AS product ON collection.target_guid = product.product_guid AND product.`enable` = 1 LEFT JOIN t_utility_accessory AS acce ON acce.accessory_guid = product.picture_guid AND acce.`enable` = 1 WHERE collection.`enable` = 1 AND collection.target_type = 'product' AND collection.user_guid = '{userGuid}' AND collection.platform_type BETWEEN 2 and 3 ORDER BY collection.creation_date DESC" ; return(await MySqlHelper.QueryByPageAsync <BasePageRequestDto, GetMyProductOfCosmetologyResponseDto, GetMyProductOfCosmetologyItemDto>(sql, pageDto)); }