1. public function getUserInfo($uid){
ublic function getUserInfo($uid){
2. if(is_null($uid) || empty($uid)){return false;}
3. if(is_array($uid)){
4. $where['user_id'] = array('in',$uid);
5. }else{
6. $where['user_id'] = array('eq',$_SESSION['uid']);
7. }
8. return M('User')->where($where)->select();
9. }
最近在优化代码,特别实用。
你要保守你心,胜过保守一切。
作者:刘俊涛的博客