فهرست منبع

delete old projects and code

iamsaltedfish 3 سال پیش
والد
کامیت
21a0e9bf70
3فایلهای تغییر یافته به همراه2 افزوده شده و 655 حذف شده
  1. 0 500
      config/settings.json
  2. 0 97
      glzjin_all.sql
  3. 2 58
      src/Controllers/Admin/SettingController.php

+ 0 - 500
config/settings.json

@@ -1,84 +1,4 @@
 [
-    {
-        "id": null,
-        "item": "payment_gateway",
-        "value": "[]",
-        "class": "pay",
-        "is_public": 1,
-        "type": "array",
-        "default": "[]",
-        "mark": "支付网关"
-    },
-    {
-        "id": null,
-        "item": "f2f_pay_app_id",
-        "value": "",
-        "class": "f2f",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "当面付AppID"
-    },
-    {
-        "id": null,
-        "item": "f2f_pay_pid",
-        "value": "",
-        "class": "f2f",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "当面付PID"
-    },
-    {
-        "id": null,
-        "item": "f2f_pay_public_key",
-        "value": "",
-        "class": "f2f",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "当面付公钥"
-    },
-    {
-        "id": null,
-        "item": "f2f_pay_private_key",
-        "value": "",
-        "class": "f2f",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "当面付私钥"
-    },
-    {
-        "id": null,
-        "item": "f2f_pay_notify_url",
-        "value": "",
-        "class": "f2f",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "当面付自定义回调地址"
-    },
-    {
-        "id": null,
-        "item": "vmq_gateway",
-        "value": "",
-        "class": "vmq",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "V免签网关"
-    },
-    {
-        "id": null,
-        "item": "vmq_key",
-        "value": "",
-        "class": "vmq",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "V免签密钥"
-    },
     {
         "id": null,
         "item": "smtp_host",
@@ -329,86 +249,6 @@
         "default": "",
         "mark": "aws密钥key"
     },
-    {
-        "id": null,
-        "item": "auto_backup_email",
-        "value": "",
-        "class": "backup",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "接收备份的邮箱"
-    },
-    {
-        "id": null,
-        "item": "auto_backup_password",
-        "value": "",
-        "class": "backup",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "备份的压缩密码"
-    },
-    {
-        "id": null,
-        "item": "payjs_mchid",
-        "value": "",
-        "class": "payjs",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "payjs_mchid"
-    },
-    {
-        "id": null,
-        "item": "payjs_key",
-        "value": "",
-        "class": "payjs",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "payjs_key"
-    },
-    {
-        "id": null,
-        "item": "enable_admin_contact",
-        "value": "0",
-        "class": "contact",
-        "is_public": 1,
-        "type": "bool",
-        "default": "0",
-        "mark": "是否显示站长联系方式"
-    },
-    {
-        "id": null,
-        "item": "admin_contact1",
-        "value": "qq",
-        "class": "contact",
-        "is_public": 1,
-        "type": "string",
-        "default": "qq",
-        "mark": "站长联系方式一"
-    },
-    {
-        "id": null,
-        "item": "admin_contact2",
-        "value": "mail",
-        "class": "contact",
-        "is_public": 1,
-        "type": "string",
-        "default": "mail",
-        "mark": "站长联系方式二"
-    },
-    {
-        "id": null,
-        "item": "admin_contact3",
-        "value": "telegram",
-        "class": "contact",
-        "is_public": 1,
-        "type": "string",
-        "default": "telegram",
-        "mark": "站长联系方式三"
-    },
     {
         "id": null,
         "item": "tawk_id",
@@ -459,56 +299,6 @@
         "default": "none",
         "mark": "客服系统开关"
     },
-    {
-        "id": null,
-        "item": "theadpay_url",
-        "value": "",
-        "class": "theadpay",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "theadpay_url"
-    },
-    {
-        "id": null,
-        "item": "theadpay_mchid",
-        "value": "",
-        "class": "theadpay",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "theadpay_mchid"
-    },
-    {
-        "id": null,
-        "item": "theadpay_key",
-        "value": "",
-        "class": "theadpay",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "theadpay_key"
-    },
-    {
-        "id": null,
-        "item": "coinpay_appid",
-        "value": "",
-        "class": "coinpay",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "CoinPay应用ID"
-    },
-    {
-        "id": null,
-        "item": "coinpay_secret",
-        "value": "",
-        "class": "coinpay",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "CoinPay验证密钥"
-    },
     {
         "id": null,
         "item": "user_center_bg",
@@ -549,56 +339,6 @@
         "default": "\/theme\/material\/css\/images\/bg\/amber.jpg",
         "mark": "管理中心背景图片地址"
     },
-    {
-        "id": null,
-        "item": "pmw_publickey",
-        "value": "",
-        "class": "pmw",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "pmw公钥"
-    },
-    {
-        "id": null,
-        "item": "pmw_privatekey",
-        "value": "",
-        "class": "pmw",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "pmw私钥"
-    },
-    {
-        "id": null,
-        "item": "pmw_widget",
-        "value": "m2_1",
-        "class": "pmw",
-        "is_public": 0,
-        "type": "string",
-        "default": "m2_1",
-        "mark": "pmw_widget"
-    },
-    {
-        "id": null,
-        "item": "pmw_height",
-        "value": "350px",
-        "class": "pmw",
-        "is_public": 0,
-        "type": "string",
-        "default": "350px",
-        "mark": "pmw_height"
-    },
-    {
-        "id": null,
-        "item": "auto_backup_notify",
-        "value": "0",
-        "class": "backup",
-        "is_public": 0,
-        "type": "bool",
-        "default": "0",
-        "mark": "备份是否通知到TG群中"
-    },
     {
         "id": null,
         "item": "reg_mode",
@@ -639,156 +379,6 @@
         "default": "5",
         "mark": "验证码有效期内单个ip可请求的发信次数"
     },
-    {
-        "id": null,
-        "item": "sign_up_for_free_traffic",
-        "value": "20",
-        "class": "register",
-        "is_public": 0,
-        "type": "int",
-        "default": "20",
-        "mark": "注册时赠送的流量(单位:GB)"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_free_time",
-        "value": "7",
-        "class": "register",
-        "is_public": 0,
-        "type": "int",
-        "default": "7",
-        "mark": "注册时赠送的时长(单位:天)"
-    },
-    {
-        "id": null,
-        "item": "connection_device_limit",
-        "value": "0",
-        "class": "register",
-        "is_public": 0,
-        "type": "int",
-        "default": "0",
-        "mark": "连接设备限制"
-    },
-    {
-        "id": null,
-        "item": "connection_rate_limit",
-        "value": "0",
-        "class": "register",
-        "is_public": 0,
-        "type": "int",
-        "default": "0",
-        "mark": "使用速率限制"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_class",
-        "value": "0",
-        "class": "register",
-        "is_public": 0,
-        "type": "int",
-        "default": "0",
-        "mark": "注册时设定的等级"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_class_time",
-        "value": "7",
-        "class": "register",
-        "is_public": 0,
-        "type": "int",
-        "default": "7",
-        "mark": "注册时设定的等级过期时间(单位:天)"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_method",
-        "value": "chacha20-ietf",
-        "class": "register",
-        "is_public": 0,
-        "type": "string",
-        "default": "chacha20-ietf",
-        "mark": "默认加密"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_protocol",
-        "value": "auth_aes128_sha1",
-        "class": "register",
-        "is_public": 0,
-        "type": "string",
-        "default": "auth_aes128_sha1",
-        "mark": "默认协议"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_obfs",
-        "value": "http_simple",
-        "class": "register",
-        "is_public": 0,
-        "type": "string",
-        "default": "http_simple",
-        "mark": "默认混淆"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_protocol_param",
-        "value": "",
-        "class": "register",
-        "is_public": 0,
-        "type": "string",
-        "default": "",
-        "mark": "默认协议参数"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_obfs_param",
-        "value": "www.jd.hk",
-        "class": "register",
-        "is_public": 0,
-        "type": "string",
-        "default": "www.jd.hk",
-        "mark": "默认混淆参数"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_daily_report",
-        "value": "0",
-        "class": "register",
-        "is_public": 0,
-        "type": "bool",
-        "default": "0",
-        "mark": "注册后是否默认接收每日用量邮件推送"
-    },
-    {
-        "id": null,
-        "item": "sign_up_for_invitation_codes",
-        "value": "10",
-        "class": "register",
-        "is_public": 0,
-        "type": "int",
-        "default": "10",
-        "mark": "初始邀请注册链接使用次数限制"
-    },
-    {
-        "id": null,
-        "item": "invitation_to_register_balance_reward",
-        "value": "1",
-        "class": "invite",
-        "is_public": 1,
-        "type": "int",
-        "default": "1",
-        "mark": "邀请注册余额奖励(单位:元)"
-    },
-    {
-        "id": null,
-        "item": "invitation_to_register_traffic_reward",
-        "value": "10",
-        "class": "invite",
-        "is_public": 1,
-        "type": "int",
-        "default": "10",
-        "mark": "邀请注册流量奖励(单位:GB)"
-    },
     {
         "id": null,
         "item": "invitation_mode",
@@ -848,95 +438,5 @@
         "type": "int",
         "default": "180",
         "mark": "返利时间范围限制(单位:天)"
-    },
-    {
-        "id": null,
-        "item": "stripe_currency",
-        "value": "HKD",
-        "class": "stripe",
-        "is_public": 0,
-        "type": "string",
-        "default": "HKD",
-        "mark": "货币代码"
-    },
-    {
-        "id": null,
-        "item": "stripe_sk",
-        "value": "stripe_sk",
-        "class": "stripe",
-        "is_public": 0,
-        "type": "string",
-        "default": "stripe_sk",
-        "mark": "stripe_sk"
-    },
-    {
-        "id": null,
-        "item": "stripe_pk",
-        "value": "stripe_pk",
-        "class": "stripe",
-        "is_public": 0,
-        "type": "string",
-        "default": "stripe_pk",
-        "mark": "stripe_pk"
-    },
-    {
-        "id": null,
-        "item": "stripe_webhook_key",
-        "value": "stripe_webhook_key",
-        "class": "stripe",
-        "is_public": 0,
-        "type": "string",
-        "default": "stripe_webhook_key",
-        "mark": "web_hook密钥"
-    },
-    {
-        "id": null,
-        "item": "stripe_min_recharge",
-        "value": "10",
-        "class": "stripe",
-        "is_public": 1,
-        "type": "int",
-        "default": "10",
-        "mark": "最低充值限额"
-    },
-    {
-        "id": null,
-        "item": "stripe_card",
-        "value": "0",
-        "class": "stripe",
-        "is_public": 0,
-        "type": "bool",
-        "default": "0",
-        "mark": "银行卡支付"
-    },
-    {
-        "id": null,
-        "item": "stripe_alipay",
-        "value": "0",
-        "class": "stripe",
-        "is_public": 0,
-        "type": "bool",
-        "default": "0",
-        "mark": "支付宝支付"
-    },
-    {
-        "id": null,
-        "item": "stripe_wechat",
-        "value": "0",
-        "class": "stripe",
-        "is_public": 0,
-        "type": "bool",
-        "default": "0",
-        "mark": "微信支付"
-    },
-    {
-        "id": null,
-        "item": "stripe_max_recharge",
-        "value": "1000",
-        "class": "stripe",
-        "is_public": 1,
-        "type": "int",
-        "default": "1000",
-        "mark": "最高充值限额"
     }
 ]

+ 0 - 97
glzjin_all.sql

@@ -152,103 +152,6 @@ CREATE TABLE IF NOT EXISTS `config` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
 
-INSERT INTO `config` (`id`, `item`, `value`, `class`, `is_public`, `type`, `default`, `mark`) VALUES
-(1, 'payment_gateway', '[]', 'pay', 1, 'array', '[]', '支付网关'),
-(2, 'f2f_pay_app_id', '', 'f2f', 0, 'string', '', '当面付AppID'),
-(3, 'f2f_pay_pid', '', 'f2f', 0, 'string', '', '当面付PID'),
-(4, 'f2f_pay_public_key', '', 'f2f', 0, 'string', '', '当面付公钥'),
-(5, 'f2f_pay_private_key', '', 'f2f', 0, 'string', '', '当面付私钥'),
-(6, 'f2f_pay_notify_url', '', 'f2f', 0, 'string', '', '当面付自定义回调地址'),
-(9, 'vmq_gateway', '', 'vmq', 0, 'string', '', 'V免签网关'),
-(10, 'vmq_key', '', 'vmq', 0, 'string', '', 'V免签密钥'),
-(16, 'smtp_host', '', 'smtp', 0, 'string', '', 'smtp发信主机'),
-(17, 'smtp_username', '', 'smtp', 0, 'string', '', 'smtp账户名称'),
-(18, 'smtp_password', '', 'smtp', 0, 'string', '', 'smtp账户密码'),
-(19, 'smtp_port', '', 'smtp', 0, 'string', '', 'smtp发信端口'),
-(20, 'smtp_name', '', 'smtp', 0, 'string', '', 'smtp发信名称'),
-(21, 'smtp_sender', '', 'smtp', 0, 'string', '', 'smtp发信地址'),
-(22, 'smtp_ssl', '1', 'smtp', 0, 'bool', '1', '是否使用 TLS/SSL 发信'),
-(23, 'smtp_bbc', '', 'smtp', 0, 'string', '', '发给用户的邮件密送给指定邮箱备份'),
-(28, 'mail_driver', 'none', 'mail', 0, 'string', 'none', '邮件服务提供商'),
-(29, 'captcha_provider', 'recaptcha', 'captcha', 1, 'string', 'recaptcha', '验证码提供商'),
-(30, 'enable_reg_captcha', '0', 'captcha', 1, 'bool', '0', '注册验证码'),
-(31, 'enable_login_captcha', '0', 'captcha', 1, 'bool', '0', '登录验证码'),
-(32, 'enable_checkin_captcha', '0', 'captcha', 1, 'bool', '0', '签到验证码'),
-(33, 'recaptcha_sitekey', '', 'recaptcha', 0, 'string', '', 'reCaptcha网站密钥'),
-(34, 'recaptcha_secret', '', 'recaptcha', 0, 'string', '', 'reCaptcha密钥'),
-(35, 'geetest_id', '', 'geetest', 0, 'string', '', '极验id'),
-(36, 'geetest_key', '', 'geetest', 0, 'string', '', '极验密钥'),
-(37, 'mailgun_key', '', 'mailgun', 0, 'string', '', 'mailgun密钥'),
-(38, 'mailgun_domain', '', 'mailgun', 0, 'string', '', 'mailgun域名'),
-(39, 'mailgun_sender', '', 'mailgun', 0, 'string', '', 'mailgun发送者'),
-(40, 'sendgrid_key', '', 'sendgrid', 0, 'string', '', 'sendgrid密钥'),
-(41, 'sendgrid_sender', '', 'sendgrid', 0, 'string', '', 'sendgrid发件邮箱'),
-(42, 'sendgrid_name', '', 'sendgrid', 0, 'string', '', 'sendgrid发件人名称'),
-(43, 'aws_access_key_id', '', 'aws_ses', 0, 'string', '', 'aws密钥id'),
-(44, 'aws_secret_access_key', '', 'aws_ses', 0, 'string', '', 'aws密钥key'),
-(45, 'auto_backup_email', '', 'backup', 0, 'string', '', '接收备份的邮箱'),
-(46, 'auto_backup_password', '', 'backup', 0, 'string', '', '备份的压缩密码'),
-(47, 'payjs_mchid', '', 'payjs', 0, 'string', '', 'payjs_mchid'),
-(48, 'payjs_key', '', 'payjs', 0, 'string', '', 'payjs_key'),
-(49, 'enable_admin_contact', '0', 'contact', 1, 'bool', '0', '是否显示站长联系方式'),
-(50, 'admin_contact1', 'qq', 'contact', 1, 'string', 'qq', '站长联系方式一'),
-(51, 'admin_contact2', 'mail', 'contact', 1, 'string', 'mail', '站长联系方式二'),
-(52, 'admin_contact3', 'telegram', 'contact', 1, 'string', 'telegram', '站长联系方式三'),
-(53, 'tawk_id', '', 'live_chat', 1, 'string', '', 'tawk_id'),
-(54, 'crisp_id', '', 'live_chat', 1, 'string', '', 'crisp_id'),
-(55, 'livechat_id', '', 'live_chat', 1, 'string', '', 'livechat_id'),
-(56, 'mylivechat_id', '', 'live_chat', 1, 'string', '', 'mylivechat_id'),
-(57, 'live_chat', 'none', 'live_chat', 1, 'string', 'none', '客服系统开关'),
-(64, 'theadpay_url', '', 'theadpay', 0, 'string', '', 'theadpay_url'),
-(65, 'theadpay_mchid', '', 'theadpay', 0, 'string', '', 'theadpay_mchid'),
-(66, 'theadpay_key', '', 'theadpay', 0, 'string', '', 'theadpay_key'),
-(69, 'coinpay_appid', '', 'coinpay', 0, 'string', '', 'CoinPay应用ID'),
-(70, 'coinpay_secret', '', 'coinpay', 0, 'string', '', 'CoinPay验证密钥'),
-(73, 'user_center_bg', '0', 'personalise', 1, 'bool', '0', '是否启用自定义用户中心背景图片'),
-(74, 'admin_center_bg', '0', 'personalise', 1, 'bool', '0', '是否启用自定义管理中心背景图片'),
-(75, 'user_center_bg_addr', '/theme/material/css/images/bg/amber.jpg', 'personalise', 1, 'string', '/theme/material/css/images/bg/amber.jpg', '用户中心背景图片地址'),
-(76, 'admin_center_bg_addr', '/theme/material/css/images/bg/amber.jpg', 'personalise', 1, 'string', '/theme/material/css/images/bg/amber.jpg', '管理中心背景图片地址'),
-(83, 'pmw_publickey', '', 'pmw', 0, 'string', '', 'pmw公钥'),
-(84, 'pmw_privatekey', '', 'pmw', 0, 'string', '', 'pmw私钥'),
-(85, 'pmw_widget', 'm2_1', 'pmw', 0, 'string', 'm2_1', 'pmw_widget'),
-(86, 'pmw_height', '350px', 'pmw', 0, 'string', '350px', 'pmw_height'),
-(90, 'auto_backup_notify', '0', 'backup', 0, 'bool', '0', '备份是否通知到TG群中'),
-(91, 'reg_mode', 'open', 'register', 1, 'string', 'open', '注册模式'),
-(92, 'reg_email_verify', '0', 'register', 1, 'bool', '0', '邮箱验证'),
-(93, 'email_verify_ttl', '3600', 'register', 0, 'int', '3600', '邮箱验证码有效期'),
-(94, 'email_verify_ip_limit', '5', 'register', 0, 'int', '5', '验证码有效期内单个ip可请求的发信次数'),
-(95, 'sign_up_for_free_traffic', '20', 'register', 0, 'int', '20', '注册时赠送的流量(单位:GB)'),
-(96, 'sign_up_for_free_time', '7', 'register', 0, 'int', '7', '注册时赠送的时长(单位:天)'),
-(99, 'connection_device_limit', '0', 'register', 0, 'int', '0', '连接设备限制'),
-(100, 'connection_rate_limit', '0', 'register', 0, 'int', '0', '使用速率限制'),
-(101, 'sign_up_for_class', '0', 'register', 0, 'int', '0', '注册时设定的等级'),
-(102, 'sign_up_for_class_time', '7', 'register', 0, 'int', '7', '注册时设定的等级过期时间(单位:天)'),
-(103, 'sign_up_for_method', 'chacha20-ietf', 'register', 0, 'string', 'chacha20-ietf', '默认加密'),
-(104, 'sign_up_for_protocol', 'auth_aes128_sha1', 'register', 0, 'string', 'auth_aes128_sha1', '默认协议'),
-(105, 'sign_up_for_obfs', 'http_simple', 'register', 0, 'string', 'http_simple', '默认混淆'),
-(106, 'sign_up_for_protocol_param', '', 'register', 0, 'string', '', '默认协议参数'),
-(107, 'sign_up_for_obfs_param', 'www.jd.hk', 'register', 0, 'string', 'www.jd.hk', '默认混淆参数'),
-(108, 'sign_up_for_daily_report', '0', 'register', 0, 'bool', '0', '注册后是否默认接收每日用量邮件推送'),
-(112, 'sign_up_for_invitation_codes', '10', 'register', 0, 'int', '10', '初始邀请注册链接使用次数限制'),
-(113, 'invitation_to_register_balance_reward', '1', 'invite', 1, 'int', '1', '邀请注册余额奖励(单位:元)'),
-(114, 'invitation_to_register_traffic_reward', '10', 'invite', 1, 'int', '10', '邀请注册流量奖励(单位:GB)'),
-(115, 'invitation_mode', 'after_recharge', 'invite', 0, 'string', 'after_purchase', '邀请模式'),
-(116, 'invite_rebate_mode', 'limit_frequency', 'invite', 0, 'string', 'limit_amount', '返利模式'),
-(117, 'rebate_frequency_limit', '6', 'invite', 0, 'string', '3', '返利总次数限制'),
-(118, 'rebate_amount_limit', '9', 'invite', 0, 'int', '100', '返利总金额限制'),
-(119, 'rebate_ratio', '0.2', 'invite', 1, 'string', '0.2', '返利比例'),
-(120, 'rebate_time_range_limit', '180', 'invite', '0', 'int', '180', '返利时间范围限制(单位:天)'),
-(121, 'stripe_currency', 'GBP', 'stripe', 0, 'string', 'HKD', '货币代码'),
-(122, 'stripe_sk', 'stripe_sk', 'stripe', 0, 'string', 'stripe_sk', 'stripe_sk'),
-(123, 'stripe_pk', 'stripe_pk', 'stripe', 0, 'string', 'stripe_pk', 'stripe_pk'),
-(124, 'stripe_webhook_key', 'stripe_webhook_key', 'stripe', 0, 'string', 'stripe_webhook_key', 'web_hook密钥'),
-(125, 'stripe_min_recharge', '10', 'stripe', 1, 'int', '10', '最低充值限额'),
-(126, 'stripe_card', '0', 'stripe', 0, 'bool', '0', '银行卡支付'),
-(127, 'stripe_alipay', '0', 'stripe', 0, 'bool', '0', '支付宝支付'),
-(128, 'stripe_wechat', '0', 'stripe', 0, 'bool', '0', '微信支付'),
-(129, 'stripe_max_recharge', '1000', 'stripe', 1, 'int', '1000', '最高充值限额');
-
-
 CREATE TABLE IF NOT EXISTS `coupon` (
   `id` bigint(20) NOT NULL AUTO_INCREMENT,
   `code` text COLLATE utf8mb4_unicode_ci NOT NULL,

+ 2 - 58
src/Controllers/Admin/SettingController.php

@@ -1,18 +1,9 @@
 <?php
-
 namespace App\Controllers\Admin;
 
 use App\Controllers\AdminController;
-use App\Models\{
-    Setting
-};
-use Slim\Http\{
-    Request,
-    Response
-};
-use App\Services\{
-    Mail
-};
+use App\Models\Setting;
+use App\Services\Mail;
 
 class SettingController extends AdminController
 {
@@ -34,8 +25,6 @@ class SettingController extends AdminController
             $this->view()
                 //->registerClass('Setting', Setting::class)
                 ->assign('settings', $config)
-                ->assign('payment_gateways', self::return_gateways_list())
-                ->assign('active_payment_gateway', self::return_active_gateways())
                 ->display('admin/setting.tpl')
         );
     }
@@ -136,49 +125,4 @@ class SettingController extends AdminController
             'msg' => '测试邮件发送成功'
         ]);
     }
-
-    public function return_gateways_list()
-    {
-        $payment_gateways = array(
-            // 网关名 网关代号
-            "CoinPay" => "coinpay",
-            "当面付" => "f2fpay",
-            "PayJs" => "payjs",
-            "PaymentWall" => "paymentwall",
-            "Stripe" => "stripe",
-            "TheadPay" => "theadpay",
-            "V免签" => "vmqpay"
-        );
-
-        return $payment_gateways;
-    }
-
-    public function return_active_gateways()
-    {
-        $payment_gateways = Setting::where('item', '=', 'payment_gateway')->first();
-        $active_gateways = json_decode($payment_gateways->value);
-        return $active_gateways;
-    }
-
-    public function payment($request, $response, $args)
-    {
-        $gateway_in_use = array();
-        $payment_gateways = self::return_gateways_list();
-        foreach ($payment_gateways as $key => $value)
-        {
-            $payment_switch = $request->getParam("$value");
-            if ($payment_switch == '1') {
-                array_push($gateway_in_use, $value);
-            }
-        }
-
-        $gateway = Setting::where('item', '=', 'payment_gateway')->first();
-        $gateway->value = json_encode($gateway_in_use);
-        $gateway->save();
-
-        return $response->withJson([
-            'ret' => 1,
-            'msg' => "保存成功"
-        ]);
-    }
 }