Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigdata
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
bigdata
Commits
6ed8fb08
Commit
6ed8fb08
authored
May 17, 2022
by
桂秋月
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6960865b
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
160 additions
and
72 deletions
+160
-72
publicSql.cpython-37.pyc
recommend/__pycache__/publicSql.cpython-37.pyc
+0
-0
searchTopic.cpython-37.pyc
recommend/__pycache__/searchTopic.cpython-37.pyc
+0
-0
cid3brandname_group_recommend.py
recommend/cid3brandname_group_recommend.py
+130
-69
payTopic.py
recommend/payTopic.py
+1
-1
publicFunc.py
recommend/publicFunc.py
+18
-0
publicSql.py
recommend/publicSql.py
+6
-0
searchTopic.py
recommend/searchTopic.py
+3
-0
changeLXQpassword.py
tools/changeLXQpassword.py
+2
-2
No files found.
recommend/__pycache__/publicSql.cpython-37.pyc
View file @
6ed8fb08
No preview for this file type
recommend/__pycache__/searchTopic.cpython-37.pyc
0 → 100644
View file @
6ed8fb08
File added
recommend/cid3brandname_group_recommend.py
View file @
6ed8fb08
This diff is collapsed.
Click to expand it.
recommend/payTopic.py
View file @
6ed8fb08
...
@@ -53,7 +53,7 @@ def payRecall(skuno,num=100):
...
@@ -53,7 +53,7 @@ def payRecall(skuno,num=100):
chaji
=
subtraction
(
subtraction
(
final_skus
,
temp
.
get
(
'70011'
)),
temp
.
get
(
'70012'
))
chaji
=
subtraction
(
subtraction
(
final_skus
,
temp
.
get
(
'70011'
)),
temp
.
get
(
'70012'
))
temp
[
'70013'
]
=
chaji
temp
[
'70013'
]
=
chaji
print
(
"加购图关联表召回stop"
)
print
(
"加购图关联表召回stop"
)
return
temp
#
return temp
print
(
"ALS相关表召回start"
,
'**'
*
50
)
print
(
"ALS相关表召回start"
,
'**'
*
50
)
als_correlation_change_redis
=
als_correlation_redis
.
format
(
sku_no
=
skuno
)
.
strip
()
als_correlation_change_redis
=
als_correlation_redis
.
format
(
sku_no
=
skuno
)
.
strip
()
...
...
recommend/publicFunc.py
View file @
6ed8fb08
...
@@ -39,6 +39,24 @@ def minPriceFill(skus,num=100):
...
@@ -39,6 +39,24 @@ def minPriceFill(skus,num=100):
return
temp
[:
num
]
return
temp
[:
num
]
def
execCondition
(
df
,
condition
,
needcolums
,
orderby
=
None
):
'''
:param df: dataframe格式
:param condition: 字符串,筛选条件
:param needcolums: 字符串,需要从df拿到的字段
:param orderby: 默认dict格式,如果为空,则不排序。
{'ordercolums':XX,'type':XX}.ordercolums表示按照某个字段排序,type表示正排还是倒排
:return: 条件筛选后并返回数据
'''
if
orderby
:
col
=
orderby
.
get
(
'ordercolums'
)
isasc
=
orderby
.
get
(
'type'
)
or
1
return
df
[
eval
(
condition
)]
.
sort_values
(
by
=
[
col
],
ascending
=
isasc
)[
needcolums
]
.
to_list
()
else
:
return
df
[
eval
(
condition
)][
needcolums
]
.
to_list
()
def
skuinfo
(
sku
):
def
skuinfo
(
sku
):
change_sql
=
concatSql
(
skuinfo_sql
,
**
{
"sku_no"
:
sku
})
change_sql
=
concatSql
(
skuinfo_sql
,
**
{
"sku_no"
:
sku
})
sku_df
=
execmysl
(
119
,
change_sql
)
sku_df
=
execmysl
(
119
,
change_sql
)
...
...
recommend/publicSql.py
View file @
6ed8fb08
...
@@ -3,6 +3,12 @@ dapan_sql='''
...
@@ -3,6 +3,12 @@ dapan_sql='''
select id,sku_no,price,cid1,cid2,cid3,brand_name,brand_id from
select id,sku_no,price,cid1,cid2,cid3,brand_name,brand_id from
offline_recommend.recommend_same_product
offline_recommend.recommend_same_product
'''
'''
##根据cid3获取cid2,cid1等数据
cid1_3_sql
=
"""
select distinct c_id1,c_id2,c_id3 from kdsp.t_sku_info
"""
##商品表
##商品表
skuinfo_sql
=
'''
skuinfo_sql
=
'''
select id,sku_no,sku_name,price,cid1,cid2,cid3,brand_name,brand_id,source_type from
select id,sku_no,sku_name,price,cid1,cid2,cid3,brand_name,brand_id,source_type from
...
...
recommend/searchTopic.py
View file @
6ed8fb08
...
@@ -21,9 +21,12 @@ def getseed(top10_sku):
...
@@ -21,9 +21,12 @@ def getseed(top10_sku):
print
(
sql
)
print
(
sql
)
df
=
execmysl
(
119
,
sql
)
df
=
execmysl
(
119
,
sql
)
df
[
'cid3'
]
=
df
[
'cid3'
]
.
astype
(
'string'
)
df
[
'cid3'
]
=
df
[
'cid3'
]
.
astype
(
'string'
)
df
[
'brand_id'
]
=
df
[
'brand_id'
]
.
astype
(
'string'
)
cid3
=
df
.
groupby
(
by
=
[
'cid3'
])
.
groups
.
__repr__
()
#['cid3']#.max()
cid3
=
df
.
groupby
(
by
=
[
'cid3'
])
.
groups
.
__repr__
()
#['cid3']#.max()
brandname
=
df
.
groupby
(
by
=
[
'brand_name'
])
.
groups
.
__repr__
()
brandname
=
df
.
groupby
(
by
=
[
'brand_name'
])
.
groups
.
__repr__
()
brandid
=
df
.
groupby
(
by
=
[
'brand_id'
])
.
groups
.
__repr__
()
brandid
=
df
.
groupby
(
by
=
[
'brand_id'
])
.
groups
.
__repr__
()
# print('--',brandid,type(brandid))
# print('--',brandname,type(brandid))
result
[
'cid3'
]
=
maxdict
(
**
json
.
loads
(
cid3
.
replace
(
"'"
,
'"'
)))
result
[
'cid3'
]
=
maxdict
(
**
json
.
loads
(
cid3
.
replace
(
"'"
,
'"'
)))
result
[
'brand_name'
]
=
maxdict
(
**
json
.
loads
(
brandname
.
replace
(
"'"
,
'"'
)))
result
[
'brand_name'
]
=
maxdict
(
**
json
.
loads
(
brandname
.
replace
(
"'"
,
'"'
)))
result
[
'brand_id'
]
=
maxdict
(
**
json
.
loads
(
brandid
.
replace
(
"'"
,
'"'
)))
result
[
'brand_id'
]
=
maxdict
(
**
json
.
loads
(
brandid
.
replace
(
"'"
,
'"'
)))
...
...
tools/changeLXQpassword.py
View file @
6ed8fb08
...
@@ -14,7 +14,7 @@ def modifyPasseord(name,namespace):
...
@@ -14,7 +14,7 @@ def modifyPasseord(name,namespace):
salt_df
=
pd
.
read_sql
(
get_salt
,
con
=
conn_db_11
)
salt_df
=
pd
.
read_sql
(
get_salt
,
con
=
conn_db_11
)
temp
=
salt_df
.
to_dict
(
orient
=
'records'
)
temp
=
salt_df
.
to_dict
(
orient
=
'records'
)
if
not
temp
:
if
not
temp
:
print
(
'[
name
] is not exist'
.
format
(
name
=
name
))
print
(
'[
{name}
] is not exist'
.
format
(
name
=
name
))
return
0
return
0
salt
=
temp
[
0
][
'salt'
]
.
encode
()
salt
=
temp
[
0
][
'salt'
]
.
encode
()
#salt=b'UwKESe3cvf703Z30' #t_sys_user.salt
#salt=b'UwKESe3cvf703Z30' #t_sys_user.salt
...
@@ -28,4 +28,4 @@ def modifyPasseord(name,namespace):
...
@@ -28,4 +28,4 @@ def modifyPasseord(name,namespace):
print
(
"this is update"
)
print
(
"this is update"
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
modifyPasseord
(
'haiyuan.wen'
,
'qa'
)
modifyPasseord
(
'dong.chao'
,
'qa'
)
\ No newline at end of file
\ 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