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
b6affcce
Commit
b6affcce
authored
Aug 30, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'online_time' into develop
parents
d4acb2fd
eb9b9d48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
18 deletions
+37
-18
GoodsService.php
application/services/goods/GoodsService.php
+36
-18
Goods.php
daemon/Goods.php
+1
-0
No files found.
application/services/goods/GoodsService.php
View file @
b6affcce
...
@@ -429,25 +429,27 @@ class GoodsService
...
@@ -429,25 +429,27 @@ class GoodsService
];
];
}
}
$online_type
=
empty
(
$skuData
[
"online_type"
])
?
0
:
$skuData
[
"online_type"
];
$online_type
=
empty
(
$sku
[
"online_type"
])
?
0
:
$sku
[
"online_type"
];
switch
(
$online_type
)
{
if
(
$online_type
==
1
)
{
case
1
:
if
(
$status
==
GoodsSku
::
STATUS_PASS
)
{
$statusData
[
'online_status'
]
=
1
;
$statusData
[
'online_status'
]
=
GoodsSku
::
ONLINE_STATUS_ONLINE
;
break
;
$statusData
[
'online_start_time'
]
=
date
(
"Y-m-d H:i:s"
);
case
2
:
}
$statusData
[
'online_status'
]
=
0
;
}
$statusData
[
'online_start_time'
]
=
empty
(
$skuData
[
"online_start_time"
])
?
""
:
$skuData
[
"online_start_time"
];
$statusData
[
'online_end_time'
]
=
empty
(
$skuData
[
"online_end_time"
])
?
""
:
$skuData
[
"online_end_time"
];
//定点上架
break
;
if
(
$online_type
==
2
)
{
case
3
:
$onlineStartTime
=
empty
(
$sku
[
"online_start_time"
])
?
0
:
strtotime
(
$sku
[
"online_start_time"
]);
$statusData
[
'online_status'
]
=
0
;
if
(
$onlineStartTime
>
time
())
{
break
;
$statusData
[
'online_status'
]
=
GoodsSku
::
ONLINE_STATUS_NO_ONLINE
;
default
:
}
# code...
break
;
}
}
//暂不上架
if
(
$online_type
==
3
)
{
$statusData
[
'online_status'
]
=
GoodsSku
::
ONLINE_STATUS_NO_ONLINE
;
}
GoodsSku
::
save
(
$statusData
,
[
"goods_sku_id"
=>
$sku
[
"goods_sku_id"
]]);
GoodsSku
::
save
(
$statusData
,
[
"goods_sku_id"
=>
$sku
[
"goods_sku_id"
]]);
...
@@ -579,9 +581,25 @@ class GoodsService
...
@@ -579,9 +581,25 @@ class GoodsService
"online_end_time"
=>
$onlineEndTime
"online_end_time"
=>
$onlineEndTime
];
];
if
(
$onlineType
==
1
)
{
if
(
$onlineType
==
1
)
{
if
(
$sku
[
'audit_status'
]
==
1
)
{
$goodsSkuData
[
'online_status'
]
=
1
;
}
$goodsSkuData
[
'online_start_time'
]
=
date
(
"Y-m-d H:i:s"
);
$goodsSkuData
[
'online_start_time'
]
=
date
(
"Y-m-d H:i:s"
);
}
}
//暂不上架
if
(
$onlineType
==
3
)
{
//$goodsSkuData['audit_status'] = 0;
$goodsSkuData
[
'online_status'
]
=
0
;
}
if
(
$onlineType
==
2
)
{
$onlineStartTime
=
strtotime
(
$goodsSkuData
[
'online_start_time'
]);
if
(
$onlineStartTime
>
time
())
{
$goodsSkuData
[
'online_status'
]
=
0
;
}
}
GoodsSku
::
save
(
$goodsSkuData
,
[
"goods_sku_id"
=>
$goodsSkuId
]);
GoodsSku
::
save
(
$goodsSkuData
,
[
"goods_sku_id"
=>
$goodsSkuId
]);
//上架的话,生成快照
//上架的话,生成快照
self
::
addGoodsSnapshot
(
$sku
);
self
::
addGoodsSnapshot
(
$sku
);
...
@@ -1191,7 +1209,7 @@ class GoodsService
...
@@ -1191,7 +1209,7 @@ class GoodsService
$where
[
'ORDER'
]
=
[
"create_time"
=>
"DESC"
];
$where
[
'ORDER'
]
=
[
"create_time"
=>
"DESC"
];
$list
=
GoodsSku
::
select
([
"goods_spu_id"
,
"goods_sku_id"
,
"goods_name"
,
"category_1_id"
,
"category_2_id"
,
"life_account_id"
,
$list
=
GoodsSku
::
select
([
"goods_spu_id"
,
"goods_sku_id"
,
"goods_name"
,
"category_1_id"
,
"category_2_id"
,
"life_account_id"
,
"publish_user_id"
,
"update_time"
,
"create_time"
,
"audit_status"
,
"online_status"
,
"online_start_time"
],
"publish_user_id"
,
"update_time"
,
"create_time"
,
"audit_status"
,
"online_status"
,
"online_start_time"
,
"online_end_time"
,
"online_type"
],
$where
);
$where
);
if
(
!
empty
(
$list
))
{
if
(
!
empty
(
$list
))
{
foreach
(
$list
as
$key
=>
$item
)
{
foreach
(
$list
as
$key
=>
$item
)
{
...
...
daemon/Goods.php
View file @
b6affcce
...
@@ -66,6 +66,7 @@ class Goods implements DaemonServiceInterface
...
@@ -66,6 +66,7 @@ class Goods implements DaemonServiceInterface
$orderData
=
[
$orderData
=
[
'online_type'
=>
2
,
'online_type'
=>
2
,
'online_status'
=>
0
,
'online_status'
=>
0
,
'audit_status'
=>
1
,
'online_start_time[<]'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'online_start_time[<]'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'LIMIT'
=>
100
,
'LIMIT'
=>
100
,
];
];
...
...
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