Для просмотра ссылки Войди или Зарегистрируйся в settings.ini
Вопрос по webservices.php .. кто курил? хочу местных (мск) подключить ..?!
Друг мой я прекрасно знаю о файле settings.ini и о том что в нем можно вкл./откл. бренды, разговор идет о добавлении/удалении даже не марки авто, а конкретной модели авто.
Далее кому интересно -
Использование в авто-выборочно:
SElect m.MOD_MFA_ID from LINK_ART la inner join LINK_LA_TYP llt on la.LA_ID=llt.LAT_LA_ID
inner join TYPES t on llt.LAT_TYP_ID=t.TYP_ID inner join MODELS m on t.TYP_MOD_ID=m.MOD_ID
inner join ARTICLES a on la.LA_ART_ID=a.ART_ID
where a.ART_ARTICLE_NR='CT637' and m.MOD_MFA_ID in (504)
Поиск аналогов + бренд
SELECT DISTINCT
IF (ART_LOOKUP2.ARL_KIND = 3, BRANDS2.BRA_BRAND, SUPPLIERS2.SUP_BRAND) AS BRAND,
IF (ART_LOOKUP2.ARL_KIND IN (2, 3), ART_LOOKUP2.ARL_DISPLAY_NR, ARTICLES2.ART_ARTICLE_NR) AS NUMBER,
ART_LOOKUP2.ARL_KIND
FROM ART_LOOKUP
LEFT JOIN BRANDS ON BRANDS.BRA_ID = ART_LOOKUP.ARL_BRA_ID
INNER JOIN ARTICLES ON ARTICLES.ART_ID = ART_LOOKUP.ARL_ART_ID
INNER JOIN SUPPLIERS ON SUPPLIERS.SUP_ID = ARTICLES.ART_SUP_ID
INNER JOIN ART_LOOKUP AS ART_LOOKUP2 FORCE KEY (PRIMARY) ON ART_LOOKUP2.ARL_ART_ID = ART_LOOKUP.ARL_ART_ID
LEFT JOIN BRANDS AS BRANDS2 ON BRANDS2.BRA_ID = ART_LOOKUP2.ARL_BRA_ID
INNER JOIN ARTICLES AS ARTICLES2 ON ARTICLES2.ART_ID = ART_LOOKUP2.ARL_ART_ID
INNER JOIN SUPPLIERS AS SUPPLIERS2 FORCE KEY (PRIMARY) ON SUPPLIERS2.SUP_ID = ARTICLES2.ART_SUP_ID
INNER JOIN LINK_ART ON LA_ART_ID=ARTICLES.ART_ID
INNER JOIN LINK_LA_TYP ON LA_ID = LAT_LA_ID
INNER JOIN TYPES ON TYP_ID = LAT_TYP_ID
inner join MODELS on TYP_MOD_ID=MOD_ID and MOD_MFA_ID in (525, 561)
WHERE
ART_LOOKUP.ARL_SEARCH_NUMBER = 'OC232'
ORDER BY BRAND, NUMBER;
Поиск детали:
SELECT ART_ID, ART_ARTICLE_NR, SUP_BRAND, DES_TEXTS.TEX_TEXT AS STR_DES_TEXT, DES_TEXTS2.TEX_TEXT AS ART_COMPLETE_DES_TEXT,
MOD_MFA_ID , TYP_ID
FROM LINK_GA_STR
INNER JOIN LINK_LA_TYP ON LAT_GA_ID = LGS_GA_ID
INNER JOIN TYPES ON TYP_ID = LAT_TYP_ID
inner join MODELS on TYP_MOD_ID=MOD_ID and MOD_MFA_ID in (502)
INNER JOIN LINK_ART ON LA_ID = LAT_LA_ID
INNER JOIN SEARCH_TREE ON STR_ID = LGS_STR_ID
INNER JOIN DESIGNATIONS ON DESIGNATIONS.DES_ID = STR_DES_ID AND DESIGNATIONS.DES_LNG_ID = 16
INNER JOIN DES_TEXTS ON DES_TEXTS.TEX_ID = DESIGNATIONS.DES_TEX_ID
INNER JOIN ARTICLES ON ART_ID = LA_ART_ID
INNER JOIN SUPPLIERS ON SUP_ID = ART_SUP_ID
INNER JOIN DESIGNATIONS AS DESIGNATIONS2 ON DESIGNATIONS2.DES_ID = ART_COMPLETE_DES_ID
INNER JOIN DES_TEXTS AS DES_TEXTS2 ON DES_TEXTS2.TEX_ID = DESIGNATIONS2.DES_TEX_ID AND DESIGNATIONS2.DES_LNG_ID = 16
WHERE DES_TEXTS.TEX_TEXT LIKE '%тормозной%диск%'
Поиск изделия по номеру + бренд
SELECT DISTINCT
IF (ART_LOOKUP.ARL_KIND IN (3, 4), BRANDS.BRA_BRAND, SUPPLIERS.SUP_BRAND) AS BRAND,
ART_LOOKUP.ARL_SEARCH_NUMBER AS NUMBER,
ART_LOOKUP.ARL_KIND,
ART_LOOKUP.ARL_ART_ID,
DES_TEXTS.TEX_TEXT AS ART_COMPLETE_DES_TEXT, MOD_MFA_ID , TYP_ID
FROM ART_LOOKUP
LEFT JOIN BRANDS ON BRANDS.BRA_ID = ART_LOOKUP.ARL_BRA_ID
INNER JOIN ARTICLES ON ARTICLES.ART_ID = ART_LOOKUP.ARL_ART_ID
INNER JOIN SUPPLIERS ON SUPPLIERS.SUP_ID = ARTICLES.ART_SUP_ID
INNER JOIN DESIGNATIONS ON DESIGNATIONS.DES_ID = ARTICLES.ART_COMPLETE_DES_ID
INNER JOIN DES_TEXTS ON DES_TEXTS.TEX_ID = DESIGNATIONS.DES_TEX_ID
INNER JOIN LINK_ART ON LA_ART_ID=ART_ID
INNER JOIN LINK_LA_TYP ON LA_ID = LAT_LA_ID
INNER JOIN TYPES ON TYP_ID = LAT_TYP_ID
inner join MODELS on TYP_MOD_ID=MOD_ID
WHERE
ART_LOOKUP.ARL_SEARCH_NUMBER = 'OC232' AND
ART_LOOKUP.ARL_KIND IN (1, 2, 3, 4) AND
DESIGNATIONS.DES_LNG_ID = 16
GROUP BY BRAND, NUMBER
Поиск изделия по номеру
SELECT DISTINCT
IF (ART_LOOKUP.ARL_KIND IN (3, 4), BRANDS.BRA_BRAND, SUPPLIERS.SUP_BRAND) AS BRAND,
ART_LOOKUP.ARL_SEARCH_NUMBER AS NUMBER,
ART_LOOKUP.ARL_KIND,
ART_LOOKUP.ARL_ART_ID,
DES_TEXTS.TEX_TEXT AS ART_COMPLETE_DES_TEXT
FROM ART_LOOKUP
LEFT JOIN BRANDS ON BRANDS.BRA_ID = ART_LOOKUP.ARL_BRA_ID
INNER JOIN ARTICLES ON ARTICLES.ART_ID = ART_LOOKUP.ARL_ART_ID
INNER JOIN SUPPLIERS ON SUPPLIERS.SUP_ID = ARTICLES.ART_SUP_ID
INNER JOIN DESIGNATIONS ON DESIGNATIONS.DES_ID = ARTICLES.ART_COMPLETE_DES_ID
INNER JOIN DES_TEXTS ON DES_TEXTS.TEX_ID = DESIGNATIONS.DES_TEX_ID
WHERE
ART_LOOKUP.ARL_SEARCH_NUMBER = 'OC232' AND
ART_LOOKUP.ARL_KIND IN (1, 2, 3, 4) AND
DESIGNATIONS.DES_LNG_ID = 16
GROUP BY BRAND, NUMBER
Поиск неоригинальных изделий из категории с заданным текстом в названии, подходящих для заданного автомобиля (TYP_ID)
SELECT ART_ID, ART_ARTICLE_NR, SUP_BRAND, DES_TEXTS.TEX_TEXT AS STR_DES_TEXT, DES_TEXTS2.TEX_TEXT AS ART_COMPLETE_DES_TEXT,
MOD_MFA_ID, TYP_ID
FROM LINK_GA_STR
INNER JOIN LINK_LA_TYP ON LAT_TYP_ID = 3822 AND LAT_GA_ID = LGS_GA_ID
INNER JOIN TYPES ON TYP_ID = LAT_TYP_ID
inner join MODELS on TYP_MOD_ID=MOD_ID
INNER JOIN LINK_ART ON LA_ID = LAT_LA_ID
INNER JOIN SEARCH_TREE ON STR_ID = LGS_STR_ID
INNER JOIN DESIGNATIONS ON DESIGNATIONS.DES_ID = STR_DES_ID AND DESIGNATIONS.DES_LNG_ID = 16
INNER JOIN DES_TEXTS ON DES_TEXTS.TEX_ID = DESIGNATIONS.DES_TEX_ID
INNER JOIN ARTICLES ON ART_ID = LA_ART_ID
INNER JOIN SUPPLIERS ON SUP_ID = ART_SUP_ID
INNER JOIN DESIGNATIONS AS DESIGNATIONS2 ON DESIGNATIONS2.DES_ID = ART_COMPLETE_DES_ID
INNER JOIN DES_TEXTS AS DES_TEXTS2 ON DES_TEXTS2.TEX_ID = DESIGNATIONS2.DES_TEX_ID AND DESIGNATIONS2.DES_LNG_ID = 16
WHERE DES_TEXTS.TEX_TEXT LIKE '%тормозной%диск%'