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
9f9f48ab
Commit
9f9f48ab
authored
Sep 01, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'colonel' of
https://git.yidian-inc.com:8021/bp/goods
into colonel
parents
30bf371e
d789e29e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
57 deletions
+0
-57
MarketingService.php
application/services/marketing/MarketingService.php
+0
-57
No files found.
application/services/marketing/MarketingService.php
View file @
9f9f48ab
...
@@ -1138,63 +1138,6 @@ class MarketingService
...
@@ -1138,63 +1138,6 @@ class MarketingService
return
$marketing_list
;
return
$marketing_list
;
}
}
public
static
function
tuancanList
(
$params
)
{
}
/**
* 获取多个活动的商品列表
* @param $marketingIds
* @return array
* @throws InterfaceException
*/
public
static
function
getGoodsSkuListByMarketingIds
(
$marketingIds
)
{
$marketingGoodsList
=
MarketingGoods
::
marketingGoodsList
([
'marketing_id'
=>
$marketingIds
,
"ORDER"
=>
[
"id"
=>
"ASC"
]]);
$goodsSkuList
=
[];
if
(
!
empty
(
$marketingGoodsList
))
{
$goodsSkuId
=
array_column
(
$marketingGoodsList
,
'goods_sku_id'
);
$goodsSkuList
=
PindanGoodsSku
::
select
(
'*'
,
[
'goods_sku_id'
=>
$goodsSkuId
]);
$goodsSkuList
=
array_column
((
array
)
$goodsSkuList
,
null
,
"goods_sku_id"
);
}
$list
=
[];
if
(
!
empty
(
$goodsSkuList
))
{
//活动sku购买数量
$soldNum
=
self
::
getHaveBuyGoodsStatistics
([
"marketing_id"
=>
$marketingIds
]);
//保持排序
foreach
(
$marketingGoodsList
as
$key
=>
$value
)
{
if
(
empty
(
$goodsSkuList
[
$value
[
"goods_sku_id"
]]))
{
continue
;
}
$list
[
$value
[
'marketing_id'
]][
$key
]
=
$value
;
$item
=
$goodsSkuList
[
$value
[
"goods_sku_id"
]];
$list
[
$value
[
'marketing_id'
]][
$key
][
'goods_name'
]
=
$item
[
'goods_name'
];
$list
[
$value
[
'marketing_id'
]][
$key
][
"desc_pic_url_list"
]
=
GoodsService
::
getUrlList
(
$item
[
"desc_pic_url"
]);
$list
[
$value
[
'marketing_id'
]][
$key
][
"original_price"
]
=
empty
(
$item
[
"original_price"
])
?
''
:
sprintf
(
"%.2f"
,
(
int
)
$item
[
"original_price"
]
/
100
);
$list
[
$value
[
'marketing_id'
]][
$key
][
"price"
]
=
sprintf
(
"%.2f"
,
$item
[
"price"
]
/
100
);
$list
[
$value
[
'marketing_id'
]][
$key
][
"all_have_buy_goods_count"
]
=
$soldNum
[
$value
[
"goods_sku_id"
]]
??
0
;
$list
[
$value
[
'marketing_id'
]][
$key
][
'inventory_rest'
]
=
$item
[
'inventory_rest'
];
}
//没有库存的放在最下面
foreach
(
$list
as
$marketingId
=>
$item
)
{
foreach
(
$item
as
$key
=>
$value
)
{
if
(
$value
[
"inventory_rest"
]
==
0
)
{
unset
(
$list
[
$marketingId
][
$key
]);
array_push
(
$list
[
$marketingId
],
$value
);
}
}
$list
[
$marketingId
]
=
array_values
(
$list
[
$marketingId
]);
}
}
return
$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