瀏覽代碼

修复商品分类到es

luojianqun 1 年之前
父節點
當前提交
ab258da776
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      App/Crontab/ElasticSearchGoodsNewCrontab2.php

+ 4 - 6
App/Crontab/ElasticSearchGoodsNewCrontab2.php

@@ -87,13 +87,13 @@ class ElasticSearchGoodsNewCrontab2 implements JobInterface
         $new_goods = [];
         foreach ($goods as $k => $item) {
             $item['operators_id'] = $this->getOperatorsIdByGoodsId($item['id']);
-            $item['category'] = $this->getOperatorsCategory($item['id'], $item['pcate'], $item['ccate'], $item['tcate'], $item['operators_id']);
+            $item['category'] = $this->getOperatorsCategory($item['id'], $item['ccate'], $item['operators_id']);
             $new_goods[$k] = $item;
         }
         return $new_goods;
     }
 
-    function getOperatorsCategory($goods_id, $pcate, $ccate, $tcate, $operators_ids)
+    function getOperatorsCategory($goods_id, $ccate, $operators_ids)
     {
         $result = array();
         $queryBuild = new QueryBuilder();
@@ -107,17 +107,15 @@ class ElasticSearchGoodsNewCrontab2 implements JobInterface
                 $category_type = $res[0]['category_type'];
             }
             if ($category_type) { //自建分类
-                $sql = "select pcate,ccate,tcate from ims_superdesk_shop_operators_goods where goodsid = '{$goods_id}' and operators_id = '{$operators_id}' ";
+                $sql = "select ccate from ims_superdesk_shop_operators_goods where goodsid = '{$goods_id}' and operators_id = '{$operators_id}' ";
                 $queryBuild->raw($sql);
                 $res_data = DbManager::getInstance()->query($queryBuild, true, 'default')->toArray();
                 $res = $res_data['result'];
                 if ($res) {
-                    $pcate = $res[0]['pcate'];
                     $ccate = $res[0]['ccate'];
-                    $tcate = $res[0]['tcate'];
                 }
             }
-            $result[] = $operators_id.'_'.$category_type.'_'.$pcate.'-'.$ccate.'-'.$tcate;
+            $result[] = $operators_id.'_'.$category_type.'_'.$ccate;
         }
         return $result;
     }