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
ec1c1032
Commit
ec1c1032
authored
Aug 26, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
09eff672
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
142 additions
and
83 deletions
+142
-83
RB_Distributor_Info_Extend.cs
Mall.Model/Extend/User/RB_Distributor_Info_Extend.cs
+4
-0
RB_Member_User_Extend.cs
Mall.Model/Extend/User/RB_Member_User_Extend.cs
+4
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+68
-60
UserModule.cs
Mall.Module.User/UserModule.cs
+10
-1
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+21
-14
RB_Member_UserRepository.cs
Mall.Repository/User/RB_Member_UserRepository.cs
+32
-7
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+3
-1
No files found.
Mall.Model/Extend/User/RB_Distributor_Info_Extend.cs
View file @
ec1c1032
...
...
@@ -101,5 +101,9 @@ namespace Mall.Model.Extend.User
/// </summary>
public
int
IsSelectOverTime
{
get
;
set
;
}
/// <summary>
/// 小程序排序
/// </summary>
public
int
SortNum
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Member_User_Extend.cs
View file @
ec1c1032
...
...
@@ -120,6 +120,10 @@ namespace Mall.Model.Extend.User
#
endregion
/// <summary>
/// 小程序排序
/// </summary>
public
int
SortNum
{
get
;
set
;
}
}
...
...
Mall.Module.Product/ProductModule.cs
View file @
ec1c1032
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
Mall.AOP.CustomerAttribute
;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
...
...
@@ -341,8 +342,10 @@ namespace Mall.Module.Product
}
}
}
else
{
if
(
demodel
.
SmallShopsId
>
0
)
{
else
{
if
(
demodel
.
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
...
...
@@ -741,7 +744,8 @@ namespace Mall.Module.Product
}
}
}
else
{
else
{
if
(
demodel
.
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
...
...
@@ -1347,10 +1351,11 @@ namespace Mall.Module.Product
model
.
MallName
=
programRepository
.
GetEntity
(
model
.
MallBaseId
)?.
MallName
??
""
;
RB_Member_User_Extend
userModel
=
new
RB_Member_User_Extend
();
if
(
UserId
>
0
)
if
(
UserId
>
0
)
{
userModel
=
GetMemberUserInfo
(
UserId
);
if
(
SmallShopsId
==
0
)
{
if
(
SmallShopsId
==
0
)
{
SmallShopsId
=
userModel
.
SmallShopId
;
}
}
...
...
@@ -1515,7 +1520,8 @@ namespace Mall.Module.Product
}
#
region
微店处理会员价格
if
(
model
.
MemberPriceList
.
Any
()
&&
SmallShopsId
>
0
)
{
if
(
model
.
MemberPriceList
.
Any
()
&&
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
UpPrice
>
0
).
Any
())
{
foreach
(
var
item
in
model
.
MemberPriceList
)
...
...
@@ -1789,10 +1795,12 @@ namespace Mall.Module.Product
}
}
}
else
{
else
{
//是否展示分享vip佣金
var
fxcommissionList
=
distributor_FXCommissionRepository
.
GetFXCommissionList
(
new
RB_Distributor_FXCommission_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
FXGradeId
=
disModel
.
FXGradeId
??
0
});
if
(
fxcommissionList
.
Any
())
{
if
(
fxcommissionList
.
Any
())
{
model
.
MaxShare
=
fxcommissionList
.
Max
(
x
=>
x
.
CommissionPrice
??
0
);
}
}
...
...
@@ -2390,7 +2398,7 @@ namespace Mall.Module.Product
fullMoneyPinkage
=
model
.
FreeShippingModel
.
FullMoneyPinkage
??
0
,
fullNumPinkage
=
model
.
FreeShippingModel
.
FullNumPinkage
??
0
,
freeShippingUrl
=
model
.
FreeShippingModel
.
FreeShippingUrl
,
marketingLogo
=
model
.
MarketingLogo
,
marketingLogo
=
model
.
MarketingLogo
,
cats
=
model
.
CategoryList
.
Select
(
x
=>
new
{
x
.
CategoryId
,
...
...
@@ -3789,7 +3797,7 @@ namespace Mall.Module.Product
/// <param name="demodel"></param>
/// <param name="IsGetSpec">是否获取规格</param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetProductGoodsPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
,
int
IsGetSpec
=
0
)
public
List
<
RB_Goods_Extend
>
GetProductGoodsPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
,
int
IsGetSpec
=
0
)
{
var
list
=
goodsRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
...
...
@@ -3806,9 +3814,9 @@ namespace Mall.Module.Product
List
<
RB_Goods_SpecificationPrice_Extend
>
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
IsGetSpec
==
1
)
{
SpecificationList
=
goods_SpecificationRepository
.
GetList
(
new
RB_Goods_Specification_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
SpecificationList
=
goods_SpecificationRepository
.
GetList
(
new
RB_Goods_Specification_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
svlist
=
goods_SpecificationValueRepository
.
GetList
(
new
RB_Goods_SpecificationValue_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
SpecificationPriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
SpecificationPriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
}
foreach
(
var
item
in
list
)
...
...
@@ -3836,9 +3844,9 @@ namespace Mall.Module.Product
}
item
.
GoodsBuyNum
=
olist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
;
if
(
IsGetSpec
==
1
)
if
(
IsGetSpec
==
1
)
{
item
.
SpecificationList
=
SpecificationList
?.
Where
(
qitem
=>
qitem
.
GoodsId
==
item
.
Id
)?.
ToList
()
??
new
List
<
RB_Goods_Specification_Extend
>();
item
.
SpecificationList
=
SpecificationList
?.
Where
(
qitem
=>
qitem
.
GoodsId
==
item
.
Id
)?.
ToList
()
??
new
List
<
RB_Goods_Specification_Extend
>();
if
(
item
.
SpecificationList
!=
null
&&
item
.
SpecificationList
.
Count
>
0
)
{
foreach
(
var
subItem
in
item
.
SpecificationList
)
...
...
@@ -4196,9 +4204,9 @@ namespace Mall.Module.Product
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
bool
SetProductGoodsInfo
(
RB_Goods_Extend
demodel
)
[
TransactionCallHandler
]
public
virtual
bool
SetProductGoodsInfo
(
RB_Goods_Extend
demodel
)
{
//bool IsSyncProxy = false;
var
goodsModel
=
new
RB_Goods
();
if
(
demodel
.
Id
>
0
)
{
...
...
@@ -4229,8 +4237,6 @@ namespace Mall.Module.Product
}
}
}
var
trans
=
goodsRepository
.
DbTransaction
;
try
{
if
(
demodel
.
Id
>
0
)
...
...
@@ -4348,7 +4354,7 @@ namespace Mall.Module.Product
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
goodsRepository
.
Update
(
keyValues
,
wheres
,
trans
);
bool
flag
=
goodsRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
#
region
修改分类
...
...
@@ -4367,11 +4373,11 @@ namespace Mall.Module.Product
MallBaseId
=
demodel
.
MallBaseId
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
}
,
trans
);
});
}
foreach
(
var
item
in
deleteList
)
{
goods_CategoryRepository
.
Delete
(
item
.
Id
,
trans
);
goods_CategoryRepository
.
Delete
(
item
.
Id
);
}
#
endregion
#
region
修改规格
...
...
@@ -4385,9 +4391,9 @@ namespace Mall.Module.Product
var
svlist
=
goods_SpecificationValueRepository
.
GetList
(
new
RB_Goods_SpecificationValue_Extend
()
{
GoodsId
=
demodel
.
Id
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
splist
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsId
=
demodel
.
Id
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
//删除后新增
goods_SpecificationRepository
.
DeleteBatch
(
slist
,
trans
);
goods_SpecificationValueRepository
.
DeleteBatch
(
svlist
,
trans
);
goods_SpecificationPriceRepository
.
DeleteBatch
(
splist
,
trans
);
goods_SpecificationRepository
.
DeleteBatch
(
slist
);
goods_SpecificationValueRepository
.
DeleteBatch
(
svlist
);
goods_SpecificationPriceRepository
.
DeleteBatch
(
splist
);
foreach
(
var
item
in
demodel
.
SpecificationList
)
{
int
sid
=
goods_SpecificationRepository
.
Insert
(
new
RB_Goods_Specification
()
...
...
@@ -4401,7 +4407,7 @@ namespace Mall.Module.Product
Sort
=
item
.
Sort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
}
,
trans
);
});
if
(
sid
>
0
)
{
foreach
(
var
qitem
in
item
.
SpecificationValueList
)
...
...
@@ -4418,7 +4424,7 @@ namespace Mall.Module.Product
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
SpecificationId
=
sid
}
,
trans
);
});
}
}
}
...
...
@@ -4440,7 +4446,7 @@ namespace Mall.Module.Product
UpdateDate
=
demodel
.
UpdateDate
,
Commission
=
item
.
Commission
,
CostMoney
=
item
.
CostMoney
}
,
trans
);
});
}
}
else
...
...
@@ -4463,13 +4469,13 @@ namespace Mall.Module.Product
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag1
=
goods_SpecificationRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
bool
flag1
=
goods_SpecificationRepository
.
Update
(
keyValues1
,
wheres1
);
if
(
flag1
)
{
var
sv2list
=
svlist
.
Where
(
x
=>
x
.
SpecificationId
==
item
.
Id
).
ToList
();
if
(
sv2list
.
Count
()
!=
supmodel
.
SpecificationValueList
.
Count
()
||
sv2list
.
Count
()
!=
supmodel
.
SpecificationValueList
.
Where
(
x
=>
x
.
Id
>
0
).
Count
())
{
goods_SpecificationValueRepository
.
DeleteBatch
(
sv2list
,
trans
);
goods_SpecificationValueRepository
.
DeleteBatch
(
sv2list
);
foreach
(
var
qitem
in
supmodel
.
SpecificationValueList
)
{
goods_SpecificationValueRepository
.
Insert
(
new
RB_Goods_SpecificationValue
()
...
...
@@ -4484,7 +4490,7 @@ namespace Mall.Module.Product
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
SpecificationId
=
item
.
Id
}
,
trans
);
});
}
}
else
...
...
@@ -4504,7 +4510,7 @@ namespace Mall.Module.Product
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_SpecificationValueRepository
.
Update
(
keyValues2
,
wheres2
,
trans
);
goods_SpecificationValueRepository
.
Update
(
keyValues2
,
wheres2
);
}
}
}
...
...
@@ -4512,7 +4518,7 @@ namespace Mall.Module.Product
//价格新增/更新
if
(
splist
.
Count
()
!=
demodel
.
SpecificationPriceList
.
Count
()
||
splist
.
Count
()
!=
demodel
.
SpecificationPriceList
.
Where
(
x
=>
splist
.
Select
(
y
=>
y
.
SpecificationSort
).
Contains
(
x
.
SpecificationSort
)).
Count
())
{
goods_SpecificationPriceRepository
.
DeleteBatch
(
splist
,
trans
);
goods_SpecificationPriceRepository
.
DeleteBatch
(
splist
);
foreach
(
var
item
in
demodel
.
SpecificationPriceList
)
{
goods_SpecificationPriceRepository
.
Insert
(
new
RB_Goods_SpecificationPrice
()
...
...
@@ -4531,7 +4537,7 @@ namespace Mall.Module.Product
UpdateDate
=
demodel
.
UpdateDate
,
Commission
=
item
.
Commission
,
CostMoney
=
item
.
CostMoney
}
,
trans
);
});
}
}
else
...
...
@@ -4556,7 +4562,7 @@ namespace Mall.Module.Product
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_SpecificationPriceRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
goods_SpecificationPriceRepository
.
Update
(
keyValues1
,
wheres1
);
}
}
}
...
...
@@ -4569,7 +4575,7 @@ namespace Mall.Module.Product
//价格新增/更新
if
(
splist
.
Count
()
!=
demodel
.
SpecificationPriceList
.
Count
()
||
splist
.
Count
()
!=
demodel
.
SpecificationPriceList
.
Where
(
x
=>
splist
.
Select
(
y
=>
y
.
SpecificationSort
).
Contains
(
x
.
SpecificationSort
)).
Count
())
{
goods_SpecificationPriceRepository
.
DeleteBatch
(
splist
,
trans
);
goods_SpecificationPriceRepository
.
DeleteBatch
(
splist
);
foreach
(
var
item
in
demodel
.
SpecificationPriceList
)
{
goods_SpecificationPriceRepository
.
Insert
(
new
RB_Goods_SpecificationPrice
()
...
...
@@ -4588,7 +4594,7 @@ namespace Mall.Module.Product
UpdateDate
=
demodel
.
UpdateDate
,
Commission
=
item
.
Commission
,
CostMoney
=
item
.
CostMoney
}
,
trans
);
});
}
}
else
...
...
@@ -4613,7 +4619,7 @@ namespace Mall.Module.Product
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_SpecificationPriceRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
goods_SpecificationPriceRepository
.
Update
(
keyValues1
,
wheres1
);
}
}
}
...
...
@@ -4636,11 +4642,11 @@ namespace Mall.Module.Product
MallBaseId
=
demodel
.
MallBaseId
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
}
,
trans
);
});
}
foreach
(
var
item
in
deleteList1
)
{
goods_AreaRepository
.
Delete
(
item
.
Id
,
trans
);
goods_AreaRepository
.
Delete
(
item
.
Id
);
}
...
...
@@ -4656,7 +4662,7 @@ namespace Mall.Module.Product
||
dclist
.
Select
(
x
=>
x
.
DistributorGrade
).
Distinct
().
Count
()
!=
demodel
.
DistributionCommissionList
.
Select
(
x
=>
x
.
DistributorGrade
).
Distinct
().
Count
()
||
dclist
.
Select
(
x
=>
x
.
DistributorGrade
).
Distinct
().
Count
()
!=
dclist
.
Select
(
x
=>
x
.
DistributorGrade
).
Distinct
().
Where
(
x
=>
demodel
.
DistributionCommissionList
.
Select
(
y
=>
y
.
DistributorGrade
).
Distinct
().
Contains
(
x
)).
Count
())
{
goods_DistributionCommissionRepository
.
DeleteBatch
(
dclist
,
trans
);
goods_DistributionCommissionRepository
.
DeleteBatch
(
dclist
);
foreach
(
var
item
in
demodel
.
DistributionCommissionList
)
{
goods_DistributionCommissionRepository
.
Insert
(
new
RB_Goods_DistributionCommission
()
...
...
@@ -4673,7 +4679,7 @@ namespace Mall.Module.Product
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
UpdateDate
=
demodel
.
UpdateDate
}
,
trans
);
});
}
}
else
...
...
@@ -4696,7 +4702,7 @@ namespace Mall.Module.Product
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_DistributionCommissionRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
goods_DistributionCommissionRepository
.
Update
(
keyValues1
,
wheres1
);
}
}
}
...
...
@@ -4711,7 +4717,7 @@ namespace Mall.Module.Product
||
mplist
.
Select
(
x
=>
x
.
MemberGrade
).
Distinct
().
Count
()
!=
demodel
.
MemberPriceList
.
Select
(
x
=>
x
.
MemberGrade
).
Distinct
().
Count
()
||
mplist
.
Select
(
x
=>
x
.
MemberGrade
).
Distinct
().
Count
()
!=
mplist
.
Select
(
x
=>
x
.
MemberGrade
).
Distinct
().
Where
(
x
=>
demodel
.
MemberPriceList
.
Select
(
y
=>
y
.
MemberGrade
).
Distinct
().
Contains
(
x
)).
Count
())
{
goods_MemberPriceRepository
.
DeleteBatch
(
mplist
,
trans
);
goods_MemberPriceRepository
.
DeleteBatch
(
mplist
);
foreach
(
var
item
in
demodel
.
MemberPriceList
)
{
goods_MemberPriceRepository
.
Insert
(
new
RB_Goods_MemberPrice
()
...
...
@@ -4726,7 +4732,7 @@ namespace Mall.Module.Product
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
UpdateDate
=
demodel
.
UpdateDate
}
,
trans
);
});
}
}
else
...
...
@@ -4747,7 +4753,7 @@ namespace Mall.Module.Product
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_MemberPriceRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
goods_MemberPriceRepository
.
Update
(
keyValues1
,
wheres1
);
}
}
}
...
...
@@ -4833,7 +4839,7 @@ namespace Mall.Module.Product
}
else
{
int
Id
=
goodsRepository
.
Insert
(
demodel
,
trans
);
int
Id
=
goodsRepository
.
Insert
(
demodel
);
bool
flag
=
Id
>
0
;
if
(
flag
)
{
...
...
@@ -4849,7 +4855,7 @@ namespace Mall.Module.Product
MallBaseId
=
demodel
.
MallBaseId
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
}
,
trans
);
});
}
//插入规格
if
(
demodel
.
IsCustomSpecification
==
1
)
...
...
@@ -4867,7 +4873,7 @@ namespace Mall.Module.Product
Sort
=
item
.
Sort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
}
,
trans
);
});
if
(
sid
>
0
)
{
foreach
(
var
qitem
in
item
.
SpecificationValueList
)
...
...
@@ -4884,7 +4890,7 @@ namespace Mall.Module.Product
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
SpecificationId
=
sid
}
,
trans
);
});
}
}
}
...
...
@@ -4906,7 +4912,7 @@ namespace Mall.Module.Product
UpdateDate
=
demodel
.
UpdateDate
,
Commission
=
item
.
Commission
,
CostMoney
=
item
.
CostMoney
}
,
trans
);
});
}
}
//插入区域
...
...
@@ -4922,7 +4928,7 @@ namespace Mall.Module.Product
MallBaseId
=
demodel
.
MallBaseId
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
}
,
trans
);
});
}
//插入卡卷
//插入分销佣金
...
...
@@ -4944,7 +4950,7 @@ namespace Mall.Module.Product
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
UpdateDate
=
demodel
.
UpdateDate
}
,
trans
);
});
}
}
//插入会员价格
...
...
@@ -4964,18 +4970,17 @@ namespace Mall.Module.Product
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
UpdateDate
=
demodel
.
UpdateDate
}
,
trans
);
});
}
}
}
}
goodsRepository
.
DBSession
.
Commit
();
return
true
;
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"SetProductGoodsInfo"
);
goodsRepository
.
DBSession
.
Rollback
();
LogHelper
.
Write
(
ex
,
"SetProductGoodsInfo:"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
demodel
));
return
false
;
}
}
...
...
@@ -5615,7 +5620,7 @@ namespace Mall.Module.Product
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
string
SetGoodsCategoryTransfer
(
int
categoryId
,
int
newCategoryId
,
int
tenantId
,
int
mallBaseId
,
int
empId
)
public
string
SetGoodsCategoryTransfer
(
int
categoryId
,
int
newCategoryId
,
int
tenantId
,
int
mallBaseId
,
int
empId
)
{
var
newModel
=
product_CategoryRepository
.
GetEntity
(
newCategoryId
);
if
(
newModel
==
null
)
{
return
"新分类不存在"
;
}
...
...
@@ -5624,7 +5629,8 @@ namespace Mall.Module.Product
var
list
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
CategoryId
=
categoryId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
if
(
list
.
Any
())
{
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
//修改分类
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_Category
.
CategoryId
),
newCategoryId
}
...
...
@@ -5637,7 +5643,8 @@ namespace Mall.Module.Product
}
};
bool
flag
=
goods_CategoryRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
//记录该商品日志
goods_LogRepository
.
Insert
(
new
RB_Goods_Log
()
{
...
...
@@ -5653,7 +5660,8 @@ namespace Mall.Module.Product
}
return
"转移成功,总计:"
+
list
.
Count
()
+
"商品"
;
}
else
{
else
{
return
"该分类下未找到相关商品"
;
}
}
...
...
Mall.Module.User/UserModule.cs
View file @
ec1c1032
...
...
@@ -3968,7 +3968,16 @@ namespace Mall.Module.User
{
string
UserIds
=
member_UserRepository
.
GetMemberChildIdStr
(
demodel
.
UserId
??
0
);
var
list
=
member_UserRepository
.
GetPageListForFX
(
pageIndex
,
pageSize
,
out
count
,
new
RB_Member_User_Extend
()
{
UserIds
=
UserIds
,
FXGradeId
=
demodel
.
FXGradeId
,
Name
=
demodel
.
Name
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
list
=
member_UserRepository
.
GetPageListForFX
(
pageIndex
,
pageSize
,
out
count
,
new
RB_Member_User_Extend
()
{
UserIds
=
UserIds
,
FXGradeId
=
demodel
.
FXGradeId
,
Name
=
demodel
.
Name
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
SortNum
=
demodel
.
SortNum
});
List
<
object
>
RList
=
new
List
<
object
>();
if
(
list
.
Any
())
{
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
ec1c1032
...
...
@@ -411,35 +411,42 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
}
//默认综合【升序】
string
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
Sort
)}
asc"
;
//上架时间【降序】
if
(
dmodel
.
OrderBy
==
1
)
{
//最新
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
desc"
;
{
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
DESC"
;
}
//上架时间【升序】
else
if
(
dmodel
.
OrderBy
==
5
)
{
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
ASC "
;
}
//价格低=>高【升序】
else
if
(
dmodel
.
OrderBy
==
2
)
{
//价格低-高
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
SellingPrice
)}
asc"
;
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
SellingPrice
)}
ASC"
;
}
//价格高=>低【降序】
else
if
(
dmodel
.
OrderBy
==
3
)
{
//价格高-低
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
SellingPrice
)}
desc"
;
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
SellingPrice
)}
DESC"
;
}
//销量高=>低【降序】
else
if
(
dmodel
.
OrderBy
==
4
)
{
//销量高-低
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
SalesNum
)}
desc "
;
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
SalesNum
)}
DESC "
;
}
//
上架时间升序
else
if
(
dmodel
.
OrderBy
==
5
)
//
销量低=>高【升序】
else
if
(
dmodel
.
OrderBy
==
6
)
{
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
ASC "
;
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
SalesNum
)}
ASC "
;
}
//
上架时间降序
else
if
(
dmodel
.
OrderBy
==
6
)
//
综合【降序】
else
if
(
dmodel
.
OrderBy
==
7
)
{
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
DESC "
;
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
Sort
)}
DESC "
;
}
if
(
dmodel
.
IsSelectVideo
==
1
)
...
...
Mall.Repository/User/RB_Member_UserRepository.cs
View file @
ec1c1032
...
...
@@ -223,14 +223,17 @@ select * from RB_Member_User where {where} order by CreateDate desc
/// <returns></returns>
public
List
<
RB_Member_User_Extend
>
GetPageListForFX
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Member_User_Extend
dmodel
)
{
string
where
=
" 1=1 and d.Status=0 "
;
string
where
=
" and d.Status=0 "
;
string
where2
=
""
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and u.
{
nameof
(
RB_Member_User
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
where2
+=
$@" and u.
{
nameof
(
RB_Member_User
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and u.
{
nameof
(
RB_Member_User
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
where2
+=
$@" and u.
{
nameof
(
RB_Member_User
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
...
...
@@ -269,12 +272,34 @@ select * from RB_Member_User where {where} order by CreateDate desc
where
+=
$@" and d.
{
nameof
(
RB_Distributor_Info
.
FXGradeId
)}
=
{
dmodel
.
FXGradeId
}
"
;
}
string
sql
=
$@"
select u.* from RB_Member_User u
inner join rb_distributor_info d on u.Id =d.UserId
where
{
where
}
order by u.CreateDate desc
"
;
return
GetPage
<
RB_Member_User_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT u.*
FROM RB_Member_User u INNER JOIN rb_distributor_info d on u.Id =d.UserId
LEFT JOIN (
SELECT u.SuperiorId,COUNT(0) AS ReferralsNum
FROM rb_member_user u
WHERE 1=1 {1}
GROUP BY u.SuperiorId
) AS B ON U.Id=B.SuperiorId
WHERE 1=1 {0}
"
,
where
,
where2
);
string
orderBy
=
" order by u.CreateDate desc "
;
if
(
dmodel
.
SortNum
==
1
)
{
orderBy
=
" order by u.CreateDate ASC "
;
}
else
if
(
dmodel
.
SortNum
==
2
)
{
orderBy
=
" order by B.ReferralsNum DESC "
;
}
else
if
(
dmodel
.
SortNum
==
3
)
{
orderBy
=
" order by B.ReferralsNum ASC "
;
}
builder
.
AppendFormat
(
orderBy
);
return
GetPage
<
RB_Member_User_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
ec1c1032
...
...
@@ -15,6 +15,7 @@ using Mall.CacheManager.User;
using
Newtonsoft.Json.Linq
;
using
Mall.Common
;
using
Mall.Module.Product
;
using
Mall.AOP
;
namespace
Mall.WebApi.Controllers.MallBase
{
...
...
@@ -25,7 +26,8 @@ namespace Mall.WebApi.Controllers.MallBase
public
class
ProductController
:
BaseController
{
private
readonly
ProductModule
productModule
=
new
ProductModule
();
private
readonly
ProductModule
productModule
=
AOPHelper
.
CreateAOPObject
<
ProductModule
>();
#
region
素材管理
/// <summary>
...
...
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