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
fe548a28
Commit
fe548a28
authored
Jul 27, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://gitlab.yidian-inc.com/bp/goods
into develop
parents
c7c297ff
254008a0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
ElasticGoodService.php
application/services/goods/ElasticGoodService.php
+14
-0
GoodsService.php
application/services/goods/GoodsService.php
+1
-1
cli.ini
conf/cli.ini
+2
-2
No files found.
application/services/goods/ElasticGoodService.php
View file @
fe548a28
...
...
@@ -3,6 +3,7 @@
namespace
App\Services\goods
;
use
Api\PhpUtils\Common\BaseConvert
;
use
Api\PhpUtils\Common\IP
;
use
Api\PhpUtils\Elastic\ElasticUtil
;
use
App\Models\goods\mysql\GoodsSku
;
...
...
@@ -15,6 +16,11 @@ class ElasticGoodService
const
SORT_TYPE_SALES
=
2
;
const
SORT_TYPE_PRICE
=
3
;
//添加生活号id,这里的生活号id发的商品,es查不出来
const
TEST_LIFE_ACCOUNT_ID
=
[];
//公司内网wifi ip
const
WIFI_IPS
=
[
'123.103.40.112'
,
'123.103.40.113'
,
'123.103.40.114'
,
'123.103.40.115'
,
'123.103.40.116'
,
'123.103.40.117'
];
public
static
function
createIndex
()
{
$elasticClient
=
ElasticUtil
::
getInstance
();
...
...
@@ -221,6 +227,7 @@ class ElasticGoodService
$searchContent
=
empty
(
$params
[
"search_content"
])
?
""
:
$params
[
"search_content"
];
$subjectName
=
empty
(
$params
[
"subject_name"
])
?
""
:
$params
[
"subject_name"
];
$lifeAccountId
=
empty
(
$params
[
"life_account_id"
])
?
""
:
$params
[
"life_account_id"
];
$ip
=
empty
(
$params
[
"ip"
])
?
""
:
$params
[
"ip"
];
$data
=
[
"from"
=>
(
$from
-
1
)
*
$size
,
...
...
@@ -231,6 +238,13 @@ class ElasticGoodService
[
"term"
=>
[
"audit_status"
=>
GoodsSku
::
STATUS_PASS
]],
[
"term"
=>
[
"online_status"
=>
GoodsSku
::
ONLINE_STATUS_ONLINE
]],
];
//线上环境,配置不允许发现的生活号发布的商品
$env
=
\Yaf\Application
::
app
()
->
environ
();
if
(
in_array
(
$env
,
[
'dev'
]))
{
if
(
!
empty
(
self
::
TEST_LIFE_ACCOUNT_ID
)
&&
!
in_array
(
$ip
,
self
::
WIFI_IPS
))
{
$data
[
"query"
][
"bool"
][
"must_not"
]
=
[
"terms"
=>
[
"life_account_id"
=>
self
::
TEST_LIFE_ACCOUNT_ID
]];
}
}
//gte 是大于等于; gt是大于; lte是小于等于; lt是小于
$data
[
"query"
][
"bool"
][
"filter"
][][
"range"
]
=
[
"inventory_rest"
=>
[[
"gt"
=>
0
]]];
//$data["query"]["bool"]["filter"][]["range"] = ["price" => [["gt" => 0]]];
...
...
application/services/goods/GoodsService.php
View file @
fe548a28
...
...
@@ -655,7 +655,7 @@ class GoodsService
"inventory_total"
=>
$skuData
[
"inventory_total"
]
+
$params
[
"inventory_add"
],
//"inventory_total" => $params["inventory"],
"inventory_rest"
=>
$inventoryCount
,
"original_price"
=>
$params
[
"original_price"
]
*
100
,
"original_price"
=>
empty
(
$params
[
"original_price"
])
?
0
:
$params
[
"original_price"
]
*
100
,
"price"
=>
$params
[
"price"
]
*
100
,
"goods_version"
=>
(
int
)
$skuData
[
"goods_version"
]
+
1
,
];
...
...
conf/cli.ini
View file @
fe548a28
...
...
@@ -2,8 +2,8 @@
application.directory
=
APPLICATION_PATH"/application"
application.library
=
APPLICATION_PATH"/application/library"
application.bootstrap
=
APPLICATION_PATH"/application/BootstrapCli.php"
application.dispatcher.catchException
=
tru
e
application.dispatcher.throwException
=
tru
e
application.dispatcher.catchException
=
fals
e
application.dispatcher.throwException
=
fals
e
daemon.script_dir
=
"
\\
Daemon
\\
"
appid
=
"goods"
...
...
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