Coder Social home page Coder Social logo

Comments (12)

mowangjuanzi avatar mowangjuanzi commented on July 17, 2024 1

用数组的方式可以吗?

from thinkphp.

liu21st avatar liu21st commented on July 17, 2024

因为最新更新有一个安全问题 需要更加规范的写order,你的order代码是怎样?

from thinkphp.

bigiot avatar bigiot commented on July 17, 2024

$dev_open_list=$Dev->where('open=1')->order('online desc, online_time desc, update_time desc')->limit($Page->firstRow.','.$Page->listRows)->select();
原来是哪个排序条件在前,先按哪个,现在不按这个顺序了。

from thinkphp.

bigiot avatar bigiot commented on July 17, 2024

似乎只有写在第一位的排序条件有效,后面的不起作用了。

from thinkphp.

liu21st avatar liu21st commented on July 17, 2024

你用最新的git版本测试下看看

from thinkphp.

bigiot avatar bigiot commented on July 17, 2024

确认了一遍,是最新的,昨天提交那个地方也是最新的。runtime也清理了

from thinkphp.

bigiot avatar bigiot commented on July 17, 2024

数组方式可以。
改后这样,可以,贴出来方便参考。
$dev_open_list=$Dev->where('open=1')->order(array('online'=>'desc', 'online_time'=> 'desc', 'update_time'=> 'desc'))->limit($Page->firstRow.','.$Page->listRows)->select();

from thinkphp.

liu21st avatar liu21st commented on July 17, 2024

字符串也可以的,只是不需要加两边的符号

from thinkphp.

bigiot avatar bigiot commented on July 17, 2024

是不需要加order里面的引号吗?

$dev_open_list=$Dev->where('open=1')->order(online desc, online_time desc, update_time desc)->limit($Page->firstRow.','.$Page->listRows)->select();

这样?

from thinkphp.

liu21st avatar liu21st commented on July 17, 2024

是不需要加order里面的引号吗?

$dev_open_list=$Dev->where('open=1')->order(online desc, online_time desc, update_time desc)->limit($Page->firstRow.','.$Page->listRows)->select();

这样?

抱歉,是我和另外一个反馈搞错了

from thinkphp.

liu21st avatar liu21st commented on July 17, 2024

其实是你的字符串逗号后面多了空格导致,我改进了下

from thinkphp.

bigiot avatar bigiot commented on July 17, 2024

其实是你的字符串逗号后面多了空格导致

原来如此,要求更严格了,谢谢。

from thinkphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.