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
52ca89f3
Commit
52ca89f3
authored
Sep 03, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
e152d55a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
170 additions
and
1 deletion
+170
-1
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+8
-0
GuideCarModule.cs
Mall.Module.Product/GuideCarModule.cs
+1
-1
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+161
-0
No files found.
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
52ca89f3
...
...
@@ -42,6 +42,14 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
string
CarColorName
{
get
;
set
;
}
/// <summary>
/// 车辆类型
/// </summary>
public
int
?
CarClass
{
get
;
set
;
}
public
string
RegionIds
{
get
;
set
;
}
#
endregion
/// <summary>
...
...
Mall.Module.Product/GuideCarModule.cs
View file @
52ca89f3
...
...
@@ -3145,7 +3145,7 @@ namespace Mall.Module.Product
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_GuideCar_CarBrand
.
ID
),
FiledValue
=
model
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
carBrandRepository
.
Update
(
filedsRegion
,
whereHelpersRegion
);
flag
=
carBrandRepository
.
Update
(
filedsRegion
,
whereHelpersRegion
);
}
}
catch
(
Exception
ex
)
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
52ca89f3
...
...
@@ -816,6 +816,167 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
string
sql
=
$@"select g.* from RB_Goods g where
{
where
}
"
;
return
Get
<
RB_Goods_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetAppletPageListForCar
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Goods_Extend
dmodel
)
{
string
where
=
$" 1=1 and g.
{
nameof
(
RB_Goods_Extend
.
Status
)}
=0 and g.GoodsClassify=1 and g.
{
nameof
(
RB_Goods_Extend
.
GoodsStatus
)}
=1"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
NotTenantId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
<>
{
dmodel
.
NotTenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
CarType
.
HasValue
&&
(
int
)
dmodel
.
CarType
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CarType
)}
=
{(
int
)
dmodel
.
CarType
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
RegionIds
))
{
where
+=
$@" and e.RegionId in(
{
dmodel
.
RegionIds
}
) "
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
LineName
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
LineName
)}
like'%
{
dmodel
.
LineName
}
%' "
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
LineDescription
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
LineDescription
)}
like'%
{
dmodel
.
LineDescription
}
%' "
;
}
if
(
dmodel
.
UseDay
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
UseDay
)}
=
{
dmodel
.
UseDay
}
"
;
}
if
(
dmodel
.
IsSpell
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
IsSpell
)}
=
{
dmodel
.
IsSpell
}
"
;
}
if
(
dmodel
.
RideNum
>
0
)
{
where
+=
$@" and (g.
{
nameof
(
RB_Goods_Extend
.
RideNum
)}
-b.ReserveNum)>=
{
dmodel
.
RideNum
}
"
;
}
if
(
dmodel
.
CarClass
.
HasValue
&&
dmodel
.
CarClass
>
0
)
{
where
+=
$@" and e.CarClass=
{
dmodel
.
CarClass
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Id
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
if
(
dmodel
.
IsSelectSellOut
==
1
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
InventoryNum
)}
<=0"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CategoryIds
))
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Category
.
CategoryId
)}
in(
{
dmodel
.
CategoryIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
>='
{
dmodel
.
StartTime
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
}
if
(
dmodel
.
IsProcurement
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
IsProcurement
)}
=
{
dmodel
.
IsProcurement
}
"
;
}
if
(
dmodel
.
IsProxy
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
IsProxy
)}
=
{
dmodel
.
IsProxy
}
"
;
}
if
(
dmodel
.
SupplierId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
SupplierId
)}
=
{
dmodel
.
SupplierId
}
"
;
}
string
orderBy
=
" g.Sort desc"
;
if
(
dmodel
.
OrderBy
==
1
)
{
//价格升序
orderBy
=
" g.Sort asc"
;
}
else
if
(
dmodel
.
OrderBy
==
2
)
{
//价格降序
orderBy
=
" g.Sort desc"
;
}
else
if
(
dmodel
.
OrderBy
==
3
)
{
//价格升序
orderBy
=
" g.SellingPrice asc"
;
}
else
if
(
dmodel
.
OrderBy
==
4
)
{
//价格降序
orderBy
=
" g.SellingPrice desc"
;
}
else
if
(
dmodel
.
OrderBy
==
5
)
{
//评分升序
orderBy
=
" e.Score asc"
;
}
else
if
(
dmodel
.
OrderBy
==
6
)
{
//评分降序
orderBy
=
" e.Score desc"
;
}
else
if
(
dmodel
.
OrderBy
==
7
)
{
//最新升序
orderBy
=
" g.CreateDate asc"
;
}
else
if
(
dmodel
.
OrderBy
==
8
)
{
//最新降序
orderBy
=
" g.CreateDate desc"
;
}
// e.CarClass = 1
//and g.CarType = 1 and g.LineName like'%川藏%' and g.LineDescription like'%成都%'
//and g.UseDay = 2 and g.IsSpell = 1 and(g.RideNum - b.ReserveNum) >= 4 and d.RegionId in(4)
string
sql
=
$@"SELECT g.*,c.SiteName,e.`Name` as CarName from rb_goods as g
LEFT JOIN rb_goods_targetdate as b on g.Id=b.GoodsId
LEFT JOIN rb_guidecar_site as c on g.SiteId=c.ID
LEFT JOIN rb_guidecar_car as e on e.ID=g.CarId
LEFT JOIN rb_guidecar_siteregion d on d.SiteId=g.SiteId
where
{
where
}
GROUP BY g.Id order by
{
orderBy
}
"
;
return
GetPage
<
RB_Goods_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
#
endregion
}
}
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