diff --git a/app/Middleware/Auth/ApiMiddleware.php b/app/Middleware/Auth/ApiMiddleware.php index ce06bff..44cf3fc 100644 --- a/app/Middleware/Auth/ApiMiddleware.php +++ b/app/Middleware/Auth/ApiMiddleware.php @@ -39,7 +39,7 @@ class ApiMiddleware implements MiddlewareInterface public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { - if (env('APP_ENV') == 'dev') { + if (env('APP_ENV') == 'dev' || env('APP_ENV') == 'local') { return $handler->handle($request); } diff --git a/app/Model/ActivityBind.php b/app/Model/UserRelationBind.php similarity index 86% rename from app/Model/ActivityBind.php rename to app/Model/UserRelationBind.php index 2f4dda0..1265197 100644 --- a/app/Model/ActivityBind.php +++ b/app/Model/UserRelationBind.php @@ -5,14 +5,14 @@ namespace App\Model; /** */ -class ActivityBind extends Model +class UserRelationBind extends Model { /** * The table associated with the model. * * @var string */ - protected $table = 'lanzu_activity_bind'; + protected $table = 'lanzu_user_relation_bind'; /** * The attributes that are mass assignable. * diff --git a/app/Service/CommunityService.php b/app/Service/CommunityService.php index 6332750..1b5aa2e 100644 --- a/app/Service/CommunityService.php +++ b/app/Service/CommunityService.php @@ -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();