order by
$res=$result->where('id','EXP','NOT in(20) ORDER BY id DESC')->select(); 这种类型怎么拼接order by,那位同学写过。这么写是错误的。直接order()方法没啥问题。
$res=$result->where('id','EXP','NOT in(20) ORDER BY id DESC')->select(); 这种类型怎么拼接order by,那位同学写过。这么写是错误的。直接order()方法没啥问题。
2017-07-16
$res=$result->where([
'id'=>['not in','22'],
])->order([
'id'=>'asc'
])->select();
output->
D:\thinkphp\thinkphp\library\think\Debug.php:165:array (size=2)
0 =>
array (size=5)
'id' => int 21
'username' => string '这个杀手不太冷' (length=21)
'password' => string '6e453d094299ca1c9935281e6b250d31' (length=32)
'email' => string 'shashou@hotmail.com' (length=19)
'num' => int 0
1 =>
array (size=5)
'id' => int 20
'username' => string '猩球大战' (length=12)
'password' => string '914f21eb84c6fdb2b663dd6f453f65ca' (length=32)
'email' => string 'imooc@163.com' (length=13)
'num' => int 1
举报