Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
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
chenchuanwen
my-yaf-project
Commits
d02df1a5
Commit
d02df1a5
authored
Sep 28, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自己店铺的商品不能加入购物车
parent
6b137e1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
CartService.php
application/models/Business/Cart/CartService.php
+9
-0
CodeConfig.php
application/models/Error/CodeConfig.php
+2
-0
No files found.
application/models/Business/Cart/CartService.php
View file @
d02df1a5
...
@@ -240,6 +240,9 @@ class CartServiceModel extends \Business\AbstractModel{
...
@@ -240,6 +240,9 @@ class CartServiceModel extends \Business\AbstractModel{
foreach
(
$validReturnData
as
$goods
){
foreach
(
$validReturnData
as
$goods
){
$newCart
=
array
();
$newCart
=
array
();
$store
=
$storeDao
->
get
(
$goods
[
'store_id'
],
false
);
$store
=
$storeDao
->
get
(
$goods
[
'store_id'
],
false
);
if
(
$store
[
'member_id'
]
==
$memberId
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
wrongAddCartForSelfStore
);
}
if
(
!
(
$storeIds
&&
in_array
(
$goods
[
'store_id'
],
$storeIds
))){
if
(
!
(
$storeIds
&&
in_array
(
$goods
[
'store_id'
],
$storeIds
))){
$storeIds
[]
=
$goods
[
'store_id'
];
$storeIds
[]
=
$goods
[
'store_id'
];
}
}
...
@@ -263,6 +266,9 @@ class CartServiceModel extends \Business\AbstractModel{
...
@@ -263,6 +266,9 @@ class CartServiceModel extends \Business\AbstractModel{
}
else
{
}
else
{
$goods
=
$validReturnData
;
$goods
=
$validReturnData
;
$store
=
$storeDao
->
get
(
$goods
[
'store_id'
],
false
);
$store
=
$storeDao
->
get
(
$goods
[
'store_id'
],
false
);
if
(
$store
[
'member_id'
]
==
$memberId
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
wrongAddCartForSelfStore
);
}
$storeIds
[]
=
$goods
[
'store_id'
];
$storeIds
[]
=
$goods
[
'store_id'
];
$newCart
[
'store_id'
]
=
$goods
[
'store_id'
];
$newCart
[
'store_id'
]
=
$goods
[
'store_id'
];
$newCart
[
'goods_id'
]
=
$goods
[
'goods_id'
];
$newCart
[
'goods_id'
]
=
$goods
[
'goods_id'
];
...
@@ -291,6 +297,9 @@ class CartServiceModel extends \Business\AbstractModel{
...
@@ -291,6 +297,9 @@ class CartServiceModel extends \Business\AbstractModel{
public
function
getPBundlingGoodsCartData
(
$blNum
,
$memberId
,
$pBundling
){
public
function
getPBundlingGoodsCartData
(
$blNum
,
$memberId
,
$pBundling
){
$storeDao
=
\DAO\StoreModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$storeDao
=
\DAO\StoreModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$store
=
$storeDao
->
get
(
$pBundling
[
'store_id'
],
false
);
$store
=
$storeDao
->
get
(
$pBundling
[
'store_id'
],
false
);
if
(
$store
[
'member_id'
]
==
$memberId
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
wrongAddCartForSelfStore
);
}
$newCart
[
'store_id'
]
=
$pBundling
[
'store_id'
];
$newCart
[
'store_id'
]
=
$pBundling
[
'store_id'
];
$newCart
[
'goods_id'
]
=
$pBundling
[
'blId'
];
$newCart
[
'goods_id'
]
=
$pBundling
[
'blId'
];
$newCart
[
'goods_commonid'
]
=
\Our\ApiConst
::
zero
;
$newCart
[
'goods_commonid'
]
=
\Our\ApiConst
::
zero
;
...
...
application/models/Error/CodeConfig.php
View file @
d02df1a5
...
@@ -167,6 +167,7 @@ class CodeConfigModel {
...
@@ -167,6 +167,7 @@ class CodeConfigModel {
const
pBundlingNoStorageForOrder
=
50040
;
const
pBundlingNoStorageForOrder
=
50040
;
const
editDelCartFailed
=
50041
;
const
editDelCartFailed
=
50041
;
const
editCartUploadCartFailed
=
50042
;
const
editCartUploadCartFailed
=
50042
;
const
wrongAddCartForSelfStore
=
50043
;
//订单相关错误码
//订单相关错误码
...
@@ -565,6 +566,7 @@ class CodeConfigModel {
...
@@ -565,6 +566,7 @@ class CodeConfigModel {
self
::
pBundlingNoStorageForOrder
=>
'组合销售商品库存不足'
,
self
::
pBundlingNoStorageForOrder
=>
'组合销售商品库存不足'
,
self
::
editDelCartFailed
=>
'编辑购物车时删除数据失败'
,
self
::
editDelCartFailed
=>
'编辑购物车时删除数据失败'
,
self
::
editCartUploadCartFailed
=>
'编辑购物车更新购物车时间失败'
,
self
::
editCartUploadCartFailed
=>
'编辑购物车更新购物车时间失败'
,
self
::
wrongAddCartForSelfStore
=>
'店主不能添加自己店铺的商品到购物车'
,
self
::
addressNotExist
=>
'地址不存在'
,
self
::
addressNotExist
=>
'地址不存在'
,
self
::
emptyAddressId
=>
'地址主键参数不能为空'
,
self
::
emptyAddressId
=>
'地址主键参数不能为空'
,
...
...
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