From 81280a09ba56d25ce8506e8f2d446e6204979cf0 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Thu, 5 Sep 2024 09:49:17 +0700 Subject: import product --- import_product_product.ktr | 4 ++-- import_product_product_one_time.ktr | 4 ++-- run_single_ktr.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/import_product_product.ktr b/import_product_product.ktr index afdc987..4df6ed6 100644 --- a/import_product_product.ktr +++ b/import_product_product.ktr @@ -559,7 +559,7 @@ select pp.id as product_id, pt.id as template_id, pt.name, pp.active::boolean, pt.x_manufacture as brand_id, case when pp.default_code is null then pt.default_code else pp.default_code end as item_code, ( - select name from product_public_category ppc where id in((select replace(left(parent_path, 2), '/', '')::int from product_public_category + select name from product_public_category ppc where id in((select replace(left(parent_path, 5), '/', '')::int from product_public_category where id in(select ppcptr.product_public_category_id from product_public_category_product_template_rel ppcptr where ppcptr.product_template_id = pt.id limit 1))) ) as parent_category, @@ -567,7 +567,7 @@ case when pp.default_code is null then pt.default_code else pp.default_code end pt.website_description as description, pt.weight, ( - select ppc.id from product_public_category ppc where id in((select replace(left(parent_path, 2), '/', '')::int from product_public_category + select ppc.id from product_public_category ppc where id in((select replace(left(parent_path, 5), '/', '')::int from product_public_category where id in(select ppcptr.product_public_category_id from product_public_category_product_template_rel ppcptr where ppcptr.product_template_id = pt.id limit 1))) ) as parent_category_id diff --git a/import_product_product_one_time.ktr b/import_product_product_one_time.ktr index d2839bb..c928de1 100644 --- a/import_product_product_one_time.ktr +++ b/import_product_product_one_time.ktr @@ -560,7 +560,7 @@ select pp.id as product_id, pt.id as template_id, pt.name, pp.active::boolean, pt.x_manufacture as brand_id, case when pp.default_code is null then pt.default_code else pp.default_code end as item_code, ( - select name from product_public_category ppc where id in((select replace(left(parent_path, 2), '/', '')::int from product_public_category + select name from product_public_category ppc where id in((select replace(left(parent_path, 5), '/', '')::int from product_public_category where id in(select ppcptr.product_public_category_id from product_public_category_product_template_rel ppcptr where ppcptr.product_template_id = pt.id limit 1))) ) as parent_category, @@ -568,7 +568,7 @@ case when pp.default_code is null then pt.default_code else pp.default_code end pt.website_description as description, pt.weight, ( - select ppc.id from product_public_category ppc where id in((select replace(left(parent_path, 2), '/', '')::int from product_public_category + select ppc.id from product_public_category ppc where id in((select replace(left(parent_path, 5), '/', '')::int from product_public_category where id in(select ppcptr.product_public_category_id from product_public_category_product_template_rel ppcptr where ppcptr.product_template_id = pt.id limit 1))) ) as parent_category_id diff --git a/run_single_ktr.sh b/run_single_ktr.sh index ef15b12..a30d397 100644 --- a/run_single_ktr.sh +++ b/run_single_ktr.sh @@ -1 +1 @@ -sh /home/stephan/data-integration/pan.sh -level="Debug" -file="/home/stephan/transformation-job-bi/update_winner_purchase_pricelist.ktr" > "/home/stephan/transformation-job-bi/log/run_single_ktr.log" +sh /home/stephan/data-integration/pan.sh -level="Debug" -file="/home/stephan/transformation-job-bi/import_product_product_one_time.ktr" > "/home/stephan/transformation-job-bi/log/run_single_ktr.log" -- cgit v1.2.3