Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
3f14ef5a
Commit
3f14ef5a
authored
Aug 30, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Plain Diff
update:修改文案冲突
parents
664c7f05
0c301941
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
18 deletions
+45
-18
GoodsException.php
application/exception/custom/GoodsException.php
+1
-0
GoodsService.php
application/services/goods/GoodsService.php
+43
-17
Goods.php
daemon/Goods.php
+1
-1
No files found.
application/exception/custom/GoodsException.php
View file @
3f14ef5a
...
...
@@ -70,5 +70,6 @@ class GoodsException extends BaseException
49
=>
'库存不得小于已售库存'
,
self
::
RULE_LIMIT_ERROR
=>
'单人可买上限填写错误'
,
self
::
NOT_FIND_MARKETING
=>
'找不到活动'
,
52
=>
'商品过期时间小于等于,上架时间'
,
];
}
\ No newline at end of file
application/services/goods/GoodsService.php
View file @
3f14ef5a
...
...
@@ -281,6 +281,15 @@ class GoodsService
break
;
}
if
(
!
empty
(
$skuData
[
"online_type"
]))
{
//立即上架和定时上架
if
(
in_array
(
$skuData
[
"online_type"
],
[
1
,
2
]))
{
if
(
$skuData
[
"expiration_time"
]
<=
$skuData
[
'online_start_time'
])
{
throw
new
GoodsException
([
"cus"
=>
49
]);
}
}
}
GoodsSku
::
save
(
$skuParams
);
self
::
addGoodsSkuPicRecord
(
$skuId
,
$skuData
);
return
$skuId
;
...
...
@@ -429,14 +438,12 @@ class GoodsService
];
}
if
(
$status
==
GoodsSku
::
STATUS_PASS
)
{
$online_type
=
empty
(
$sku
[
"online_type"
])
?
0
:
$sku
[
"online_type"
];
if
(
$online_type
==
1
)
{
if
(
$status
==
GoodsSku
::
STATUS_PASS
)
{
$statusData
[
'online_status'
]
=
GoodsSku
::
ONLINE_STATUS_ONLINE
;
$statusData
[
'online_start_time'
]
=
date
(
"Y-m-d H:i:s"
);
}
}
//定点上架
if
(
$online_type
==
2
)
{
...
...
@@ -448,7 +455,8 @@ class GoodsService
//暂不上架
if
(
$online_type
==
3
)
{
$statusData
[
'online_status'
]
=
GoodsSku
::
ONLINE_STATUS_NO_ONLINE
;
$statusData
[
'online_status'
]
=
GoodsSku
::
ONLINE_STATUS_OFFLINE
;
}
}
GoodsSku
::
save
(
$statusData
,
[
"goods_sku_id"
=>
$sku
[
"goods_sku_id"
]]);
...
...
@@ -574,6 +582,7 @@ class GoodsService
$goodsSkuList
=
GoodsSku
::
select
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
if
(
!
empty
(
$goodsSkuList
))
{
foreach
(
$goodsSkuList
as
$sku
)
{
$goodsSkuId
=
$sku
[
"goods_sku_id"
];
$goodsSkuData
=
[
"online_type"
=>
$onlineType
,
...
...
@@ -600,6 +609,13 @@ class GoodsService
}
}
//立即上架和定时上架
if
(
in_array
(
$onlineType
,
[
1
,
2
]))
{
if
(
$sku
[
"expiration_time"
]
<=
$goodsSkuData
[
'online_start_time'
])
{
throw
new
GoodsException
([
"cus"
=>
49
]);
}
}
GoodsSku
::
save
(
$goodsSkuData
,
[
"goods_sku_id"
=>
$goodsSkuId
]);
//上架的话,生成快照
self
::
addGoodsSnapshot
(
$sku
);
...
...
@@ -829,6 +845,16 @@ class GoodsService
$skuParams
[
'online_type'
]
=
empty
(
$params
[
"online_type"
])
?
0
:
$params
[
"online_type"
];
}
if
(
!
empty
(
$params
[
"online_type"
]))
{
//立即上架和定时上架
if
(
in_array
(
$params
[
"online_type"
],
[
1
,
2
]))
{
if
(
$skuData
[
"expiration_time"
]
<=
$skuParams
[
'online_start_time'
])
{
throw
new
GoodsException
([
"cus"
=>
49
]);
}
}
}
//商品操作记录
$record
=
[
"goods_spu_id"
=>
$skuData
[
"goods_spu_id"
],
...
...
daemon/Goods.php
View file @
3f14ef5a
...
...
@@ -102,7 +102,7 @@ class Goods implements DaemonServiceInterface
];
$goodsList
=
GoodsSku
::
getRecords
(
$orderData
);
DaemonLog
::
info
(
'DaemonServiceOnline_goods'
,
json_encode
(
$goodsList
));
DaemonLog
::
info
(
'DaemonServiceOnline
Off
_goods'
,
json_encode
(
$goodsList
));
foreach
(
$goodsList
as
$key
=>
$value
)
{
$where
=
[];
$where
[
'goods_sku_id'
]
=
!
empty
(
$value
[
'goods_sku_id'
])
?
$value
[
'goods_sku_id'
]
:
''
;
...
...
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