|
|
|
@ -4,7 +4,7 @@ |
|
|
|
namespace App\Service; |
|
|
|
|
|
|
|
|
|
|
|
use App\Model\ActivityBind; |
|
|
|
use App\Model\UserRelationBind; |
|
|
|
|
|
|
|
class CommunityService implements CommunityServiceInterface |
|
|
|
{ |
|
|
|
@ -14,7 +14,7 @@ class CommunityService implements CommunityServiceInterface |
|
|
|
if ($res = $this->isBinded($data['bind_type'], $data['source_id'], $data['user_id'])) { |
|
|
|
return $res; |
|
|
|
} |
|
|
|
return ActivityBind::query()->updateOrCreate( |
|
|
|
return UserRelationBind::query()->updateOrCreate( |
|
|
|
['bind_type' => $data['bind_type'], 'source_id' => $data['source_id'], 'user_id' => $data['user_id']], |
|
|
|
['json_data' => $data['json_data']] |
|
|
|
); |
|
|
|
@ -22,7 +22,7 @@ class CommunityService implements CommunityServiceInterface |
|
|
|
|
|
|
|
public function isBinded($bind_type, $source_id, $user_id) |
|
|
|
{ |
|
|
|
return ActivityBind::query() |
|
|
|
return UserRelationBind::query() |
|
|
|
->select('id') |
|
|
|
->where(['bind_type' => $bind_type, 'source_id' => $source_id, 'user_id' => $user_id]) |
|
|
|
->first(); |
|
|
|
|