update
This commit is contained in:
parent
aad0b377b1
commit
66c51f3343
@ -705,6 +705,18 @@ async def get_firstpage_product_tree(ns={}):
|
||||
key=lambda x: (priority.get(x['thrTitle'], 4), result.index(x))
|
||||
)
|
||||
data['product_service'][0]['secMenu'][0]['thrMenu'] = sorted_data
|
||||
|
||||
# 使用jsonpath 查找data下所有value下name包含'用'的对象
|
||||
if ns.get('keyword'):
|
||||
jsonpath_result = jsonpath.jsonpath(data, '$..value')
|
||||
data = []
|
||||
jsonpath_result = jsonpath_result if jsonpath_result else []
|
||||
for item in jsonpath_result:
|
||||
for sub_item in item:
|
||||
if ns['keyword'] in sub_item.get('name', ''):
|
||||
data.append(sub_item)
|
||||
|
||||
|
||||
return {
|
||||
'status': True,
|
||||
'msg': 'get product list success',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user