Friend.php 515 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * raingad IM [ThinkPHP6]
  4. * @author xiekunyu <raingad@foxmail.com>
  5. */
  6. namespace app\enterprise\model;
  7. use app\BaseModel;
  8. use think\facade\Db;
  9. class Friend extends BaseModel
  10. {
  11. protected $pk="friend_id";
  12. public static function getFriend($map){
  13. $list=self::where($map)->select();
  14. $data=[];
  15. if($list){
  16. $list=$list->toArray();
  17. foreach($list as $k=>$v){
  18. $data[$v['friend_user_id']]=$v;
  19. }
  20. }
  21. return $data;
  22. }
  23. }