傷防止用品
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=6) OR ( BNRCODE=3 AND CBNRCODE=2) OR ( BNRCODE=4 AND CBNRCODE=3) ) AND NOT COALESCE( CNT.COUNTS, '0') = 0 ORDER BY GRP.SORTORDER DESC, GRP.GRPNAME
Array
(
[item00000366] => Array
(
[NAME] => アンダーガード
[NAMEEN] => アンダーガード
[ORDER] =>
[GRPURLNAME] => item00000366
[BRANAMEEN] => G-FACTORYORIGINAL
[PRODUCTID] => 411
[COUNT] => 2
)
[item00000384] => Array
(
[NAME] => アンダーガード mini
[NAMEEN] => アンダーガード mini
[ORDER] =>
[GRPURLNAME] => item00000384
[BRANAMEEN] => G-FACTORYORIGINAL
[PRODUCTID] => 429
[COUNT] => 4
)
[item00000013] => Array
(
[NAME] => 傷防止用品(表示サンプル)
[NAMEEN] => 傷防止用品(表示サンプル)
[ORDER] => 99
[GRPURLNAME] => item00000013
[BRANAMEEN] => G-CORPORATION
[PRODUCTID] => 8
[COUNT] => 6
)
)
Array
(
[productid] => 411
)
Array
(
[productid] => 411
)
-
ガリ傷から守る!アンダーガード
Array
(
[productid] => 429
)
Array
(
[productid] => 429
)
-
ガリ傷から守る!アンダーガード mini