Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
a04a38fb
Commit
a04a38fb
authored
Aug 12, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
8a298d62
253f1731
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
495 additions
and
208 deletions
+495
-208
RB_Groupbuy_Activity_Specificationprice.cs
...Entity/Product/RB_Groupbuy_Activity_Specificationprice.cs
+9
-0
RB_Groupbuy_Activity_Step_Price.cs
Mall.Model/Entity/Product/RB_Groupbuy_Activity_Step_Price.cs
+50
-0
RB_Groupbuy_Activity_Step_Extend.cs
....Model/Extend/Product/RB_Groupbuy_Activity_Step_Extend.cs
+11
-3
RB_Groupbuy_Activity_Step_Price_Extend.cs
.../Extend/Product/RB_Groupbuy_Activity_Step_Price_Extend.cs
+20
-0
GroupBuyActivityModule.cs
Mall.Module.Product/GroupBuyActivityModule.cs
+170
-73
SmallShopsModule.cs
Mall.Module.User/SmallShopsModule.cs
+3
-3
RB_Groupbuy_ActivityRepository.cs
Mall.Repository/Product/RB_Groupbuy_ActivityRepository.cs
+23
-124
RB_Groupbuy_Activity_SpecificationRepository.cs
...y/Product/RB_Groupbuy_Activity_SpecificationRepository.cs
+131
-0
RB_Groupbuy_Activity_Step_PriceRepository.cs
...tory/Product/RB_Groupbuy_Activity_Step_PriceRepository.cs
+47
-0
RB_SmallShops_PriceRepository.cs
Mall.Repository/User/RB_SmallShops_PriceRepository.cs
+2
-2
GroupBuyController.cs
Mall.WebApi/Controllers/Product/GroupBuyController.cs
+29
-3
No files found.
Mall.Model/Entity/Product/RB_Groupbuy_Activity_Specificationprice.cs
View file @
a04a38fb
...
...
@@ -139,5 +139,14 @@ namespace Mall.Model.Entity.Product
set
;
}
/// <summary>
/// 规格Id
/// </summary>
public
int
SpecificationId
{
get
;
set
;
}
/// <summary>
/// 规格值Id
/// </summary>
public
int
SpecificationValueId
{
get
;
set
;
}
}
}
Mall.Model/Entity/Product/RB_Groupbuy_Activity_Step_Price.cs
0 → 100644
View file @
a04a38fb
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.Product
{
/// <summary>
/// 拼团价格实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Groupbuy_Activity_Step_Price
{
/// <summary>
/// 主键编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 阶梯编号
/// </summary>
public
int
StepId
{
get
;
set
;
}
/// <summary>
/// 商品编号
/// </summary>
public
int
GoodId
{
get
;
set
;
}
/// <summary>
/// 商户编号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序编号
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 拼团价格
/// </summary>
public
decimal
PinTuanPrice
{
get
;
set
;
}
/// <summary>
/// 拼团库存
/// </summary>
public
int
PinTuanStock
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Groupbuy_Activity_Step_Extend.cs
View file @
a04a38fb
using
System
;
using
Mall.Model.Extend.Product
;
using
System
;
using
System.Collections.Generic
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.Product
{
/// <summary>
...
...
@@ -8,11 +11,16 @@ namespace Mall.Model.Entity.Product
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Groupbuy_Activity_Step_Extend
:
RB_Groupbuy_Activity_Step
public
class
RB_Groupbuy_Activity_Step_Extend
:
RB_Groupbuy_Activity_Step
{
/// <summary>
/// 商品编号
/// </summary>
public
string
GoodIds
{
get
;
set
;
}
public
string
GoodIds
{
get
;
set
;
}
/// <summary>
/// 阶梯价格列表
/// </summary>
public
List
<
RB_Groupbuy_Activity_Step_Price_Extend
>
StepPriceList
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Groupbuy_Activity_Step_Price_Extend.cs
0 → 100644
View file @
a04a38fb
using
Mall.Model.Entity.Product
;
using
System
;
using
VT.FW.DB
;
namespace
Mall.Model.Extend.Product
{
/// <summary>
/// 拼团价格扩展实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Groupbuy_Activity_Step_Price_Extend
:
RB_Groupbuy_Activity_Step_Price
{
/// <summary>
/// 商品编号
/// </summary>
public
string
GoodsIds
{
get
;
set
;
}
}
}
Mall.Module.Product/GroupBuy
Config
ActivityModule.cs
→
Mall.Module.Product/GroupBuyActivityModule.cs
View file @
a04a38fb
This diff is collapsed.
Click to expand it.
Mall.Module.User/SmallShopsModule.cs
View file @
a04a38fb
...
...
@@ -248,9 +248,9 @@ namespace Mall.Module.User
{
//查询出所有商品id
string
goodsIds
=
string
.
Join
(
","
,
goodsList
.
Select
(
x
=>
x
.
GoodsId
??
0
).
Distinct
());
var
glist
=
goodsRepository
.
GetSingleListForGoodsId
(
new
RB_Goods_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
glist
)
{
var
glist
=
goodsRepository
.
GetSingleList
(
new
RB_Goods_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
glist
)
{
item
.
CoverImage
=
""
;
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
...
...
Mall.Repository/Product/RB_Groupbuy_ActivityRepository.cs
View file @
a04a38fb
...
...
@@ -30,6 +30,14 @@ WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
MallBaseId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
MallBaseId
),
query
.
MallBaseId
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
TenantId
),
query
.
TenantId
);
}
//时间范围
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QStartDate
)
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
QEndDate
))
{
...
...
@@ -67,131 +75,22 @@ SELECT *
FROM RB_Groupbuy_Activity
WHERE 1=1
"
);
return
Get
<
RB_Groupbuy_Activity_Extend
>(
builder
.
ToString
()).
FirstOrDefault
();
}
}
/// <summary>
/// 拼团商品关联规格价格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationPriceRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specificationprice
>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specificationprice_Extend
>
GetGroupbuyActivitySpecificationpriceListRepository
(
RB_Groupbuy_Activity_Specificationprice_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specificationprice where
{
where
}
order by Id desc"
;
return
Get
<
RB_Groupbuy_Activity_Specificationprice_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 拼团活动商品关联规格值仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationValueRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specificationvalue
>
{
/// <summary>
/// 获取拼团活动商品关联规格值列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>
GetGroupbuyActivitySpecificationValueListRepository
(
RB_Groupbuy_Activity_Specificationvalue_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
SpecificationId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
SpecificationId
)}
=
{
dmodel
.
SpecificationId
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specificationvalue where
{
where
}
order by Id asc"
;
return
Get
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 拼团商品关联规格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specification
>
{
/// <summary>
/// 获取拼团商品关联规格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specification_Extend
>
GetGroupbuyActivitySpecificationListRepository
(
RB_Groupbuy_Activity_Specification_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
if
(
query
!=
null
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
if
(
query
.
MallBaseId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
MallBaseId
),
query
.
MallBaseId
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
TenantId
),
query
.
TenantId
);
}
if
(
query
.
ActivityId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
ActivityId
),
query
.
ActivityId
);
}
}
string
sql
=
$@"select * from rb_groupbuy_activity_specification where
{
where
}
order by Id asc"
;
return
Get
<
RB_Groupbuy_Activity_Specification_Extend
>(
sql
).
ToList
();
return
Get
<
RB_Groupbuy_Activity_Extend
>(
builder
.
ToString
()).
FirstOrDefault
();
}
}
}
}
\ No newline at end of file
Mall.Repository/Product/RB_Groupbuy_Activity_SpecificationRepository.cs
0 → 100644
View file @
a04a38fb
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 拼团商品关联规格价格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationPriceRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specificationprice
>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specificationprice_Extend
>
GetGroupbuyActivitySpecificationpriceListRepository
(
RB_Groupbuy_Activity_Specificationprice_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specificationprice where
{
where
}
order by Id desc"
;
return
Get
<
RB_Groupbuy_Activity_Specificationprice_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 拼团活动商品关联规格值仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationValueRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specificationvalue
>
{
/// <summary>
/// 获取拼团活动商品关联规格值列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>
GetGroupbuyActivitySpecificationValueListRepository
(
RB_Groupbuy_Activity_Specificationvalue_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
SpecificationId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
SpecificationId
)}
=
{
dmodel
.
SpecificationId
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specificationvalue where
{
where
}
order by Id asc"
;
return
Get
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 拼团商品关联规格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specification
>
{
/// <summary>
/// 获取拼团商品关联规格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specification_Extend
>
GetGroupbuyActivitySpecificationListRepository
(
RB_Groupbuy_Activity_Specification_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specification where
{
where
}
order by Id asc"
;
return
Get
<
RB_Groupbuy_Activity_Specification_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/Product/RB_Groupbuy_Activity_Step_PriceRepository.cs
0 → 100644
View file @
a04a38fb
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 拼团活动商品阶梯价格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_Step_PriceRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Step_Price
>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Step_Price_Extend
>
GetGroupbuyActivitySpecificationpriceListRepository
(
RB_Groupbuy_Activity_Step_Price_Extend
dmodel
)
{
string
where
=
$" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
GoodId
)}
=
{
dmodel
.
GoodId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
GoodId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from RB_Groupbuy_Activity_Step_Price where
{
where
}
order by Id desc"
;
return
Get
<
RB_Groupbuy_Activity_Step_Price_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/User/RB_SmallShops_PriceRepository.cs
View file @
a04a38fb
...
...
@@ -41,7 +41,7 @@ namespace Mall.Repository.User
}
string
sql
=
$@"select di.* from RB_SmallShops_Price
_Extend
di
string
sql
=
$@"select di.* from RB_SmallShops_Price di
where
{
where
}
order by di.Id desc"
;
return
Get
<
RB_SmallShops_Price_Extend
>(
sql
).
ToList
();
}
...
...
@@ -77,7 +77,7 @@ where {where} order by di.Id desc";
string
sql
=
$@"
SELECT sp.GoodsId FROM rb_smallshops_price sp
INNER JOIN rb_goods g on sp.GoodsId=g.Id
{
where
}
where
{
where
}
GROUP BY sp.GoodsId ORDER BY sp.CreateDate DESC
"
;
return
GetPage
<
RB_SmallShops_Price_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
...
...
Mall.WebApi/Controllers/Product/GroupBuyController.cs
View file @
a04a38fb
...
...
@@ -4,6 +4,7 @@ using System.Linq;
using
System.Threading.Tasks
;
using
Mall.AOP
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Model.Extend.Product
;
using
Mall.Model.Extend.User
;
using
Mall.Module.Product
;
...
...
@@ -12,6 +13,7 @@ using Mall.WebApi.Filter;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json.Linq
;
namespace
Mall.WebApi.Controllers.Product
{
...
...
@@ -24,14 +26,14 @@ namespace Mall.WebApi.Controllers.Product
/// <summary>
/// 拼团配置处理类对象
/// </summary>
private
readonly
GroupBuyConfigModule
groupBuyConfigModule
=
new
GroupBuyConfigModule
();
private
readonly
Module
.
User
.
GroupBuyConfigModule
groupBuyConfigModule
=
new
Module
.
User
.
GroupBuyConfigModule
();
/// <summary>
/// 拼团活动
/// </summary>
private
readonly
GroupBuyConfigActivityModule
groupBuyConfigActivityModule
=
AOPHelper
.
CreateAOPObject
<
GroupBuyConfig
ActivityModule
>();
private
readonly
Module
.
Product
.
GroupBuyActivityModule
groupBuyConfigActivityModule
=
AOPHelper
.
CreateAOPObject
<
Module
.
Product
.
GroupBuy
ActivityModule
>();
#
region
拼团配置设置
/// <summary>
...
...
@@ -115,7 +117,7 @@ namespace Mall.WebApi.Controllers.Product
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Groupbuy_Activity_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
var
extModel
=
groupBuyConfigActivityModule
.
GetGroupbuyActivityEntityModule
(
query
);
var
extModel
=
groupBuyConfigActivityModule
.
GetGroupbuyActivityEntityModule
(
query
,
isGetSpec
:
true
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
...
...
@@ -135,5 +137,29 @@ namespace Mall.WebApi.Controllers.Product
bool
flag
=
groupBuyConfigActivityModule
.
SetGroupbuyActivityModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 删除规格
/// </summary>
/// <returns></returns>
public
ApiResult
DeleteSpec
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
);
bool
flag
=
groupBuyConfigActivityModule
.
RemoveGroupBuySpecificationModule
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 删除规格值
/// </summary>
/// <returns></returns>
public
ApiResult
DeleteSpecValue
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
);
bool
flag
=
groupBuyConfigActivityModule
.
RemoveGroupBuySpecificationValueModule
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment