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
89db04b7
Commit
89db04b7
authored
Oct 30, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
90cfdceb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+5
-1
Goods.php
application/models/DAO/Goods.php
+3
-3
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
89db04b7
...
...
@@ -30,7 +30,10 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$op
=
isset
(
$this
->
setStorageType
[
$type
])
?
$this
->
setStorageType
[
$type
]
:
2
;
//默认设置库存
$goodsDao
->
db
->
doTransaction
();
$ret1
=
$goodsDao
->
updateStorage
(
$goodsId
,
$num
,
$op
);
$ret2
=
$commonDao
->
updateStorage
(
$data
[
'goods_commonid'
]);
$ret2
=
true
;
if
(
$op
==
1
)
{
//如果就库存调整
$ret2
=
$commonDao
->
updateStorage
(
$data
[
'goods_commonid'
]);
}
if
(
!
$ret1
||
!
$ret2
)
{
$goodsDao
->
db
->
doRollback
();
...
...
@@ -48,6 +51,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$goodsDao
=
\DAO\GoodsModel
::
getInstance
();
$where
=
array
();
$where
[]
=
'store_id = '
.
$storeId
;
$where
[]
=
'goods_storage_alarm > 0'
;
$where
[]
=
'goods_storage<=goods_storage_alarm'
;
//获得列表
if
(
$datas
=
$goodsDao
->
getList
(
implode
(
$where
,
' and '
),
$this
->
goodsStorageField
))
{
...
...
application/models/DAO/Goods.php
View file @
89db04b7
...
...
@@ -39,10 +39,10 @@ class GoodsModel extends \DAO\AbstractModel {
public
function
updateStorage
(
$goodsId
,
$num
,
$op
)
{
$this
->
setDb
();
$whereSql
=
'goods_id='
.
$goodsId
;
if
(
$op
==
1
){
if
(
$op
==
1
){
//调整库存
$updateSql
=
'goods_storage = goods_storage'
.
(
$num
<
0
?
'-'
.
(
-
$num
)
:
'+'
.
$num
);
}
else
{
$updateSql
=
'goods_storage
='
.
$num
;
}
else
{
//调整库存预警为不需要预警
$updateSql
=
'goods_storage
_alarm =0'
;
}
$updateAllSql
=
"UPDATE
{
$this
->
_tableName
}
set
{
$updateSql
}
where
{
$whereSql
}
"
;
return
$this
->
db
->
update
(
$this
->
_tableName
)
->
query
(
$updateAllSql
);
...
...
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