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
b23632f6
Commit
b23632f6
authored
Sep 14, 2021
by
suntengda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'goods_snapshot_0913' into tuancan_public
parents
e2170bc3
66dbd79e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-0
Goods.php
application/modules/Goods/controllers/Goods.php
+10
-0
GoodsSnapshotsService.php
application/services/goods/GoodsSnapshotsService.php
+40
-0
MarketingService.php
application/services/marketing/MarketingService.php
+3
-0
No files found.
application/modules/Goods/controllers/Goods.php
View file @
b23632f6
...
...
@@ -339,4 +339,14 @@ class GoodsController extends Base
$res
=
GoodsService
::
getOtaInfoByGoodsSkuIds
(
$this
->
params
);
$this
->
success
([
"result"
=>
$res
]);
}
/**
* 拼单商品快照批量获取
* @throws Exception
*/
public
function
goods_snapshotsAction
()
{
$res
=
GoodsSnapshotsService
::
goodsSnapshots
(
$this
->
params
);
$this
->
success
([
"result"
=>
$res
]);
}
}
\ No newline at end of file
application/services/goods/GoodsSnapshotsService.php
View file @
b23632f6
...
...
@@ -3,6 +3,8 @@
namespace
App\Services\goods
;
use
Api\PhpUtils\Common\GoodsSkuId
;
use
App\Models\goods\mysql\GoodsSnapshot
;
use
App\Models\goods\mysql\PindanGoodsSnapshot
;
class
GoodsSnapshotsService
...
...
@@ -32,4 +34,42 @@ class GoodsSnapshotsService
}
return
$pindanGoodsSnapshot
;
}
/**
* 批量支持商品
* @param $params
* @return array
*/
public
static
function
goodsSnapshots
(
$params
)
{
$str
=
empty
(
$params
[
"snapshots_str"
])
?
""
:
$params
[
"snapshots_str"
];
$snapshot
=
[];
if
(
!
empty
(
$str
))
{
$paramsArr
=
json_decode
(
$str
,
true
);
if
(
!
empty
(
$paramsArr
))
{
foreach
(
$paramsArr
as
$param
)
{
if
(
isset
(
$param
[
"goods_sku_id"
])
||
isset
(
$param
[
"goods_version"
]))
{
$goodsSkuIdParams
=
GoodsSkuId
::
getGoodsSkuIdParams
(
$param
[
"goods_sku_id"
]);
$key
=
$param
[
"goods_sku_id"
]
.
"_"
.
$param
[
"goods_version"
];
if
(
$goodsSkuIdParams
[
"table_tag"
]
==
GoodsSkuId
::
TABLE_TAG_PINDAN
)
{
$snapshot
[
$key
]
=
PindanGoodsSnapshot
::
getRecord
([
"goods_sku_id"
=>
$param
[
"goods_sku_id"
],
"goods_version"
=>
$param
[
"goods_version"
]
]);
}
else
{
$snapshot
[
$key
]
=
GoodsSnapshot
::
getRecord
([
"goods_sku_id"
=>
$param
[
"goods_sku_id"
],
"goods_version"
=>
$param
[
"goods_version"
]
]);
}
if
(
!
empty
(
$snapshot
[
$key
][
"desc_pic_url"
]))
{
$ksyun
=
GoodsService
::
getUrlList
(
$snapshot
[
$key
][
"desc_pic_url"
]);
$snapshot
[
$key
][
"desc_pic_url_list"
]
=
$ksyun
;
}
}
}
}
}
return
$snapshot
;
}
}
\ No newline at end of file
application/services/marketing/MarketingService.php
View file @
b23632f6
...
...
@@ -1133,6 +1133,9 @@ class MarketingService
public
static
function
getMarketingList
(
$params
)
{
$where
[
'marketing_id'
]
=
!
empty
(
$params
[
'marketing_id'
])
?
$params
[
'marketing_id'
]
:
''
;
if
(
!
empty
(
$params
[
'marketing_type'
])){
$where
[
'marketing_type'
]
=
!
empty
(
$params
[
'marketing_type'
])
?
$params
[
'marketing_type'
]
:
''
;
}
$marketing_list
=
Marketing
::
getMarketingList
(
$where
);
return
$marketing_list
;
}
...
...
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