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
3a12a297
Commit
3a12a297
authored
Jul 21, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test'
parents
1b9dd0d7
4fad3f94
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
63 deletions
+133
-63
GoodsException.php
application/exception/custom/GoodsException.php
+2
-0
ElasticGoodService.php
application/services/goods/ElasticGoodService.php
+1
-1
DistributorService.php
application/services/marketing/DistributorService.php
+4
-0
MarketingGoodsService.php
application/services/marketing/MarketingGoodsService.php
+4
-2
TccService.php
application/services/tcc/TccService.php
+103
-60
Goods.php
daemon/Goods.php
+19
-0
No files found.
application/exception/custom/GoodsException.php
View file @
3a12a297
...
...
@@ -42,5 +42,7 @@ class GoodsException extends BaseException
28
=>
'上架状态不能编辑,需先下架,再做编辑操作'
,
29
=>
'发布商品的生活号不存在'
,
30
=>
'当前商品已过期'
,
31
=>
'当前商品锁定库存不足'
,
32
=>
'当前商品已下单数量不足'
,
];
}
\ No newline at end of file
application/services/goods/ElasticGoodService.php
View file @
3a12a297
...
...
@@ -233,7 +233,7 @@ class ElasticGoodService
];
//gte 是大于等于; gt是大于; lte是小于等于; lt是小于
$data
[
"query"
][
"bool"
][
"filter"
][][
"range"
]
=
[
"inventory_rest"
=>
[[
"gt"
=>
0
]]];
$data
[
"query"
][
"bool"
][
"filter"
][][
"range"
]
=
[
"price"
=>
[[
"gt"
=>
0
]]];
if
(
!
empty
(
$searchContent
)
||
(
!
empty
(
$subjectName
)
&&
$subjectName
!=
"本周上新"
))
{
$multiMatch
=
[[
"multi_match"
=>
[
"query"
=>
$searchContent
.
$subjectName
,
...
...
application/services/marketing/DistributorService.php
View file @
3a12a297
...
...
@@ -108,6 +108,10 @@ class DistributorService
$userId
=
$shareUserId
;
}
if
(
!
empty
(
$userId
))
{
throw
new
DistributorException
([
'cus'
=>
14
]);
}
if
(
!
empty
(
$info
))
{
throw
new
DistributorException
([
'cus'
=>
2
]);
}
...
...
application/services/marketing/MarketingGoodsService.php
View file @
3a12a297
...
...
@@ -109,6 +109,8 @@ class MarketingGoodsService
}
else
{
$list
[
$i
][
'is_self_publish'
]
=
1
;
}
//允许自己买自己的
$list
[
$i
][
'is_self_publish'
]
=
1
;
$life_account_id
=
!
empty
(
$list
[
$i
][
'life_account_id'
])
?
$list
[
$i
][
'life_account_id'
]
:
''
;
...
...
@@ -135,12 +137,12 @@ class MarketingGoodsService
//比例
if
(
!
empty
(
$secondCommission
)
&&
$commissionMode
==
1
)
{
$price
=
!
empty
(
$list
[
$i
][
'price'
])
?
$list
[
$i
][
'price'
]
:
0
;
$list
[
$i
][
'share_price'
]
=
sprintf
(
"%.2f"
,
$secondCommission
*
$price
/
100
);
$list
[
$i
][
'share_price'
]
=
substr
(
sprintf
(
"%.4f"
,
$secondCommission
*
$price
/
100
),
0
,
-
2
);
}
//固定
if
(
!
empty
(
$commissionMode
)
&&
$commissionMode
==
2
)
{
$list
[
$i
][
'share_price'
]
=
sprintf
(
"%.2f"
,
$secondCommission
/
100
);
$list
[
$i
][
'share_price'
]
=
substr
(
sprintf
(
"%.4f"
,
$secondCommission
/
100
),
0
,
-
2
);
}
$content
=
$userId
.
'_'
.
$value
[
'marketing_id'
];
...
...
application/services/tcc/TccService.php
View file @
3a12a297
This diff is collapsed.
Click to expand it.
daemon/Goods.php
View file @
3a12a297
...
...
@@ -28,4 +28,23 @@ class Goods implements DaemonServiceInterface
GoodsSku
::
save
(
$colums
,
$where
);
}
}
public
function
stock
()
{
$orderData
=
[
'inventory_rest'
=>
0
,
'LIMIT'
=>
100
,
];
$goodsList
=
GoodsSku
::
getRecords
(
$orderData
);
DaemonLog
::
info
(
'DaemonServiceInterface_goods'
,
json_encode
(
$goodsList
));
foreach
(
$goodsList
as
$key
=>
$value
)
{
$where
=
[];
$where
[
'goods_sku_id'
]
=
!
empty
(
$value
[
'goods_sku_id'
])
?
$value
[
'goods_sku_id'
]
:
''
;
$colums
=
[
'online_status'
=>
2
,
];
GoodsSku
::
save
(
$colums
,
$where
);
}
}
}
\ 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