モール用品
SQL
SELECT * , GRP.URLNAME AS GRPURLNAME FROM M_SHOHINGRP GRP LEFT OUTER JOIN M_JYOKEN JYO ON JYO.GRPCODE = GRP.GRPCODE LEFT OUTER JOIN M_BRAND BRA ON BRA.BRACODE = GRP.BRACODE LEFT OUTER JOIN M_ECHIN ECH ON ECH.GRPCODE = GRP.GRPCODE LEFT OUTER JOIN ( SELECT GRPCODE, COUNT(HINCODE) AS COUNTS FROM M_HIN WHERE ECTORIFLG = 1 AND HINTEISHI IS NULL GROUP BY GRPCODE ) CNT ON CNT.GRPCODE = GRP.GRPCODE WHERE GRP.HYOJIFLG = 1 AND (( BNRCODE=1 AND CBNRCODE=7) OR ( BNRCODE=3 AND CBNRCODE=3) OR ( BNRCODE=4 AND CBNRCODE=4) ) AND NOT COALESCE( CNT.COUNTS, '0') = 0 ORDER BY GRP.SORTORDER DESC, GRP.GRPNAME
Array
(
[item00000025] => Array
(
[NAME] => アンダーガード
[NAMEEN] => アンダーガード
[ORDER] => 99
[GRPURLNAME] => item00000025
[BRANAMEEN] => G-CORPORATION
[PRODUCTID] => 20
[COUNT] => 2
)
[item00000028] => Array
(
[NAME] => マルチスポイラー
[NAMEEN] => マルチスポイラー
[ORDER] => 99
[GRPURLNAME] => item00000028
[BRANAMEEN] => G-CORPORATION
[PRODUCTID] => 22
[COUNT] => 17
)
[item00000014] => Array
(
[NAME] => モール用品(表示サンプル)
[NAMEEN] => モール用品(表示サンプル)
[ORDER] => 99
[GRPURLNAME] => item00000014
[BRANAMEEN] => G-CORPORATION
[PRODUCTID] => 9
[COUNT] => 19
)
[item00000354] => Array
(
[NAME] => 隙間に差し込むモール
[NAMEEN] => 隙間に差し込むモール
[ORDER] =>
[GRPURLNAME] => item00000354
[BRANAMEEN] => G-FACTORYORIGINAL
[PRODUCTID] => 399
[COUNT] => 24
)
)
Array
(
[productid] => 20
)
Array
(
[productid] => 20
)
-
ガリ傷から守る!アンダーガード
Array
(
[productid] => 22
)
Array
(
[productid] => 22
)
-
マルチスポイラー
Array
(
[productid] => 399
)
Array
(
[productid] => 399
)
-
隙間に差し込むモール