diff --git a/app/Http/Controllers/Api/SettingController.php b/app/Http/Controllers/Api/SettingController.php index f12c76a..d37e163 100644 --- a/app/Http/Controllers/Api/SettingController.php +++ b/app/Http/Controllers/Api/SettingController.php @@ -12,7 +12,15 @@ class SettingController extends ApiController public function info(SettingRequest $request) { $key = $request->input('key', null); - - return $this->success([$key=> settings()->get($key)]); + $data = []; + // if(strpos(',', $key) !== false){ + $keys = explode(',', $key); + // } + foreach($keys as $key){ + if(!empty($key)){ + $data[$key] = settings()->get($key); + } + } + return $this->success($data); } } \ No newline at end of file diff --git a/app/Http/Requests/SettingRequest.php b/app/Http/Requests/SettingRequest.php index a868d83..5a58d62 100644 --- a/app/Http/Requests/SettingRequest.php +++ b/app/Http/Requests/SettingRequest.php @@ -26,7 +26,7 @@ class SettingRequest extends FormRequest public function rules() { return [ - 'key' => 'required|string|max:100', + 'key' => 'required|string|max:255', ]; } diff --git a/database/migrations/2024_05_16_114837_create_activity_games_table.php b/database/migrations/2024_05_16_114837_create_activity_games_table.php index 15aaadb..6909b2f 100644 --- a/database/migrations/2024_05_16_114837_create_activity_games_table.php +++ b/database/migrations/2024_05_16_114837_create_activity_games_table.php @@ -22,7 +22,7 @@ return new class extends Migration $table->string('away_logo')->comment('客场logo'); $table->timestamp('game_at')->comment('比赛时间'); $table->unsignedTinyInteger('state')->default(0)->comment('状态:0未发布,1已发布,2已公布'); - $table->unsignedInteger('mark')->comment('分数'); + $table->unsignedInteger('mark')->default(0)->comment('分数'); $table->enum('score', Score::options())->nullable()->comment('比赛结果'); $table->timestamps(); });