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
5f68b9f1
Commit
5f68b9f1
authored
Aug 02, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:拼单商品快照
parent
a7fcf412
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
7 deletions
+48
-7
GoodsService.php
application/services/goods/GoodsService.php
+21
-7
MarketingPindanGoodsService.php
application/services/goods/MarketingPindanGoodsService.php
+27
-0
No files found.
application/services/goods/GoodsService.php
View file @
5f68b9f1
...
@@ -1226,9 +1226,25 @@ class GoodsService
...
@@ -1226,9 +1226,25 @@ class GoodsService
* @throws GoodsException
* @throws GoodsException
*/
*/
public
static
function
getGoodsSnapshotInfo
(
$params
)
public
static
function
getGoodsSnapshotInfo
(
$params
)
{
$marketingType
=
!
empty
(
$params
[
'marketing_type'
])
?
$params
[
'marketing_type'
]
:
0
;
if
(
$marketingType
==
Marketing
::
MARKETING_TYPE_PINDAN
)
{
return
MarketingPindanGoodsService
::
pindanGoodsSnapshotInfo
(
$params
);
}
else
{
return
self
::
generalGoodsSnapshotInfo
(
$params
);
}
}
/**
* 普通商品商品快照
* @param $params
* @return array
* @throws GoodsException
*/
private
static
function
generalGoodsSnapshotInfo
(
$params
)
{
{
$data
=
[];
$data
=
[];
$goodsSnapshot
=
GoodsSnapshot
::
getRecord
([
"goods_sku_id"
=>
$params
[
"goods_sku_id"
],
"goods_version"
=>
$params
[
"
goods_
version"
]]);
$goodsSnapshot
=
GoodsSnapshot
::
getRecord
([
"goods_sku_id"
=>
$params
[
"goods_sku_id"
],
"goods_version"
=>
$params
[
"version"
]]);
if
(
empty
(
$goodsSnapshot
))
{
if
(
empty
(
$goodsSnapshot
))
{
throw
new
GoodsException
([
"cus"
=>
23
]);
throw
new
GoodsException
([
"cus"
=>
23
]);
}
}
...
@@ -1239,15 +1255,13 @@ class GoodsService
...
@@ -1239,15 +1255,13 @@ class GoodsService
$data
[
"category_2_name"
]
=
$nameList
[
1
];
$data
[
"category_2_name"
]
=
$nameList
[
1
];
$data
[
"desc_pic_url_list"
]
=
[];
$data
[
"desc_pic_url_list"
]
=
[];
if
(
!
empty
(
$goodsSnapshot
[
"desc_pic_url"
]))
{
if
(
!
empty
(
$goodsSnapshot
[
"desc_pic_url"
]))
{
$image
=
explode
(
","
,
$goodsSnapshot
[
"desc_pic_url"
]);
$ksyun
=
GoodsService
::
getUrlList
(
$goodsSnapshot
[
"desc_pic_url"
]);
$ksyun
=
Ksyun
::
getDownUrl
(
$image
,
'merchant-b'
,
'bp-yidian'
,
60
);
$data
[
"desc_pic_url_list"
]
=
$ksyun
;
$data
[
"desc_pic_url_list"
]
=
array_values
(
$ksyun
);
}
}
$data
[
"introduce_pic_url_list"
]
=
[];
$data
[
"introduce_pic_url_list"
]
=
[];
if
(
!
empty
(
$goodsSnapshot
[
"introduce_pic_url"
]))
{
if
(
!
empty
(
$goodsSnapshot
[
"introduce_pic_url"
]))
{
$image
=
explode
(
","
,
$goodsSnapshot
[
"introduce_pic_url"
]);
$ksyun
=
GoodsService
::
getUrlList
(
$goodsSnapshot
[
"introduce_pic_url"
]);
$ksyun
=
Ksyun
::
getDownUrl
(
$image
,
'merchant-b'
,
'bp-yidian'
,
60
);
$data
[
"introduce_pic_url_list"
]
=
$ksyun
;
$data
[
"introduce_pic_url_list"
]
=
array_values
(
$ksyun
);
}
}
$data
[
"desc"
]
=
$goodsSnapshot
[
"desc"
];
$data
[
"desc"
]
=
$goodsSnapshot
[
"desc"
];
...
...
application/services/goods/MarketingPindanGoodsService.php
View file @
5f68b9f1
...
@@ -309,4 +309,31 @@ class MarketingPindanGoodsService
...
@@ -309,4 +309,31 @@ class MarketingPindanGoodsService
$skuInfo
=
PindanGoodsSku
::
getRecordMaster
([
"pindan_goods_sku_id"
=>
$skuId
]);
$skuInfo
=
PindanGoodsSku
::
getRecordMaster
([
"pindan_goods_sku_id"
=>
$skuId
]);
PindanGoodsSnapshot
::
insertRecord
(
$skuInfo
[
0
]);
PindanGoodsSnapshot
::
insertRecord
(
$skuInfo
[
0
]);
}
}
/**
* 拼单商品商品快照
* @param $params
* @return array
* @throws GoodsException
*/
public
static
function
pindanGoodsSnapshotInfo
(
$params
)
{
$data
=
[];
$goodsSnapshot
=
PindanGoodsSnapshot
::
getRecord
([
"pindan_goods_sku_id"
=>
$params
[
"goods_sku_id"
],
"goods_version"
=>
$params
[
"version"
]]);
if
(
empty
(
$goodsSnapshot
))
{
throw
new
GoodsException
([
"cus"
=>
23
]);
}
$data
[
"goods_name"
]
=
$goodsSnapshot
[
"goods_name"
];
$data
[
"desc_pic_url_list"
]
=
[];
if
(
!
empty
(
$goodsSnapshot
[
"desc_pic_url"
]))
{
$ksyun
=
GoodsService
::
getUrlList
(
$goodsSnapshot
[
"desc_pic_url"
]);
$data
[
"desc_pic_url_list"
]
=
$ksyun
;
}
$data
[
"desc"
]
=
$goodsSnapshot
[
"desc"
];
$data
[
"original_price"
]
=
$goodsSnapshot
[
"original_price"
]
/
100
;
$data
[
"price"
]
=
$goodsSnapshot
[
"price"
]
/
100
;
return
$data
;
}
}
}
\ No newline at end of file
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