Commit 05361991 authored by hj's avatar hj

更新提交

parent bcaa1a4f
......@@ -143,8 +143,14 @@ class CheMenuService
//分类
$productPageContent['categoryName'] = '';
if(preg_match('/<li>[\s\S]*Category:[\s\S]*?<a[\s\S]*?>(?<categoryName>[\s\S]*?)<\/a><\/li>/i', $responseHtml, $navBar)){
$productPageContent['categoryName'] = $navBar['categoryName'];
if(preg_match_all('/<li>[\s\S]*Category:[\s\S]*?(?<categoryList>[\s\S]*?)<\/li>/i', $responseHtml, $navBar)){
if(preg_match('/<a[\s\S]*?>(?<categoryName>[\s\S]*?)<\/a>/i', $navBar['categoryList'], $navCategorys)){
$categoryList = [];
foreach($navCategorys['categoryName'] as $categoryName){
$categoryList[] = $categoryName;
}
$productPageContent['categoryName'] = implode(',', $categoryList);
}
}
$productPageContent['image'] = '';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment