一定要用这个格式的where条件
5.1版本修改了where条件格式,虽然用tp5的写法也好使,但是有一些用法是不好使的
$where[] = ['yq_user_id','=',$user_id]; $where[] = ['byq_user_id','=',$id]; $where1[] = ['yq_user_id','=',$id]; $where1[] = ['byq_user_id','=',$user_id];
用getlastsql打印的效果
SELECT `id`,`state` FROM `chat_user_relation_space` WHERE ( `yq_user_id` = 4 AND `byq_user_id` = 1 ) OR ( `yq_user_id` = 1 AND `byq_user_id` = 4 ) LIMIT 1