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
d5fa6680
Commit
d5fa6680
authored
Sep 02, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购物车编辑提示店铺关闭问题
parent
81a364ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
CartService.php
application/models/Business/Cart/CartService.php
+6
-4
Goods.php
application/models/DAO/Goods.php
+1
-1
No files found.
application/models/Business/Cart/CartService.php
View file @
d5fa6680
...
@@ -55,9 +55,9 @@ class CartServiceModel extends \Business\AbstractModel{
...
@@ -55,9 +55,9 @@ class CartServiceModel extends \Business\AbstractModel{
* @param $pBundlind
* @param $pBundlind
*/
*/
public
function
editCart
(
$data
,
$cart
,
$memberId
,
$pBundlind
=
null
){
public
function
editCart
(
$data
,
$cart
,
$memberId
,
$pBundlind
=
null
){
$this
->
validEditCart
(
$data
,
$cart
,
$memberId
,
$pBundlind
);
$
validReturnData
=
$
this
->
validEditCart
(
$data
,
$cart
,
$memberId
,
$pBundlind
);
$cartDao
=
\DAO\Cart\CartModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$cartDao
=
\DAO\Cart\CartModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$cartArray
=
$this
->
getFormattedCartDataForEdit
(
$data
,
$cart
,
$memberId
,
$pBundlind
);
$cartArray
=
$this
->
getFormattedCartDataForEdit
(
$data
,
$cart
,
$memberId
,
$pBundlind
,
$validReturnData
);
$result
=
$cartDao
->
update
(
$cartArray
[
'cart'
],
array
(
'cart_id'
=>
$cart
[
'cart_id'
]));
$result
=
$cartDao
->
update
(
$cartArray
[
'cart'
],
array
(
'cart_id'
=>
$cart
[
'cart_id'
]));
if
(
!
$result
){
if
(
!
$result
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
editCartFailed
);
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
editCartFailed
);
...
@@ -148,9 +148,9 @@ class CartServiceModel extends \Business\AbstractModel{
...
@@ -148,9 +148,9 @@ class CartServiceModel extends \Business\AbstractModel{
* @return array
* @return array
* @throws \Our\Exception
* @throws \Our\Exception
*/
*/
public
function
getFormattedCartDataForEdit
(
$data
,
$cart
,
$memberId
,
$pBundling
=
null
){
public
function
getFormattedCartDataForEdit
(
$data
,
$cart
,
$memberId
,
$pBundling
=
null
,
$validReturnData
){
if
(
$cart
[
'type'
]
==
\Our\ApiConst
::
addGoodsToCart
){
if
(
$cart
[
'type'
]
==
\Our\ApiConst
::
addGoodsToCart
){
$newCart
=
$this
->
getCommonGoodsCartData
(
$data
[
'goodsId'
],
$data
[
'goodsNum'
],
$memberId
);
$newCart
=
$this
->
getCommonGoodsCartData
(
$data
[
'goodsId'
],
$data
[
'goodsNum'
],
$memberId
,
$validReturnData
);
}
else
if
(
$cart
[
'type'
]
==
\Our\ApiConst
::
addBundingToCart
){
}
else
if
(
$cart
[
'type'
]
==
\Our\ApiConst
::
addBundingToCart
){
$newCart
=
$this
->
getPBundlingGoodsCartData
(
$data
[
'goodsNum'
],
$memberId
,
$pBundling
);
$newCart
=
$this
->
getPBundlingGoodsCartData
(
$data
[
'goodsNum'
],
$memberId
,
$pBundling
);
}
}
...
@@ -358,6 +358,7 @@ class CartServiceModel extends \Business\AbstractModel{
...
@@ -358,6 +358,7 @@ class CartServiceModel extends \Business\AbstractModel{
if
(
!
$goodsValidStatus
){
if
(
!
$goodsValidStatus
){
\Error\ErrorModel
::
throwException
(
$goodsDao
->
errorCode
);
\Error\ErrorModel
::
throwException
(
$goodsDao
->
errorCode
);
}
}
return
$goodsValidStatus
;
}
else
if
(
$cart
[
'type'
]
==
\Our\ApiConst
::
addBundingToCart
){
}
else
if
(
$cart
[
'type'
]
==
\Our\ApiConst
::
addBundingToCart
){
if
(
!
$pBundling
){
if
(
!
$pBundling
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyCartBundling
);
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyCartBundling
);
...
@@ -367,6 +368,7 @@ class CartServiceModel extends \Business\AbstractModel{
...
@@ -367,6 +368,7 @@ class CartServiceModel extends \Business\AbstractModel{
}
}
$this
->
checkBundlingGoods
(
$pBundling
,
$data
[
'goodsNum'
],
true
);
$this
->
checkBundlingGoods
(
$pBundling
,
$data
[
'goodsNum'
],
true
);
}
}
return
true
;
}
}
/**
/**
...
...
application/models/DAO/Goods.php
View file @
d5fa6680
...
@@ -111,7 +111,7 @@ class GoodsModel extends \DAO\AbstractModel {
...
@@ -111,7 +111,7 @@ class GoodsModel extends \DAO\AbstractModel {
$this
->
errorCode
=
\Error\CodeConfigModel
::
noStorageForCart
;
$this
->
errorCode
=
\Error\CodeConfigModel
::
noStorageForCart
;
return
false
;
return
false
;
}
}
return
true
;
return
$goods
;
}
}
/**
/**
...
...
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