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
57f4317a
Commit
57f4317a
authored
Aug 30, 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
31f89439
de4f08b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
12 deletions
+37
-12
MarketingGoodsService.php
application/services/marketing/MarketingGoodsService.php
+10
-4
MarketingService.php
application/services/marketing/MarketingService.php
+27
-8
No files found.
application/services/marketing/MarketingGoodsService.php
View file @
57f4317a
...
@@ -81,8 +81,11 @@ class MarketingGoodsService
...
@@ -81,8 +81,11 @@ class MarketingGoodsService
$goodsSkuId
=
array_column
(
$data
,
'goods_sku_id'
);
$goodsSkuId
=
array_column
(
$data
,
'goods_sku_id'
);
}
}
$goodsSkuList
=
GoodsSku
::
getRecordMaster
([
'goods_sku_id'
=>
$goodsSkuId
]);
$goodsSkuList
=
[];
$goodsSkuList
=
!
empty
(
$goodsSkuList
)
?
array_column
(
$goodsSkuList
,
null
,
'goods_sku_id'
)
:
[];
if
(
!
empty
(
$goodsSkuId
))
{
$goodsSkuList
=
GoodsSku
::
getRecordMaster
([
'goods_sku_id'
=>
$goodsSkuId
]);
$goodsSkuList
=
!
empty
(
$goodsSkuList
)
?
array_column
(
$goodsSkuList
,
null
,
'goods_sku_id'
)
:
[];
}
$lastData
=
end
(
$data
);
$lastData
=
end
(
$data
);
$lastId
=
!
empty
(
$lastData
[
'id'
])
?
$lastData
[
'id'
]
:
''
;
$lastId
=
!
empty
(
$lastData
[
'id'
])
?
$lastData
[
'id'
]
:
''
;
...
@@ -91,8 +94,11 @@ class MarketingGoodsService
...
@@ -91,8 +94,11 @@ class MarketingGoodsService
$shopId
[
$key
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'shop_id'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'shop_id'
]
:
''
;
$shopId
[
$key
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'shop_id'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'shop_id'
]
:
''
;
}
}
$subShopList
=
SubShop
::
getRecordMaster
([
'shop_id'
=>
$shopId
]);
$subShopList
=
[];
$subShopList
=
!
empty
(
$subShopList
)
?
array_column
(
$subShopList
,
null
,
'shop_id'
)
:
[];
if
(
!
empty
(
$shopId
))
{
$subShopList
=
SubShop
::
getRecordMaster
([
'shop_id'
=>
$shopId
]);
$subShopList
=
!
empty
(
$subShopList
)
?
array_column
(
$subShopList
,
null
,
'shop_id'
)
:
[];
}
$marketingList
=
!
empty
(
$marketingList
)
?
array_column
(
$marketingList
,
null
,
'marketing_id'
)
:
[];
$marketingList
=
!
empty
(
$marketingList
)
?
array_column
(
$marketingList
,
null
,
'marketing_id'
)
:
[];
...
...
application/services/marketing/MarketingService.php
View file @
57f4317a
...
@@ -826,11 +826,16 @@ class MarketingService
...
@@ -826,11 +826,16 @@ class MarketingService
}
}
}
}
$marketingGoods
=
[];
$marketingGoods
=
[];
foreach
(
$skuInfoList
as
$key
=>
$skuInfo
)
{
$tempSkuInfoList
=
array_column
(
$skuInfoList
,
null
,
"goods_sku_id"
);
$marketingGoods
[
$key
][
"goods_spu_id"
]
=
$skuInfo
[
"goods_spu_id"
];
foreach
(
$goodsSkuId
as
$key
=>
$skuId
)
{
$marketingGoods
[
$key
][
"goods_sku_id"
]
=
$skuInfo
[
"goods_sku_id"
];
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
[
$key
][
"marketing_id"
]
=
$marketingId
;
}
}
MarketingGoods
::
save
(
$marketingGoods
);
MarketingGoods
::
save
(
$marketingGoods
);
//自提点
//自提点
...
@@ -989,10 +994,9 @@ class MarketingService
...
@@ -989,10 +994,9 @@ class MarketingService
$pindanMarketing
=
MarketingPindan
::
getRecord
([
'marketing_id'
=>
$params
[
'marketing_id'
]]);
$pindanMarketing
=
MarketingPindan
::
getRecord
([
'marketing_id'
=>
$params
[
'marketing_id'
]]);
$lifeAccountList
=
CommonService
::
getlifeAccountList
([
'life_account_id'
=>
[
$pindanMarketing
[
"publish_life_account_id"
]]]);
$lifeAccountList
=
CommonService
::
getlifeAccountList
([
'life_account_id'
=>
[
$pindanMarketing
[
"publish_life_account_id"
]]]);
$goodsSkuList
=
MarketingGoods
::
marketingGoodsList
([
'marketing_id'
=>
$params
[
'marketing_id'
]]);
$marketingGoodsList
=
MarketingGoods
::
marketingGoodsList
([
'marketing_id'
=>
$params
[
'marketing_id'
],
"ORDER"
=>
[
"id"
=>
"ASC"
]]);
if
(
!
empty
(
$marketingGoodsList
))
{
if
(
!
empty
(
$goodsSkuList
))
{
$goodsSkuId
=
array_column
(
$marketingGoodsList
,
'goods_sku_id'
);
$goodsSkuId
=
array_column
(
$goodsSkuList
,
'goods_sku_id'
);
$goodsSkuList
=
PindanGoodsSku
::
select
(
'*'
,
[
'goods_sku_id'
=>
$goodsSkuId
]);
$goodsSkuList
=
PindanGoodsSku
::
select
(
'*'
,
[
'goods_sku_id'
=>
$goodsSkuId
]);
}
}
empty
(
$goodsSkuList
)
&&
$goodsSkuList
=
[];
empty
(
$goodsSkuList
)
&&
$goodsSkuList
=
[];
...
@@ -1046,7 +1050,14 @@ class MarketingService
...
@@ -1046,7 +1050,14 @@ class MarketingService
$otasData
[
$item
[
"ota_id"
]]
=
$item
;
$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
][
"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
][
"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
);
$goodsSkuList
[
$key
][
"original_price"
]
=
empty
(
$item
[
"original_price"
])
?
''
:
sprintf
(
"%.2f"
,
(
int
)
$item
[
"original_price"
]
/
100
);
...
@@ -1065,6 +1076,14 @@ class MarketingService
...
@@ -1065,6 +1076,14 @@ class MarketingService
$goodsSkuList
[
$key
][
"all_have_buy_goods_count"
]
=
$allHaveBuyGoodsStatistics
[
$item
[
"goods_sku_id"
]];
$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"
]);
$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