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
1dc8d042
Commit
1dc8d042
authored
Jan 09, 2019
by
chenchuanwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goodsStorage
parent
31880801
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
Common.php
application/library/Our/Common.php
+14
-0
OrderService.php
application/models/Business/Order/OrderService.php
+10
-2
No files found.
application/library/Our/Common.php
View file @
1dc8d042
...
@@ -70,6 +70,20 @@ class Common
...
@@ -70,6 +70,20 @@ class Common
}
}
return
false
;
return
false
;
}
}
/**
* @param $arr
* @param $key_name
* @return array
* 将数据库中查出的列表以指定的 id 作为数组的键名
*/
public
static
function
convertArrKey
(
$arr
,
$key_name
)
{
$arr2
=
array
();
foreach
(
$arr
as
$key
=>
$val
)
{
$arr2
[
$val
[
$key_name
]]
=
$val
;
}
return
$arr2
;
}
public
static
function
isSerialized
(
$data
)
public
static
function
isSerialized
(
$data
)
{
{
...
...
application/models/Business/Order/OrderService.php
View file @
1dc8d042
...
@@ -1198,7 +1198,9 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -1198,7 +1198,9 @@ class OrderServiceModel extends \Business\AbstractModel
public
function
updateGoodsStoregeByGoodsIds
(
$storeId
,
$goodsid
,
$num
=
ApiConst
::
zero
,
$type
=
ApiConst
::
plus
){
public
function
updateGoodsStoregeByGoodsIds
(
$storeId
,
$goodsid
,
$num
=
ApiConst
::
zero
,
$type
=
ApiConst
::
plus
){
if
(
is_array
(
$goodsid
)){
if
(
is_array
(
$goodsid
)){
$where
[
'goods_id'
]
=
array
(
'in'
,
$goodsid
);
$goodsids
=
array
(
$goodsid
);
$convertGoodsId
=
Common
::
convertArrKey
(
$goodsid
,
'goodsId'
);
$where
[
'goods_id'
]
=
array
(
'in'
,
$goodsids
);
}
else
{
}
else
{
$where
[
'goods_id'
]
=
$goodsid
;
$where
[
'goods_id'
]
=
$goodsid
;
}
}
...
@@ -1206,9 +1208,15 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -1206,9 +1208,15 @@ class OrderServiceModel extends \Business\AbstractModel
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$goodses
=
$goodsDao
->
getList
(
$where
,
$goodsDao
->
goodsDetailField
);
$goodses
=
$goodsDao
->
getList
(
$where
,
$goodsDao
->
goodsDetailField
);
if
(
!
empty
(
$goodses
)){
if
(
!
empty
(
$goodses
)){
if
(
is_array
(
$goodsid
)){
foreach
(
$goodses
as
&
$goods
){
$goods
[
'goodsNum'
]
=
$convertGoodsId
[
$goods
[
'goodsId'
]][
'num'
];
}
}
else
{
foreach
(
$goodses
as
&
$goods
){
foreach
(
$goodses
as
&
$goods
){
$goods
[
'goodsNum'
]
=
$num
;
$goods
[
'goodsNum'
]
=
$num
;
}
}
}
if
(
$this
->
updateDateGoodsStoregeByOrderGoods
(
$goodses
,
$type
,
false
)){
if
(
$this
->
updateDateGoodsStoregeByOrderGoods
(
$goodses
,
$type
,
false
)){
return
true
;
return
true
;
}
}
...
...
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