SHOW FULL COLUMNS FROM `nl_category` [ RunTime:0.000515s ]
SHOW FULL COLUMNS FROM `nl_post` [ RunTime:0.000482s ]
SELECT a.*, b.value AS description
FROM (( SELECT id,pid,slug,title,showpic,pic_arr,images,content,sort,top, 'category' AS type, 18 AS gid FROM `nl_category` WHERE `hide` <> 1 AND `top` > 0 AND `pid` IN (8,26,27,64,65,66,67,162,69,70,93,94,95,105,110,382,71,72,91,74,484,103,133,177,287,567,9,496,220,221,222,223,224,225,226,280,435,475,10,459,227,228,229,230,231,272,278,434,453,455,456,457,529,11,245,246,247,248,249,525,13,476,187,186,417,197,401,241,564,460,14,477,29,33,34,35,36,38,79,478,479,480,481,482,575,576,483,418,531,532,533,573,580,15,150,151,153,152,156,157,158,159,160,161,183,184,251,261,301,437,518,521,182,328,190,189,191,192,193,194,195,380,314,315,316,326,336,357,361,376,384,386,387,500,16,381,263,264,265,266,267,268,269,270,271,492,493,494,358,359,360,364,535,536,537,574,17,383,211,215,216,217,218,219,212,213,214,370,458,135,486,487,488,489,490,491,170,171,172,173,174,175,176,181,180,199,200,351,524,317,371,319,318,322,323,324,320,321,365,546,561,288,436,292,289,290,291,294,295,296,297,298,299,300,379,388,389,390,391,392,528,560,308,485,497,309,310,311,530,556,559,337,411,410,408,342,343,344,340,341,495,339,438,548,549,550,551,552,553,554,555,462,519,520,527,563,569,362,499,141,260,312,338,402,363,511,526,368,372,416,540,303,369,377,393,420,421,429,430,431,432,433,541,542,543,545,557,373,581,582,330,331,332,333,334,335,413,464,465,466,467,468,469,470,471,565,571,572,579,583,584,585,586,587,588,589,590,591,592,593,594,596,396,501,502,503,504,505,506,507,508,509,406,407,409,404,405,397,400,419,595,454,293,302,474,473,325,304,305,306,374,375,562,510,534,538,539,544,570,568,578,18) ) UNION ( SELECT id,pid,slug,title,showpic,pic_arr,images,content,sort,top, 'post' AS type, 18 AS gid FROM `nl_post` WHERE `hide` <> 1 AND `top` = 1 AND `pid` IN (8,26,27,64,65,66,67,162,69,70,93,94,95,105,110,382,71,72,91,74,484,103,133,177,287,567,9,496,220,221,222,223,224,225,226,280,435,475,10,459,227,228,229,230,231,272,278,434,453,455,456,457,529,11,245,246,247,248,249,525,13,476,187,186,417,197,401,241,564,460,14,477,29,33,34,35,36,38,79,478,479,480,481,482,575,576,483,418,531,532,533,573,580,15,150,151,153,152,156,157,158,159,160,161,183,184,251,261,301,437,518,521,182,328,190,189,191,192,193,194,195,380,314,315,316,326,336,357,361,376,384,386,387,500,16,381,263,264,265,266,267,268,269,270,271,492,493,494,358,359,360,364,535,536,537,574,17,383,211,215,216,217,218,219,212,213,214,370,458,135,486,487,488,489,490,491,170,171,172,173,174,175,176,181,180,199,200,351,524,317,371,319,318,322,323,324,320,321,365,546,561,288,436,292,289,290,291,294,295,296,297,298,299,300,379,388,389,390,391,392,528,560,308,485,497,309,310,311,530,556,559,337,411,410,408,342,343,344,340,341,495,339,438,548,549,550,551,552,553,554,555,462,519,520,527,563,569,362,499,141,260,312,338,402,363,511,526,368,372,416,540,303,369,377,393,420,421,429,430,431,432,433,541,542,543,545,557,373,581,582,330,331,332,333,334,335,413,464,465,466,467,468,469,470,471,565,571,572,579,583,584,585,586,587,588,589,590,591,592,593,594,596,396,501,502,503,504,505,506,507,508,509,406,407,409,404,405,397,400,419,595,454,293,302,474,473,325,304,305,306,374,375,562,510,534,538,539,544,570,568,578,18) )) a
LEFT JOIN (
SELECT m.fid, m.`table`, m.value
FROM nl_meta m
INNER JOIN (
SELECT fid, `table`, MAX(id) AS id
FROM nl_meta
WHERE name = 'description'
GROUP BY fid, `table`
) latest ON latest.id = m.id
) b ON a.id = b.fid AND a.type = b.table
ORDER BY
SIGN(CASE WHEN a.type = 'category' THEN a.top ELSE a.sort END) DESC,
ABS(CASE WHEN a.type = 'category' THEN a.top ELSE a.sort END) ASC,
a.type ASC,
a.id ASC [ RunTime:0.077219s ]
SELECT a.*, b.value AS description
FROM (( SELECT id,pid,slug,title,showpic,pic_arr,images,content,sort,top, 'category' AS type, 19 AS gid FROM `nl_category` WHERE `hide` <> 1 AND `top` > 0 AND `pid` IN (522,21,22,207,208,209,23,24,25,523,253,313,398,399,558,19) ) UNION ( SELECT id,pid,slug,title,showpic,pic_arr,images,content,sort,top, 'post' AS type, 19 AS gid FROM `nl_post` WHERE `hide` <> 1 AND `top` = 1 AND `pid` IN (522,21,22,207,208,209,23,24,25,523,253,313,398,399,558,19) )) a
LEFT JOIN (
SELECT m.fid, m.`table`, m.value
FROM nl_meta m
INNER JOIN (
SELECT fid, `table`, MAX(id) AS id
FROM nl_meta
WHERE name = 'description'
GROUP BY fid, `table`
) latest ON latest.id = m.id
) b ON a.id = b.fid AND a.type = b.table
ORDER BY
SIGN(CASE WHEN a.type = 'category' THEN a.top ELSE a.sort END) DESC,
ABS(CASE WHEN a.type = 'category' THEN a.top ELSE a.sort END) ASC,
a.type ASC,
a.id ASC [ RunTime:0.052700s ]
SELECT a.*, b.value AS description
FROM (( SELECT id,pid,slug,title,showpic,pic_arr,images,content,sort,top, 'category' AS type, 279 AS gid FROM `nl_category` WHERE `hide` <> 1 AND `top` > 0 AND `pid` IN (281,282,283,284,285,286,461,512,513,514,515,516,517,279) ) UNION ( SELECT id,pid,slug,title,showpic,pic_arr,images,content,sort,top, 'post' AS type, 279 AS gid FROM `nl_post` WHERE `hide` <> 1 AND `top` = 1 AND `pid` IN (281,282,283,284,285,286,461,512,513,514,515,516,517,279) )) a
LEFT JOIN (
SELECT m.fid, m.`table`, m.value
FROM nl_meta m
INNER JOIN (
SELECT fid, `table`, MAX(id) AS id
FROM nl_meta
WHERE name = 'description'
GROUP BY fid, `table`
) latest ON latest.id = m.id
) b ON a.id = b.fid AND a.type = b.table
ORDER BY
SIGN(CASE WHEN a.type = 'category' THEN a.top ELSE a.sort END) DESC,
ABS(CASE WHEN a.type = 'category' THEN a.top ELSE a.sort END) ASC,
a.type ASC,
a.id ASC [ RunTime:0.043605s ]
SELECT a.*, b.value AS description
FROM (( SELECT id,pid,slug,title,showpic,pic_arr,images,content,sort,top, 'category' AS type, 20 AS gid FROM `nl_category` WHERE `hide` <> 1 AND `top` > 0 AND `pid` IN (54,415,178,179,232,233,234,235,236,452,345,350,394,395,414,422,423,424,425,426,427,428,439,440,441,442,443,444,445,446,547,447,448,449,450,451,20) ) UNION ( SELECT id,pid,slug,title,showpic,pic_arr,images,content,sort,top, 'post' AS type, 20 AS gid FROM `nl_post` WHERE `hide` <> 1 AND `top` = 1 AND `pid` IN (54,415,178,179,232,233,234,235,236,452,345,350,394,395,414,422,423,424,425,426,427,428,439,440,441,442,443,444,445,446,547,447,448,449,450,451,20) )) a
LEFT JOIN (
SELECT m.fid, m.`table`, m.value
FROM nl_meta m
INNER JOIN (
SELECT fid, `table`, MAX(id) AS id
FROM nl_meta
WHERE name = 'description'
GROUP BY fid, `table`
) latest ON latest.id = m.id
) b ON a.id = b.fid AND a.type = b.table
ORDER BY
SIGN(CASE WHEN a.type = 'category' THEN a.top ELSE a.sort END) DESC,
ABS(CASE WHEN a.type = 'category' THEN a.top ELSE a.sort END) ASC,
a.type ASC,
a.id ASC [ RunTime:0.043749s ]