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
177a9ed6
Commit
177a9ed6
authored
Aug 30, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into colonel
parents
7171c691
7f213090
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
MarketingService.php
application/services/marketing/MarketingService.php
+27
-8
No files found.
application/services/marketing/MarketingService.php
View file @
177a9ed6
...
...
@@ -826,11 +826,16 @@ class MarketingService
}
}
$marketingGoods
=
[];
foreach
(
$skuInfoList
as
$key
=>
$skuInfo
)
{
$marketingGoods
[
$key
][
"goods_spu_id"
]
=
$skuInfo
[
"goods_spu_id"
];
$marketingGoods
[
$key
][
"goods_sku_id"
]
=
$skuInfo
[
"goods_sku_id"
];
$tempSkuInfoList
=
array_column
(
$skuInfoList
,
null
,
"goods_sku_id"
);
foreach
(
$goodsSkuId
as
$key
=>
$skuId
)
{
if
(
empty
(
$tempSkuInfoList
[
$skuId
][
"goods_spu_id"
]))
{
continue
;
}
$marketingGoods
[
$key
][
"goods_spu_id"
]
=
$tempSkuInfoList
[
$skuId
][
"goods_spu_id"
];
$marketingGoods
[
$key
][
"goods_sku_id"
]
=
$skuId
;
$marketingGoods
[
$key
][
"marketing_id"
]
=
$marketingId
;
}
MarketingGoods
::
save
(
$marketingGoods
);
//自提点
...
...
@@ -989,10 +994,9 @@ class MarketingService
$pindanMarketing
=
MarketingPindan
::
getRecord
([
'marketing_id'
=>
$params
[
'marketing_id'
]]);
$lifeAccountList
=
CommonService
::
getlifeAccountList
([
'life_account_id'
=>
[
$pindanMarketing
[
"publish_life_account_id"
]]]);
$goodsSkuList
=
MarketingGoods
::
marketingGoodsList
([
'marketing_id'
=>
$params
[
'marketing_id'
]]);
if
(
!
empty
(
$goodsSkuList
))
{
$goodsSkuId
=
array_column
(
$goodsSkuList
,
'goods_sku_id'
);
$marketingGoodsList
=
MarketingGoods
::
marketingGoodsList
([
'marketing_id'
=>
$params
[
'marketing_id'
],
"ORDER"
=>
[
"id"
=>
"ASC"
]]);
if
(
!
empty
(
$marketingGoodsList
))
{
$goodsSkuId
=
array_column
(
$marketingGoodsList
,
'goods_sku_id'
);
$goodsSkuList
=
PindanGoodsSku
::
select
(
'*'
,
[
'goods_sku_id'
=>
$goodsSkuId
]);
}
empty
(
$goodsSkuList
)
&&
$goodsSkuList
=
[];
...
...
@@ -1046,7 +1050,14 @@ class MarketingService
$otasData
[
$item
[
"ota_id"
]]
=
$item
;
}
foreach
(
$goodsSkuList
as
$key
=>
$item
)
{
//这里是为了排序,按查 marketing_goods 出来的顺序排序
$tempGoodsSkuList
=
array_column
(
$goodsSkuList
,
null
,
"goods_sku_id"
);
foreach
(
$marketingGoodsList
as
$key
=>
$value
)
{
if
(
empty
(
$tempGoodsSkuList
[
$value
[
"goods_sku_id"
]]))
{
continue
;
}
$item
=
$tempGoodsSkuList
[
$value
[
"goods_sku_id"
]];
$goodsSkuList
[
$key
]
=
$item
;
$goodsSkuList
[
$key
][
"desc_pic_url_list"
]
=
GoodsService
::
getUrlList
(
$item
[
"desc_pic_url"
]);
$goodsSkuList
[
$key
][
"ota_name"
]
=
empty
(
$otasData
[
$item
[
"ota_id"
]][
"ota_name"
])
?
""
:
$otasData
[
$item
[
"ota_id"
]][
"ota_name"
];
$goodsSkuList
[
$key
][
"original_price"
]
=
empty
(
$item
[
"original_price"
])
?
''
:
sprintf
(
"%.2f"
,
(
int
)
$item
[
"original_price"
]
/
100
);
...
...
@@ -1065,6 +1076,14 @@ class MarketingService
$goodsSkuList
[
$key
][
"all_have_buy_goods_count"
]
=
$allHaveBuyGoodsStatistics
[
$item
[
"goods_sku_id"
]];
}
}
foreach
(
$goodsSkuList
as
$key
=>
$item
)
{
if
(
$item
[
"inventory_rest"
]
==
0
)
{
unset
(
$goodsSkuList
[
$key
]);
array_push
(
$goodsSkuList
,
$item
);
}
}
$goodsSkuList
=
array_values
(
$goodsSkuList
);
}
$takePlaceIds
=
MarketingTakePlace
::
getRecords
([
"marketing_id"
=>
$marketingData
[
"id"
]],
[
"take_place_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