赞
踩
原生语句 多个字段需要查询用or
SELECT * FROM `tp6_work_order` WHERE ( ( (FIND_IN_SET(1, head_user_id) or FIND_IN_SET(1, check_user_id) or FIND_IN_SET(1, edit_user_id)) ) )
tp6条件写法
$where = [];
$find_in_set_where = "(FIND_IN_SET(" . $user['id'] . ", head_user_id) or FIND_IN_SET(" . $user['id'] . ", check_user_id) or FIND_IN_SET(" . $user['id'] . ", edit_user_id))";
$where[] = [
["", "exp", Db::raw($find_in_set_where)],
];
$work_order = Db::name('work_order')
->where($where)
->select();
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。