|
|
|
@ -58,7 +58,7 @@ class Friend extends BaseController |
|
|
|
return warning(lang('friend.limit')); |
|
|
|
} |
|
|
|
} |
|
|
|
$friend=FriendModel::where(['friend_user_id'=>$user_id,'create_user'=>$this->uid])->find(); |
|
|
|
$friend=FriendModel::where(['friend_user_id'=>$user_id,'create_user'=>$this->uid])->order('create_time', 'desc')->find(); |
|
|
|
if($friend){ |
|
|
|
if($friend->status==1){ |
|
|
|
return warning(lang('friend.already')); |
|
|
|
@ -67,7 +67,7 @@ class Friend extends BaseController |
|
|
|
} |
|
|
|
} |
|
|
|
$status=2; |
|
|
|
$otherFriend=FriendModel::where(['friend_user_id'=>$this->uid,'create_user'=>$user_id])->find(); |
|
|
|
$otherFriend=FriendModel::where(['friend_user_id'=>$this->uid,'create_user'=>$user_id])->order('create_time', 'desc')->find(); |
|
|
|
if($otherFriend){ |
|
|
|
if($otherFriend->status>0){ |
|
|
|
$status=1; |
|
|
|
|