Commit 57640cde authored by luhongguang's avatar luhongguang

update:es查询

parent 3ce1e2e4
......@@ -152,6 +152,12 @@ class ElasticGoodService
if (!empty($res["hits"]["total"]["value"])) {
$result["count"] = $res["hits"]["total"]["value"];
foreach ($res["hits"]["hits"] as $key => $source) {
$result["list"][$key]["goods_desc_pic_url_list"] = [];
if (!empty($source["_source"]["goods_desc_pic_url"])) {
$ksyun = GoodsService::getUrlList($source["_source"]["goods_desc_pic_url"]);
$result["list"][$key]["goods_desc_pic_url_list"] = $ksyun;
}
$result["list"][$key]["goods_sku_id"] = $source["_source"]["goods_sku_id"];
$result["list"][$key]["goods_desc_pic_url"] = $source["_source"]["goods_desc_pic_url"];
$result["list"][$key]["goods_name"] = $source["_source"]["goods_name"];
......
......@@ -1085,12 +1085,15 @@ class GoodsService
* @param $picUrlStr
* @return array
*/
private static function getUrlList($picUrlStr)
public static function getUrlList($picUrlStr)
{
$data = $ksyunParams = [];
$strList = explode(",", $picUrlStr);
foreach ($strList as $str) {
$arr = explode("/", $str);
if (count($arr) != 2) {
continue;
}
$bucket = $arr[0];
$objectId = $arr[1];
......
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