联系官方销售客服

1835022288

028-61286886

开发框架 版主:迅睿框架研发组
怎么我这个搜索,默认的时间排序
类型:迅睿CMS 更新时间:2020-05-21 15:16:47

怎么我这个搜索,默认的时间排序,并不是最新的时间啊?我2020年5月19日都发布有内容的啊,5月19这个单独搜索也能搜到

{search module=MOD_DIR id=$searchid total=$sototal order=$params.order catid=$catid page=1 pagesize=10 urlrule=$urlrule}


image


image

回帖
  • #1楼    迅睿框架创始人
    2020-05-21 09:26:16
    Chrome 0
    {/search}后面加一个 {$debug} 看看内容
  • 草木人
    #2楼    草木人
    2020-05-21 09:29:25
    Chrome 0
    SQL: SELECT * FROM `ct_1_news` WHERE (`ct_1_news`.`id` IN(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500)) ORDER BY `ct_1_news`.`updatetime` DESC LIMIT 0,10
    
    开发模式:已关闭
    
    数据缓存:未设置
    
    总记录数:500
    
    分页功能:已开启
    
    当前页码:1
    
    总页数码:50
    
    每页数量:10
    
    分页地址:/index.php?s=news&c=search&page=%7Bpage%7D
    
    可用字段:id、catid、title、thumb、keywords、description、hits、uid、author、status、url、link_id、tableid、inputip、inputtime、updatetime、comments、avgsort、displayorder、laiyuan、favorites、support、oppose、_inputtime、_updatetime
    怎么这么多id。。。回复迅睿框架创始人
  • 草木人
    #3楼    草木人
    2020-05-21 09:31:57
    Chrome 0
    {search module=MOD_DIR id=$searchid total=$sototal order=$params.order catid=$catid page=1 pagesize=10 urlrule=$urlrule}官方默认模板也是这样写的啊回复迅睿框架创始人
  • K大帅
    #4楼    K大帅
    2020-05-21 09:36:12
    Chrome 0
    `updatetime` DESC
    是按照更新时间 排序的
  • #5楼    迅睿框架创始人
    2020-05-21 09:41:21
    Chrome 0
    标签是对的,
    updatetime
    排序也是对的
  • 草木人
    #6楼    草木人
    2020-05-21 09:46:53
    Chrome 0
    那就奇怪了,这么会这样呢?回复迅睿框架创始人
  • 草木人
    #7楼    草木人
    2020-05-21 09:48:46
    Chrome 0
    category页面和list页面的排序都是正常的,就这个search页面有问题回复迅睿框架创始人
  • #8楼    迅睿框架创始人
    2020-05-21 10:56:08
    Google Pixel 手机 0
    后台搜索数量限制改为0试试
  • 草木人
    #9楼    草木人
    2020-05-21 13:50:06
    Chrome 0
    取消条数限制也没用,我用phpmyadmin运行debug出来的sql语句,排序也不正常,但是把条件WHERE (`ct_1_news`.`id` IN(1,2,3,4,5,6,7,8,9,10,11,12,13,14,500))删除后,排序是正常的,这个id=$searchid换个写法不?
  • 草木人
    #10楼    草木人
    2020-05-21 13:55:05
    Chrome 0
    SQL: SELECT * FROM `ct_1_news` WHERE (`ct_1_news`.`id` IN(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500)) ORDER BY `ct_1_news`.`updatetime` DESC LIMIT 0,10
    我发现debug出来这个语句,id限制在1,2,3,4,。。。500了,我最新的id都是10125了,肯定不在默认排序这里了,这个id=$searchid 有问题
    image
    回复迅睿框架创始人
  • #11楼    迅睿框架创始人
    2020-05-21 14:11:20
    Chrome 0
  • 草木人
    #12楼    草木人
    2020-05-21 14:15:09
    Chrome 0

    image
    找到根源了。id in 1~500,这个数量是后台搜索设置这里来的。后台这个最大搜索数量,应该是从最后往前面倒叙数500,而不是从最早的1开始限制到500啊。回复迅睿框架创始人
  • 草木人
    #13楼    草木人
    2020-05-21 15:16:47
    Chrome 0
    迅睿框架创始人:okokokokokok