修复 setting demo 数据

This commit is contained in:
Edward Yang 2022-09-09 16:53:12 +08:00
parent 8680901d83
commit 1729264e67
2 changed files with 8 additions and 91 deletions

View File

@ -105,6 +105,9 @@ class SettingRepo
$rows = [];
foreach ($fields as $name => $value) {
if (in_array($name, ['_method', '_token'])) {
continue;
}
$rows[] = [
'type' => $type,
'space' => $code,
@ -127,9 +130,13 @@ class SettingRepo
*/
public static function createOrUpdate($data)
{
$name = $data['name'] ?? '';
if (in_array($name, ['_method', '_token'])) {
return;
}
$type = $data['type'] ?? '';
$space = $data['space'] ?? '';
$name = $data['name'] ?? '';
$value = (string)$data['value'] ?? '';
$json = (bool)$data['json'] ?? is_array($value);

View File

@ -149,16 +149,6 @@ class SettingsSeeder extends Seeder
"created_at" => "2022-07-29 06:48:36",
"updated_at" => "2022-08-31 18:14:36"
],
[
"id" => 258,
"type" => "system",
"space" => "base",
"name" => "_token",
"value" => "ZVu8AAf63UmINL4jELMwsK2hW9MA2a11mrlPTb8f",
"json" => 0,
"created_at" => "2022-08-05 11:01:09",
"updated_at" => "2022-08-31 18:14:36"
],
[
"id" => 260,
"type" => "plugin",
@ -177,46 +167,6 @@ class SettingsSeeder extends Seeder
"value" => $this->getFooterSetting(),
"json" => 1,
],
[
"id" => 306,
"type" => "plugin",
"space" => "latest_products",
"name" => "_token",
"value" => "a5tv1jermA4okE4DjmwQAH1WuEj7aed6ez25dDmV",
"json" => 0,
"created_at" => "2022-08-11 03:09:51",
"updated_at" => "2022-08-11 03:09:51"
],
[
"id" => 307,
"type" => "plugin",
"space" => "latest_products",
"name" => "_method",
"value" => "put",
"json" => 0,
"created_at" => "2022-08-11 03:09:51",
"updated_at" => "2022-08-11 03:09:51"
],
[
"id" => 435,
"type" => "plugin",
"space" => "stripe",
"name" => "_token",
"value" => "T0LajKAiOtNNb1eXK4H9lvxJupHjAqyAkzdMYS9b",
"json" => 0,
"created_at" => "2022-08-11 06:39:08",
"updated_at" => "2022-08-11 06:39:08"
],
[
"id" => 436,
"type" => "plugin",
"space" => "stripe",
"name" => "_method",
"value" => "put",
"json" => 0,
"created_at" => "2022-08-11 06:39:08",
"updated_at" => "2022-08-11 06:39:08"
],
[
"id" => 437,
"type" => "plugin",
@ -247,26 +197,6 @@ class SettingsSeeder extends Seeder
"created_at" => "2022-08-11 06:39:08",
"updated_at" => "2022-08-11 06:39:08"
],
[
"id" => 441,
"type" => "plugin",
"space" => "paypal",
"name" => "_token",
"value" => "x7wQxPIUmuVIYEMQ7UujlczIQvuRW0uoKfmElCt7",
"json" => 0,
"created_at" => "2022-08-12 01:20:15",
"updated_at" => "2022-08-12 01:20:15"
],
[
"id" => 442,
"type" => "plugin",
"space" => "paypal",
"name" => "_method",
"value" => "put",
"json" => 0,
"created_at" => "2022-08-12 01:20:15",
"updated_at" => "2022-08-12 01:20:15"
],
[
"id" => 443,
"type" => "plugin",
@ -407,26 +337,6 @@ class SettingsSeeder extends Seeder
"created_at" => "2022-07-14 06:19:44",
"updated_at" => "2022-08-29 15:13:22"
],
[
"id" => 504,
"type" => "plugin",
"space" => "flat_shipping",
"name" => "_token",
"value" => "NfoFyPbATfYS57KmHyHZgJJLubz78Ngv8uDTKYjL",
"json" => 0,
"created_at" => "2022-08-22 14:41:00",
"updated_at" => "2022-08-22 14:41:00"
],
[
"id" => 505,
"type" => "plugin",
"space" => "flat_shipping",
"name" => "_method",
"value" => "put",
"json" => 0,
"created_at" => "2022-08-22 14:41:00",
"updated_at" => "2022-08-22 14:41:00"
],
[
"id" => 506,
"type" => "plugin",