thinkphp5.1.27版本 neq[<>] 查询 是IN?

浏览:3741 发布日期:2018/10/23 分类:ThinkPHP5专区 关键字: neq &lt;&gt;
thinkphp5.1.27版本 neq[<>] 查询 是IN?
//模型定义方法
public function user_count($where){
return $this->where($where)->count();
}
//控制器
use app\usezan\model\User;
$this->user = new User();
//查询
$this->user->user_count(['username'=>$data['username'],'id'=>['<>',$data['id']]]);
//输出
SELECT COUNT(*) AS tp_count FROM `usezan_user` WHERE `username` = 'usezan_admin' AND `id` IN (0,1) LIMIT 1

这操作5.0还是可以的,试试5.1不行?
最佳答案
评论( 相关
后面还有条评论,点击查看>>