正在显示
1 个修改的文件
包含
25 行增加
和
27 行删除
@@ -380,19 +380,18 @@ class Index extends Api | @@ -380,19 +380,18 @@ class Index extends Api | ||
380 | foreach ($data as &$v){ | 380 | foreach ($data as &$v){ |
381 | 381 | ||
382 | $user_info = Db::name('user')->where('id',$v['user_id'])->find(); | 382 | $user_info = Db::name('user')->where('id',$v['user_id'])->find(); |
383 | - if($v['user_id'] == $uid){ | ||
384 | - $v['is_white'] = 1; | ||
385 | - }else{ | ||
386 | - if(empty($user_info['whiteip_ids'])){ | ||
387 | - $v['is_white'] = 2; | 383 | + |
384 | + | ||
385 | + //查询白名单 | ||
386 | + if(!empty($user_info['whiteip_ids'])){ | ||
387 | + $user_info['whiteip_ids'] = explode(',',$user_info['whiteip_ids']); | ||
388 | + if($v['user_id'] == $uid || in_array($uid,$user_info['whiteip_ids'])){ | ||
389 | + $v['is_white'] = 1; | ||
388 | }else{ | 390 | }else{ |
389 | - $whiteip_ids = explode(',',$user_info['whiteip_ids']); | ||
390 | - if(in_array($user_id,$whiteip_ids)){ | ||
391 | - $v['is_white'] = 1; | ||
392 | - }else{ | ||
393 | - $v['is_white'] = 2; | ||
394 | - } | 391 | + $v['is_white'] = 2; |
395 | } | 392 | } |
393 | + }else{ | ||
394 | + $v['is_white'] = 2; | ||
396 | } | 395 | } |
397 | 396 | ||
398 | 397 | ||
@@ -439,19 +438,18 @@ class Index extends Api | @@ -439,19 +438,18 @@ class Index extends Api | ||
439 | 438 | ||
440 | foreach ($note as &$v){ | 439 | foreach ($note as &$v){ |
441 | $user_info = Db::name('user')->where('id',$v['user_id'])->find(); | 440 | $user_info = Db::name('user')->where('id',$v['user_id'])->find(); |
442 | - if($v['user_id'] == $uid){ | ||
443 | - $v['is_white'] = 1; | ||
444 | - }else{ | ||
445 | - if(empty($user_info['whiteip_ids'])){ | ||
446 | - $v['is_white'] = 2; | 441 | + |
442 | + | ||
443 | + //查询白名单 | ||
444 | + if(!empty($user_info['whiteip_ids'])){ | ||
445 | + $user_info['whiteip_ids'] = explode(',',$user_info['whiteip_ids']); | ||
446 | + if($v['user_id'] == $uid || in_array($uid,$user_info['whiteip_ids'])){ | ||
447 | + $v['is_white'] = 1; | ||
447 | }else{ | 448 | }else{ |
448 | - $whiteip_ids = explode(',',$user_info['whiteip_ids']); | ||
449 | - if(in_array($user_id,$whiteip_ids)){ | ||
450 | - $v['is_white'] = 1; | ||
451 | - }else{ | ||
452 | - $v['is_white'] = 2; | ||
453 | - } | 449 | + $v['is_white'] = 2; |
454 | } | 450 | } |
451 | + }else{ | ||
452 | + $v['is_white'] = 2; | ||
455 | } | 453 | } |
456 | } | 454 | } |
457 | 455 | ||
@@ -466,7 +464,7 @@ class Index extends Api | @@ -466,7 +464,7 @@ class Index extends Api | ||
466 | $v['is_white'] = 2; | 464 | $v['is_white'] = 2; |
467 | }else{ | 465 | }else{ |
468 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); | 466 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); |
469 | - if(in_array($user_id,$whiteip_ids)){ | 467 | + if(in_array($uid,$whiteip_ids)){ |
470 | $v['is_white'] = 1; | 468 | $v['is_white'] = 1; |
471 | }else{ | 469 | }else{ |
472 | $v['is_white'] = 2; | 470 | $v['is_white'] = 2; |
@@ -485,7 +483,7 @@ class Index extends Api | @@ -485,7 +483,7 @@ class Index extends Api | ||
485 | $v['is_white'] = 2; | 483 | $v['is_white'] = 2; |
486 | }else{ | 484 | }else{ |
487 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); | 485 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); |
488 | - if(in_array($user_id,$whiteip_ids)){ | 486 | + if(in_array($uid,$whiteip_ids)){ |
489 | $v['is_white'] = 1; | 487 | $v['is_white'] = 1; |
490 | }else{ | 488 | }else{ |
491 | $v['is_white'] = 2; | 489 | $v['is_white'] = 2; |
@@ -506,7 +504,7 @@ class Index extends Api | @@ -506,7 +504,7 @@ class Index extends Api | ||
506 | $v['is_white'] = 2; | 504 | $v['is_white'] = 2; |
507 | }else{ | 505 | }else{ |
508 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); | 506 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); |
509 | - if(in_array($user_id,$whiteip_ids)){ | 507 | + if(in_array($uid,$whiteip_ids)){ |
510 | $v['is_white'] = 1; | 508 | $v['is_white'] = 1; |
511 | }else{ | 509 | }else{ |
512 | $v['is_white'] = 2; | 510 | $v['is_white'] = 2; |
@@ -525,7 +523,7 @@ class Index extends Api | @@ -525,7 +523,7 @@ class Index extends Api | ||
525 | $v['is_white'] = 2; | 523 | $v['is_white'] = 2; |
526 | }else{ | 524 | }else{ |
527 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); | 525 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); |
528 | - if(in_array($user_id,$whiteip_ids)){ | 526 | + if(in_array($uid,$whiteip_ids)){ |
529 | $v['is_white'] = 1; | 527 | $v['is_white'] = 1; |
530 | }else{ | 528 | }else{ |
531 | $v['is_white'] = 2; | 529 | $v['is_white'] = 2; |
@@ -544,7 +542,7 @@ class Index extends Api | @@ -544,7 +542,7 @@ class Index extends Api | ||
544 | $v['is_white'] = 2; | 542 | $v['is_white'] = 2; |
545 | }else{ | 543 | }else{ |
546 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); | 544 | $whiteip_ids = explode(',',$user_info['whiteip_ids']); |
547 | - if(in_array($user_id,$whiteip_ids)){ | 545 | + if(in_array($uid,$whiteip_ids)){ |
548 | $v['is_white'] = 1; | 546 | $v['is_white'] = 1; |
549 | }else{ | 547 | }else{ |
550 | $v['is_white'] = 2; | 548 | $v['is_white'] = 2; |
-
请 注册 或 登录 后发表评论