速誉秘籍,黄缘龟,原油市场行情
$id=4; db::name('menu')->where('find_in_set(:id,pid_all)',['id' => $id])->update([$field => $title]);
$map[]=['exp','find_in_set(2,needid)'];
$db->where($map)->select();
要达到这样子查询:
1、首先引用: use think\db\where;
2、定义数组:$where = new where;
3、就可以用了:$where['title'] = ['like', "%".$sotitle."%"];
$where['class_id'] = ['in', '$cid_all']; $where['id'] = ['in', $all_user_id];//或这样子 $where['title'] = ['like', '%php%']; $where['id'] = ['<>', $id]; $where['id'] = ['notin', $all_user_id];//不等于 //值为数字 $id=419; $where[] = ['exp',db::raw("find_in_set($id,category)")];//category值为数字,例子:419,415,414 //值为字符串 $id值等于dfd 要注意'引号 $where[] = ['exp',db::raw("find_in_set('$id',category)")];//category值为数字,例子:'349/417/419','349/413/415','349/413/416'
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
YII2框架中使用RBAC对模块,控制器,方法的权限控制及规则的使用示例
YII2框架中ActiveDataProvider与GridView的配合使用操作示例
PhpStorm的使用教程(本地运行PHP+远程开发+快捷键)
网友评论