Browse Source

Minor tweaks

兔姬桑 2 years ago
parent
commit
051267b3c7

+ 1 - 1
app/Http/Controllers/Admin/ArticleController.php

@@ -15,7 +15,7 @@ class ArticleController extends Controller
     // 文章列表
     public function index()
     {
-        return view('admin.article.index', ['articles' => Article::orderByDesc('sort')->paginate()->appends(request('page'))]);
+        return view('admin.article.index', ['articles' => Article::latest()->orderByDesc('sort')->paginate()->appends(request('page'))]);
     }
 
     // 添加文章页面

+ 1 - 1
app/Http/Controllers/Api/Client/ClientController.php

@@ -271,7 +271,7 @@ class ClientController extends Controller
             'client.name'            => sysConfig('website_name'),
             'client.node_class_name' => Level::all()->pluck('name', 'level')->toArray(),
             'client.baseUrl'         => sysConfig('website_url'),
-            'client.subscribe_url'   => sysConfig('web_api_url') ?? sysConfig('website_url'),
+            'client.subscribe_url'   => sysConfig('subscribe_domain') ?: sysConfig('website_url'),
             'client.checkinMin'      => sysConfig('min_rand_traffic'),
             'client.checkinMax'      => sysConfig('max_rand_traffic'),
             'client.invite_gift'     => sysConfig('default_traffic') / 1024,

+ 1 - 1
app/Http/Controllers/UserController.php

@@ -67,7 +67,7 @@ class UserController extends Controller
             'expireTime'       => $user->expiration_date,
             'banedTime'        => $user->ban_time,
             'unusedPercent'    => $totalTransfer > 0 ? round($unusedTraffic / $totalTransfer, 2) * 100 : 0,
-            'announcements'    => Article::type(2)->take(5)->latest()->Paginate(1), // 公告
+            'announcements'    => Article::type(2)->latest()->simplePaginate(1), // 公告
             'isTrafficWarning' => $user->isTrafficWarning(), // 流量异常判断
             'paying_user'      => $user->activePayingUser(), // 付费用户判断
             'userLoginLog'     => $user->loginLogs()->latest()->first(), // 近期登录日志

+ 1 - 1
database/migrations/2020_12_07_120247_permission_data.php

@@ -138,7 +138,7 @@ class PermissionData extends Migration
         }
 
         Schema::table('user', function (Blueprint $table) {
-            $table->dropColumn(['is_admin']);
+            $table->dropColumn('is_admin');
         });
     }
 

+ 1 - 1
database/migrations/2021_06_23_103914_append_telegram_id_to_user_table.php

@@ -28,7 +28,7 @@ class AppendTelegramIdToUserTable extends Migration
     public function down()
     {
         Schema::table('user', function (Blueprint $table) {
-            $table->dropColumn(['telegram_id']);
+            $table->dropColumn('telegram_id');
         });
     }
 }

+ 1 - 1
database/migrations/2021_06_27_174304_append_v2_sni_to_node_table.php

@@ -26,7 +26,7 @@ class AppendV2SniToNodeTable extends Migration
     public function down()
     {
         Schema::table('node', function (Blueprint $table) {
-            $table->dropColumn(['v2_sni']);
+            $table->dropColumn('v2_sni');
         });
     }
 }

+ 1 - 1
database/migrations/2021_07_13_190753_rm_telegram_in_user_table.php

@@ -14,7 +14,7 @@ class RmTelegramInUserTable extends Migration
     public function up()
     {
         Schema::table('user', function (Blueprint $table) {
-            $table->dropColumn(['telegram_id']);
+            $table->dropColumn('telegram_id');
         });
     }
 

+ 1 - 1
database/migrations/2021_07_23_151321_append_speed_limit_goods_table.php

@@ -26,7 +26,7 @@ class AppendSpeedLimitGoodsTable extends Migration
     public function down()
     {
         Schema::table('goods', function (Blueprint $table) {
-            $table->dropColumn(['speed_limit']);
+            $table->dropColumn('speed_limit');
         });
     }
 }

+ 1 - 1
database/migrations/2021_07_24_214642_create_goods_category_table.php

@@ -36,7 +36,7 @@ class CreateGoodsCategoryTable extends Migration
     {
         Schema::dropIfExists('goods_category');
         Schema::table('goods', function (Blueprint $table) {
-            $table->dropColumn(['category_id']);
+            $table->dropColumn('category_id');
         });
     }
 }

+ 1 - 1
routes/api.php

@@ -1,7 +1,7 @@
 <?php
 
 // 后端WEBAPI
-Route::group(['namespace' => 'Api\WebApi', 'middleware' => 'webApi', 'domain' => sysConfig('web_api_url') ?? sysConfig('website_url')], function () {
+Route::group(['namespace' => 'Api\WebApi', 'middleware' => 'webApi', 'domain' => sysConfig('web_api_url') ?: sysConfig('website_url')], function () {
     // ss后端WEBAPI V1版
     Route::group(['prefix' => 'ss/v1'], function () {
         Route::get('node/{node}', 'SSController@getNodeInfo'); // 获取节点信息