调整配置接口

main
liutk 2024-05-24 07:59:52 +08:00
parent ed5ba6edc8
commit 3500b6b5bb
3 changed files with 12 additions and 4 deletions

View File

@ -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);
}
}

View File

@ -26,7 +26,7 @@ class SettingRequest extends FormRequest
public function rules()
{
return [
'key' => 'required|string|max:100',
'key' => 'required|string|max:255',
];
}

View File

@ -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();
});