$condition['mobile'] = I('post.cardid');
$condition['uid'] = I('post.cardid');
$condition['_logic'] = "OR";
$mmmap['_complex']=$condition;
$mmmap['token']=get_token();
$mmmap['_logic']='AND';
最终mmmap = array(3) {
["_complex"] => array(3) {
["mobile"] => string(3) "928"
["uid"] => string(3) "928"
["_logic"] => string(2) "OR"
}
["token"] => string(15) "gh_580e6e014f84"
["_logic"] => string(3) "AND"
}
但是通过打印最后sql//M('user')->where($mmmap)->find();
//dump(M('user')->getLastSql());
SELECT * FROM `tp_user` WHERE ( `mobile` = '928' OR `uid` = '928' ) LIMIT 1
token变没有了...要实现这种到底怎么弄
where token = '1234' and (mobile = 5 OR uid = 5)
token 相当于用户分组,这个是一定要过滤的,然后通过输入uid或者手机号索引某个用户.if(lzsb==1){
$this->error('模型里面token字段名写错了呀....lzsb');
}
exit;
最佳答案
