Browse Source

feat: clearer config.json value mark

M1Screw 2 years ago
parent
commit
8bc274d183

+ 0 - 5
config/.config.example.php

@@ -72,7 +72,6 @@ $_ENV['Subscribe']                  = true;                         //本站是
 $_ENV['subUrl']                     = $_ENV['baseUrl'];             //订阅地址,如需和站点名称相同,请不要修改
 $_ENV['enable_forced_replacement']  = true;                         //用户修改账户登录密码时,是否强制更换订阅地址
 
-
 //审计自动封禁设置--------------------------------------------------------------------------------------------
 $_ENV['enable_auto_detect_ban']      = false;       // 审计自动封禁开关
 $_ENV['auto_detect_ban_numProcess']  = 300;         // 单次计划任务中审计记录的处理数量
@@ -109,7 +108,6 @@ $_ENV['auto_detect_ban'] = [
     ]
 ];
 
-
 //Bot 设置--------------------------------------------------------------------------------------------
 # Telegram bot
 $_ENV['enable_telegram']                    = false;        //是否开启 Telegram bot
@@ -126,9 +124,6 @@ $_ENV['mail_ticket']          = true;        //是否开启工单邮件提醒
 $_ENV['useScFtqq']            = false;        //是否开启Server酱提醒工单/节点上下线
 $_ENV['ScFtqq_SCKEY']         = '';           //请填写您在Server酱获取的SCKEY  请仔细检查勿粘贴错
 
-#后台商品列表 销量统计
-$_ENV['sales_period']         = 30;             //统计指定周期内的销量,值为【expire/任意大于0的整数】
-
 //节点检测-----------------------------------------------------------------------------------------------
 #GFW检测,请通过crontab进行【开启/关闭】
 $_ENV['detect_gfw_interval']             = 3600;                                                               //检测间隔,单位:秒,低于推荐值会爆炸

+ 23 - 53
config/settings.json

@@ -507,7 +507,17 @@
         "is_public": 0,
         "type": "string",
         "default": "",
-        "mark": "mailgun发送者"
+        "mark": "mailgun发件邮箱"
+    },
+    {
+        "id": null,
+        "item": "mailgun_sender_name",
+        "value": "",
+        "class": "mailgun",
+        "is_public": 0,
+        "type": "string",
+        "default": "",
+        "mark": "mailgun发信人名称"
     },
     {
         "id": null,
@@ -619,46 +629,6 @@
         "default": "",
         "mark": "aws ses发送者"
     },
-    {
-        "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",
@@ -857,17 +827,17 @@
         "is_public": 0,
         "type": "int",
         "default": "20",
-        "mark": "注册时赠送的流量(单位:GB)"
+        "mark": "注册时赠送的流量(GB)"
     },
     {
         "id": null,
         "item": "sign_up_for_free_time",
-        "value": "7",
+        "value": "365",
         "class": "register",
         "is_public": 0,
         "type": "int",
-        "default": "7",
-        "mark": "注册时赠送的时长(单位:天)"
+        "default": "365",
+        "mark": "注册时设定的账户有效期(天)"
     },
     {
         "id": null,
@@ -877,7 +847,7 @@
         "is_public": 0,
         "type": "int",
         "default": "0",
-        "mark": "连接 IP 限制"
+        "mark": "注册时设定的连接 IP 限制"
     },
     {
         "id": null,
@@ -887,7 +857,7 @@
         "is_public": 0,
         "type": "int",
         "default": "0",
-        "mark": "使用速率限制"
+        "mark": "注册时设定的使用速率限制"
     },
     {
         "id": null,
@@ -907,16 +877,16 @@
         "is_public": 0,
         "type": "int",
         "default": "7",
-        "mark": "注册时设定的等级过期时间(单位:天)"
+        "mark": "注册时设定的等级过期时间(天)"
     },
     {
         "id": null,
         "item": "sign_up_for_method",
-        "value": "chacha20-ietf",
+        "value": "aes-128-gcm",
         "class": "register",
         "is_public": 0,
         "type": "string",
-        "default": "chacha20-ietf",
+        "default": "aes-128-gcm",
         "mark": "默认加密"
     },
     {
@@ -947,7 +917,7 @@
         "is_public": 1,
         "type": "int",
         "default": "1",
-        "mark": "邀请注册余额奖励(单位:元)"
+        "mark": "邀请注册余额奖励(元)"
     },
     {
         "id": null,
@@ -957,7 +927,7 @@
         "is_public": 1,
         "type": "int",
         "default": "10",
-        "mark": "邀请注册流量奖励(单位:GB)"
+        "mark": "邀请注册流量奖励(GB)"
     },
     {
         "id": null,
@@ -1017,7 +987,7 @@
         "is_public": 0,
         "type": "int",
         "default": "180",
-        "mark": "返利时间范围限制(单位:天)"
+        "mark": "返利时间范围限制(天)"
     },
     {
         "id": null,

+ 7 - 1
resources/views/tabler/admin/setting/email.tpl

@@ -181,6 +181,12 @@
                                         <input id="mailgun_sender" type="text" class="form-control" value="{$settings['mailgun_sender']}">
                                     </div>
                                 </div>
+                                 <div class="form-group mb-3 row">
+                                    <label class="form-label col-3 col-form-label">Mailgun 发信人名称</label>
+                                    <div class="col">
+                                        <input id="mailgun_sender_name" type="text" class="form-control" value="{$settings['mailgun_sender_name']}">
+                                    </div>
+                                </div>
                             </div>
                         </div>
                         <div class="tab-pane" id="postal">
@@ -290,4 +296,4 @@
     });
 </script>
 
-{include file='admin/tabler_footer.tpl'}
+{include file='admin/tabler_footer.tpl'}

+ 0 - 34
resources/views/tabler/admin/setting/support.tpl

@@ -33,9 +33,6 @@
                         <li class="nav-item">
                             <a href="#support" class="nav-link active" data-bs-toggle="tab">网页客服系统</a>
                         </li>
-                        <li class="nav-item">
-                            <a href="#admin_contact" class="nav-link" data-bs-toggle="tab">管理员联络方式</a>
-                        </li>
                     </ul>
                 </div>
                 <div class="card-body">
@@ -80,37 +77,6 @@
                                 </div>
                             </div>
                         </div>
-                        <div class="tab-pane" id="admin_contact">
-                            <div class="card-body">
-                                <div class="form-group mb-3 row">
-                                    <label class="form-label col-3 col-form-label">是否显示管理员联系方式</label>
-                                    <div class="col">
-                                        <select id="enable_admin_contact" class="col form-select" value="{$settings['enable_admin_contact']}">
-                                            <option value="0" {if $settings['enable_admin_contact'] == false}selected{/if}>关闭</option>
-                                            <option value="1" {if $settings['enable_admin_contact'] == true}selected{/if}>开启</option>
-                                        </select>
-                                    </div>
-                                </div>
-                                <div class="form-group mb-3 row">
-                                    <label class="form-label col-3 col-form-label">联系方式一</label>
-                                    <div class="col">
-                                        <input id="admin_contact1" type="text" class="form-control" value="{$settings['admin_contact1']}">
-                                    </div>
-                                </div>
-                                <div class="form-group mb-3 row">
-                                    <label class="form-label col-3 col-form-label">联系方式二</label>
-                                    <div class="col">
-                                        <input id="admin_contact2" type="text" class="form-control" value="{$settings['admin_contact2']}">
-                                    </div>
-                                </div>
-                                <div class="form-group mb-3 row">
-                                    <label class="form-label col-3 col-form-label">联系方式三</label>
-                                    <div class="col">
-                                        <input id="admin_contact3" type="text" class="form-control" value="{$settings['admin_contact3']}">
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
                     </div>
                 </div>
             </div>

+ 4 - 4
src/Command/Cron.php

@@ -9,7 +9,6 @@ use App\Models\Order;
 use App\Models\User;
 use App\Utils\Tools;
 use DateTime;
-use Exception;
 use function count;
 use function in_array;
 use function json_decode;
@@ -78,9 +77,10 @@ EOL;
                 $user->last_day_t = 0;
                 $user->transfer_enable = Tools::toGB($content->bandwidth);
                 $user->class = $content->class;
-                $now = new DateTime();
-                $user->expire_in = $now->modify('+' . $content->time . ' days')->format('Y-m-d H:i:s');
-                $user->class_expire = $now->modify('+' . $content->class_time . ' days')->format('Y-m-d H:i:s');
+                $old_expire_in = new DateTime();
+                $old_class_expire = new DateTime();
+                $user->expire_in = $old_expire_in->modify('+' . $content->time . ' days')->format('Y-m-d H:i:s');
+                $user->class_expire = $old_class_expire->modify('+' . $content->class_time . ' days')->format('Y-m-d H:i:s');
                 $user->node_group = $content->node_group;
                 $user->node_speedlimit = $content->speed_limit;
                 $user->node_iplimit = $content->ip_limit;

+ 1 - 0
src/Controllers/Admin/Setting/EmailController.php

@@ -28,6 +28,7 @@ final class EmailController extends BaseController
         'mailgun_key',
         'mailgun_domain',
         'mailgun_sender',
+        'mailgun_sender_name',
         // Sendgrid
         'sendgrid_key',
         'sendgrid_sender',

+ 0 - 5
src/Controllers/Admin/Setting/SupportController.php

@@ -17,11 +17,6 @@ final class SupportController extends BaseController
         'crisp_id',
         'livechat_id',
         'mylivechat_id',
-        // Admin Contact
-        'enable_admin_contact',
-        'admin_contact1',
-        'admin_contact2',
-        'admin_contact3',
     ];
 
     /**

+ 0 - 20
src/Models/Shop.php

@@ -203,26 +203,6 @@ final class Shop extends Model
         return $this->reset() !== 0 && $this->resetValue() !== 0 && $this->resetExp() !== 0;
     }
 
-    /*
-     * 获取周期商品销量
-     */
-    public function getSales(): int
-    {
-        $period = $_ENV['sales_period'];
-        if ($period === 'expire') {
-            $period = $this->content['class_expire'];
-        }
-        return Bought::where('shopid', $this->id)->where('datetime', '>', time() - $period * 86400)->count();
-    }
-
-    /*
-     * 自动续费时间
-     */
-    public function autoRenew(): string
-    {
-        return $this->auto_renew === 0 ? '不自动续费' : $this->auto_renew . ' 天后续费';
-    }
-
     /*
      * 流量是否自动重置
      */

+ 2 - 2
src/Services/Mail/Mailgun.php

@@ -22,7 +22,7 @@ final class Mailgun extends Base
         $this->config = $this->getConfig();
         $this->mg = MailgunService::create($this->config['key']);
         $this->domain = $this->config['domain'];
-        $this->sender = $this->config['sender'];
+        $this->sender = $this->config['sender_name'] . ' <' . $this->config['sender'] . '>';
     }
 
     public function getConfig(): array
@@ -33,13 +33,13 @@ final class Mailgun extends Base
             'key' => $configs['mailgun_key'],
             'domain' => $configs['mailgun_domain'],
             'sender' => $configs['mailgun_sender'],
+            'sender_name' => $configs['mailgun_sender_name'],
         ];
     }
 
     /**
      * @throws Exception
      * @throws ClientExceptionInterface
-     * @throws ClientExceptionInterface
      */
     public function send($to, $subject, $text, $file): void
     {