Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cba11ccd
authored
Nov 21, 2022
by
SUDPTDUBLXEROFX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
购物车
parent
33e79af6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
app/Http/Services/CartService.php
app/Models/CartModel.php
app/Http/Services/CartService.php
View file @
cba11ccd
...
...
@@ -105,7 +105,6 @@ class CartService
public
static
function
cartLists
(
$user_id
,
$gid
=
""
,
$page_size
=
400
,
$page
=
1
){
//当前用户所有可用的购物车数据
$where
[
"status"
]
=
1
;
if
(
!
$user_id
&&
!
$gid
){
return
[];
}
...
...
@@ -116,7 +115,7 @@ class CartService
$where
[
"gid"
]
=
$gid
;
}
$query
=
CartModel
::
where
(
$where
)
->
orderBy
(
'
cart_id
'
,
'desc'
);
$query
=
CartModel
::
where
(
$where
)
->
orderBy
(
'
status
'
,
'desc'
);
$res
=
$query
->
paginate
(
$page_size
,
[
'*'
],
'page'
,
$page
)
->
toArray
();
$result
=
$res
[
"data"
];
...
...
@@ -183,6 +182,8 @@ class CartService
$cartList
[]
=
[
"goods_id"
=>
$skuInfo
[
"goods_id"
],
//sku_id
"goods_name"
=>
$skuInfo
[
"goods_name"
],
//型号名称
"status_cn"
=>
\Arr
::
get
(
CartModel
::
$status
,
$v
[
"status"
]),
//型号名称
"status"
=>
$v
[
"status"
],
//型号名称
"supplier_id"
=>
$skuInfo
[
"supplier_id"
],
//供应商id
"supplier_name"
=>
$skuInfo
[
"supplier_name"
],
//供应商id
"buy_number"
=>
$temp
[
"buy_number"
],
//购买数量
...
...
app/Models/CartModel.php
View file @
cba11ccd
...
...
@@ -12,6 +12,10 @@ class CartModel extends Model
const
status_no
=
-
1
;
//状态禁用
const
status_yes
=
1
;
//状态启动
static
$status
=
[
self
::
status_no
=>
"禁用"
,
self
::
status_yes
=>
"启动"
,
];
}
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