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
d2f7cf93
Commit
d2f7cf93
authored
Jun 29, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:处理空数据问题
parent
2bc3d8f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
GoodsService.php
application/services/goods/GoodsService.php
+7
-2
MarketingGoodsService.php
application/services/marketing/MarketingGoodsService.php
+11
-0
No files found.
application/services/goods/GoodsService.php
View file @
d2f7cf93
...
...
@@ -18,7 +18,9 @@ use App\Models\goods\mysql\GoodsSnapshot;
use
App\Models\goods\mysql\GoodsSpu
;
use
App\Models\goods\mysql\PaySuccessGoodsCallbackRecord
;
use
App\Models\goods\mysql\Shop
;
use
App\Models\marketing\mysql\MarketingGoods
;
use
App\Models\shop\mysql\SubShop
;
use
App\Services\marketing\MarketingGoodsService
;
use
App\Services\shop\ShopService
;
use
Api\PhpUtils\Http\Request
;
use
App\Exception\custom\InterfaceException
;
...
...
@@ -573,8 +575,8 @@ class GoodsService
"rule_limit"
=>
$params
[
"rule_limit"
],
"rule_desc"
=>
$params
[
"rule_desc"
],
"rule_refund"
=>
$params
[
"rule_refund"
],
"rule_start_time"
=>
$params
[
"rule_start_time"
],
"rule_end_time"
=>
$params
[
"rule_end_time"
],
"rule_start_time"
=>
empty
(
$params
[
"rule_start_time"
])
?
""
:
$params
[
"rule_start_time"
],
"rule_end_time"
=>
empty
(
$params
[
"rule_end_time"
])
?
""
:
$params
[
"rule_end_time"
],
"inventory_total"
=>
$skuData
[
"inventory_total"
]
+
$params
[
"inventory_add"
],
"inventory_rest"
=>
$inventoryCount
,
"original_price"
=>
$params
[
"original_price"
]
*
100
,
...
...
@@ -701,6 +703,9 @@ class GoodsService
$subShopList
=
SubShop
::
select
(
"*"
,
[
"sub_shop_id"
=>
$subShopIds
]);
$data
[
"goods_info"
][
"sub_shop"
]
=
$subShopList
;
}
// $marketingGoodsList = MarketingGoodsService::getRunningMarketing([$sku["goods_sku_id"]]);
// var_dump($marketingGoodsList);exit;
}
}
$recordList
=
GoodsOperationRecord
::
select
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
...
...
application/services/marketing/MarketingGoodsService.php
View file @
d2f7cf93
...
...
@@ -70,6 +70,17 @@ class MarketingGoodsService
$result
=
[
'result'
=>
$list
,
'last_id'
=>
$lastId
];
return
$result
;
}
public
static
function
getRunningMarketing
(
$goodsSkuIds
)
{
$goodsSkuIds
=
[
"awPYXhAUBJ4HCT6k"
,
"awPZqLl5KtXQZh6k"
];
$marketingIds
=
MarketingGoods
::
select
(
"marketing_id"
,
[
"goods_sku_id"
=>
$goodsSkuIds
]);
if
(
!
empty
(
$marketingIds
))
{
$now
=
date
(
"Y-m-d H:i:s"
);
$marketingList
=
Marketing
::
select
(
"*"
,
[
"start_time[<]"
=>
$now
,
"end_time[>]"
=>
$now
,
"marketing_id"
=>
$goodsSkuIds
]);
var_dump
(
$marketingList
);
exit
;
}
}
}
...
...
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