Kirin 2 tháng trước cách đây
mục cha
commit
cf171ac7b0

+ 1 - 0
.well-known/acme-challenge/eme2VLoMh_uIZYncl6jGADK98RypJHJFSrM2BWDl-9I

@@ -0,0 +1 @@
+eme2VLoMh_uIZYncl6jGADK98RypJHJFSrM2BWDl-9I.YMrHxL1yKpyDLB6ndbcaLWefmk1-me2IFkoxdriKMyI

+ 28 - 1
README.md

@@ -1,4 +1,4 @@
-七牛SDK for PHP
+七牛Base
 ===============
 
 > 运行环境要求PHP7.2+,兼容PHP8.1
@@ -27,6 +27,10 @@ php think make
 -f/-force  默认不强制执行,值为1时强制执行,强制覆盖原有文件或删除
 ~~~
 
+~~~
+-s/-sort  指定排序字段,默认为sort,降序。
+~~~
+
 ~~~
 -d/-delete  删除模式,值为1时,删除对应4个文件
 ~~~
@@ -59,3 +63,26 @@ export 导出,导出字段在生成Service时有默认设置,按需要自行
 
 * 数据库的建立
 
+数据库表规则:
+
+###### <h>一、特殊字段</h>
+
+1. `add_time`:添加时间字段,存在这个字段的表会自动添加时间搜索器以及时间自动格式化方法,无需手动处理。
+2. `delete_time`:删除标记字段,存在这个字段的表会自动添加软删除,无需手动处理。
+3. `sort`:自定义排序字段,存在这个字段的表会优先按照该字段降序排列,否则默认按主键降序排列,再模型中存在$order参数,可以自定义排序规则。
+
+###### <h>二、特殊后缀|类型</h>
+
+1. 以`images`,`ids`,`files`,`list`为后缀的字段,会识别为列表字段
+2. 以`time`为后缀的字段,以及,会识别为时间字段,自动格式化`Y-m-d H:i:s`格式
+3. 以`phone`,`mobile`为后缀的字段,会识别为手机号字段,自动生成手机号验证规则
+4. 以`email`为后缀的字段,会识别为邮箱字段,自动生成邮箱验证规则
+5. 以`url`,`link`为后缀的字段,会识别为链接字段,自动生成链接验证规则
+6. `set`类型的字段,会识别为多选字段,对注释有要求(详见三)
+7. `enum`类型的字段,会识别为单选字段,对注释有要求(详见三)
+
+###### <h>三、注释</h>
+1. 尽量明确标注字段含义。
+2. 多选字段,请使用`set`类型,并标注每个值所代表的含义,如:`types`字段,注释:`类型:1=类型1,2=类型2,3=类型3……`
+3. 单选字段,请使用`enum`/`tinyint`类型,并标注每个值所代表的含义,如:`sex`字段,注释:`性别:1=男,2=女,0=保密`
+4. 表注释内标注一下表名。

+ 1 - 0
app/controller/admin/system/config/SystemConfigTab.php

@@ -46,6 +46,7 @@ class SystemConfigTab extends AdminBaseController
         $this->createParams = [
             'status',
             ['title', ''],
+            ['en_title', ''],
             'icon',
             ['sort', 0],
             ['info', ''],

+ 2 - 1
composer.json

@@ -49,7 +49,8 @@
     "alibabacloud/dysmsapi-20170525": "^3.1",
     "ext-iconv": "*",
     "ext-openssl": "*",
-    "overtrue/wechat": "^5.30"
+    "overtrue/wechat": "^5.30",
+    "joypack/tencent-map": "^1.0"
   },
   "require-dev": {
     "symfony/var-dumper": "^4.2",

+ 43 - 1
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "1d7665e11930eb82a0d1eea7365ad334",
+    "content-hash": "3c25113d4e7779b07a99a823888cd33c",
     "packages": [
         {
             "name": "adbario/php-dot-notation",
@@ -2013,6 +2013,48 @@
             ],
             "time": "2022-05-21T17:30:32+00:00"
         },
+        {
+            "name": "joypack/tencent-map",
+            "version": "1.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://gitee.com/lphkxd/tencent-map",
+                "reference": "97c0269086d53dbecb9c3c6e1d2717645d7940a8"
+            },
+            "require": {
+                "php": ">=5.6"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Joypack\\Tencent\\Map\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "堪笑",
+                    "email": "jixiang.f@gmail.com",
+                    "homepage": "http://cli.life",
+                    "role": "Developer"
+                }
+            ],
+            "description": "腾讯位置服务(WebService)",
+            "homepage": "https://github.com/joypack/tencent-map",
+            "keywords": [
+                "LBS",
+                "腾讯位置服务"
+            ],
+            "support": {
+                "email": "jixiang.f@gmail.com",
+                "issues": "https://github.com/joypack/tencent-map/issues",
+                "wiki": "https://github.com/joypack/tencent-map/wiki"
+            },
+            "time": "2021-11-16T06:49:35+00:00"
+        },
         {
             "name": "league/flysystem",
             "version": "1.1.10",

+ 8 - 17
qiniu/command/MakeAdmin.php

@@ -37,11 +37,7 @@ class MakeAdmin extends Command
 
     private $deleteTimeField = 'delete_time';
     private $addTimeField = 'add_time';
-
-    /**
-     * Enum类型识别为单选框的结尾字符,默认会识别为单选下拉列表
-     */
-    protected $enumRadioSuffix = ['state', 'status'];
+    private $sortField = 'sort';
 
     /**
      * Int类型识别为日期时间的结尾字符,默认会识别为日期文本框
@@ -53,10 +49,6 @@ class MakeAdmin extends Command
      */
     protected $intListSuffix = ['images', 'ids', 'list'];
 
-    /**
-     * 开关后缀
-     */
-    protected $switchSuffix = ['switch'];
 
     protected function configure()
     {
@@ -67,6 +59,7 @@ class MakeAdmin extends Command
             ->addOption('hidden', 'x', Option::VALUE_OPTIONAL, 'hidden fields', null)
             ->addOption('force', 'f', Option::VALUE_OPTIONAL, 'force replace file', null)
             ->addOption('delete', 'd', Option::VALUE_OPTIONAL, 'delete all files', null)
+            ->addOption('sort', 's', Option::VALUE_OPTIONAL, 'sort field', null)
             ->setDescription('Create a new table class');
     }
 
@@ -81,6 +74,7 @@ class MakeAdmin extends Command
         $force = $input->getOption('force');
         $hidden = $input->getOption('hidden');
         $delete = $input->getOption('delete');
+        $sortField = $input->getOption('sort');
         $hidden = str_replace(',', ',', $hidden);
         $hidden = explode(',', $hidden);
         array_push($hidden, $this->deleteTimeField);
@@ -205,6 +199,7 @@ class MakeAdmin extends Command
             $searchFieldAttr = [];
             $validateMessage = [];
             $createParams = [];
+            $order = '';
 
             //循环所有字段,开始构造视图的HTML和JS信息
             foreach ($columnList as $k => $v) {
@@ -243,6 +238,9 @@ class MakeAdmin extends Command
                         }
                         $this->searchAttr($searchFieldAttr, 'time');
                         $exportAttr[$field] = $langList[$field] ?? '添加时间';
+                    } else if ($sortField && $field == $sortField || !$sortField && $field == $this->sortField) {
+                        $exportAttr[$field] = $langList[$field] ?? '排序';
+                        $order = 'protected $order = ' . "'{$field} desc,{$priKey} desc';";
                     } else {
                         $inputType = $this->getFieldType($v);
                         // 如果默认值非null,则是一个必选项
@@ -313,6 +311,7 @@ class MakeAdmin extends Command
                 'createParams' => implode(",\n\t", $createParams),
                 'searchFieldAttr' => implode(",\n\t", $searchFieldAttr),
                 'searchAttrList' => implode("\n\n", $searchAttr),
+                'order' => $order
             ];
 
             // 生成控制器文件
@@ -682,17 +681,9 @@ EOD;
             $inputType = 'datetime';
         }
         // 指定后缀结尾且类型为enum,说明是个单选框
-        if ($this->isMatchSuffix($fieldsName, $this->enumRadioSuffix) && $v['DATA_TYPE'] == 'enum') {
-            $inputType = "select";
-        }
-        // 指定后缀结尾且类型为enum,说明是个单选框
         if ($this->isMatchSuffix($fieldsName, $this->intListSuffix)) {
             $inputType = "list";
         }
-        // 指定后缀结尾且类型为char或tinyint且长度为1,说明是个Switch复选框
-        if ($this->isMatchSuffix($fieldsName, $this->switchSuffix) && ($v['COLUMN_TYPE'] == 'tinyint(1)' || $v['COLUMN_TYPE'] == 'char(1)') && $v['COLUMN_DEFAULT'] !== '' && $v['COLUMN_DEFAULT'] !== null) {
-            $inputType = "select";
-        }
         return $inputType;
     }
 

+ 2 - 0
qiniu/command/stubs/model.stub

@@ -35,6 +35,8 @@ class {%modelName%} extends BaseModel
     //主键
     protected $pk = '{%pk%}';
 
+    {%order%}
+
     //隐藏属性
     protected $hidden = [
     {%hiddenArrList%}

+ 11 - 2
vendor/composer/InstalledVersions.php

@@ -32,7 +32,7 @@ private static $installed = array (
     'aliases' => 
     array (
     ),
-    'reference' => 'bee03ef08529625c3d2c2e0f834fb50d19250ec7',
+    'reference' => '112be7bd5706bbe9c1613a275449ef82d8aa53ba',
     'name' => 'topthink/think',
   ),
   'versions' => 
@@ -298,6 +298,15 @@ private static $installed = array (
       ),
       'reference' => '04be355f8d6734c826045d02a1079ad658322dad',
     ),
+    'joypack/tencent-map' => 
+    array (
+      'pretty_version' => '1.0.0',
+      'version' => '1.0.0.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '97c0269086d53dbecb9c3c6e1d2717645d7940a8',
+    ),
     'league/flysystem' => 
     array (
       'pretty_version' => '1.1.10',
@@ -880,7 +889,7 @@ private static $installed = array (
       'aliases' => 
       array (
       ),
-      'reference' => 'bee03ef08529625c3d2c2e0f834fb50d19250ec7',
+      'reference' => '112be7bd5706bbe9c1613a275449ef82d8aa53ba',
     ),
     'topthink/think-captcha' => 
     array (

+ 2 - 2
vendor/composer/autoload_files.php

@@ -23,11 +23,11 @@ return array(
     '2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
     '9a31621970d4295d5f00acf4e277e6f9' => $vendorDir . '/stechstudio/backoff/src/helpers.php',
     'cc56288302d9df745d97c934d6a6e5f0' => $vendorDir . '/topthink/think-queue/src/common.php',
+    'f0e7e63bbb278a92db02393536748c5f' => $vendorDir . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
+    '6747f579ad6817f318cc3a7e7a0abb93' => $vendorDir . '/overtrue/wechat/src/Kernel/Helpers.php',
     'cd5441689b14144e5573bf989ee47b34' => $vendorDir . '/qcloud/cos-sdk-v5/src/Common.php',
     '841780ea2e1d6545ea3a253239d59c05' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/functions.php',
     '5dd19d8a547b7318af0c3a93c8bd6565' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Http/Middleware/Middleware.php',
     '1cfd2761b63b0a29ed23657ea394cb2d' => $vendorDir . '/topthink/think-captcha/src/helper.php',
     'af46dcea2921209ac30627b964175f13' => $vendorDir . '/topthink/think-swoole/src/helpers.php',
-    'f0e7e63bbb278a92db02393536748c5f' => $vendorDir . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
-    '6747f579ad6817f318cc3a7e7a0abb93' => $vendorDir . '/overtrue/wechat/src/Kernel/Helpers.php',
 );

+ 1 - 0
vendor/composer/autoload_psr4.php

@@ -56,6 +56,7 @@ return array(
     'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'),
     'League\\Flysystem\\Cached\\' => array($vendorDir . '/league/flysystem-cached-adapter/src'),
     'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'),
+    'Joypack\\Tencent\\Map\\' => array($vendorDir . '/joypack/tencent-map/src'),
     'Intervention\\Image\\' => array($vendorDir . '/intervention/image/src/Intervention/Image'),
     'GuzzleHttp\\UriTemplate\\' => array($vendorDir . '/guzzlehttp/uri-template/src'),
     'GuzzleHttp\\Stream\\' => array($vendorDir . '/guzzlehttp/streams/src'),

+ 10 - 2
vendor/composer/autoload_static.php

@@ -24,13 +24,13 @@ class ComposerStaticInit0ef01221f70f4fb275871418332d8a66
         '2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
         '9a31621970d4295d5f00acf4e277e6f9' => __DIR__ . '/..' . '/stechstudio/backoff/src/helpers.php',
         'cc56288302d9df745d97c934d6a6e5f0' => __DIR__ . '/..' . '/topthink/think-queue/src/common.php',
+        'f0e7e63bbb278a92db02393536748c5f' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
+        '6747f579ad6817f318cc3a7e7a0abb93' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Helpers.php',
         'cd5441689b14144e5573bf989ee47b34' => __DIR__ . '/..' . '/qcloud/cos-sdk-v5/src/Common.php',
         '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
         '5dd19d8a547b7318af0c3a93c8bd6565' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Http/Middleware/Middleware.php',
         '1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php',
         'af46dcea2921209ac30627b964175f13' => __DIR__ . '/..' . '/topthink/think-swoole/src/helpers.php',
-        'f0e7e63bbb278a92db02393536748c5f' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
-        '6747f579ad6817f318cc3a7e7a0abb93' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Helpers.php',
     );
 
     public static $prefixLengthsPsr4 = array (
@@ -120,6 +120,10 @@ class ComposerStaticInit0ef01221f70f4fb275871418332d8a66
             'League\\Flysystem\\Cached\\' => 24,
             'League\\Flysystem\\' => 17,
         ),
+        'J' => 
+        array (
+            'Joypack\\Tencent\\Map\\' => 20,
+        ),
         'I' => 
         array (
             'Intervention\\Image\\' => 19,
@@ -384,6 +388,10 @@ class ComposerStaticInit0ef01221f70f4fb275871418332d8a66
         array (
             0 => __DIR__ . '/..' . '/league/flysystem/src',
         ),
+        'Joypack\\Tencent\\Map\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/joypack/tencent-map/src',
+        ),
         'Intervention\\Image\\' => 
         array (
             0 => __DIR__ . '/..' . '/intervention/image/src/Intervention/Image',

+ 45 - 0
vendor/composer/installed.json

@@ -2094,6 +2094,51 @@
             ],
             "install-path": "../intervention/image"
         },
+        {
+            "name": "joypack/tencent-map",
+            "version": "1.0.0",
+            "version_normalized": "1.0.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://gitee.com/lphkxd/tencent-map",
+                "reference": "97c0269086d53dbecb9c3c6e1d2717645d7940a8"
+            },
+            "require": {
+                "php": ">=5.6"
+            },
+            "time": "2021-11-16T06:49:35+00:00",
+            "type": "library",
+            "installation-source": "source",
+            "autoload": {
+                "psr-4": {
+                    "Joypack\\Tencent\\Map\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "堪笑",
+                    "email": "jixiang.f@gmail.com",
+                    "homepage": "http://cli.life",
+                    "role": "Developer"
+                }
+            ],
+            "description": "腾讯位置服务(WebService)",
+            "homepage": "https://github.com/joypack/tencent-map",
+            "keywords": [
+                "LBS",
+                "腾讯位置服务"
+            ],
+            "support": {
+                "email": "jixiang.f@gmail.com",
+                "issues": "https://github.com/joypack/tencent-map/issues",
+                "wiki": "https://github.com/joypack/tencent-map/wiki"
+            },
+            "install-path": "../joypack/tencent-map"
+        },
         {
             "name": "league/flysystem",
             "version": "1.1.10",

+ 11 - 2
vendor/composer/installed.php

@@ -6,7 +6,7 @@
     'aliases' => 
     array (
     ),
-    'reference' => 'bee03ef08529625c3d2c2e0f834fb50d19250ec7',
+    'reference' => '112be7bd5706bbe9c1613a275449ef82d8aa53ba',
     'name' => 'topthink/think',
   ),
   'versions' => 
@@ -272,6 +272,15 @@
       ),
       'reference' => '04be355f8d6734c826045d02a1079ad658322dad',
     ),
+    'joypack/tencent-map' => 
+    array (
+      'pretty_version' => '1.0.0',
+      'version' => '1.0.0.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '97c0269086d53dbecb9c3c6e1d2717645d7940a8',
+    ),
     'league/flysystem' => 
     array (
       'pretty_version' => '1.1.10',
@@ -854,7 +863,7 @@
       'aliases' => 
       array (
       ),
-      'reference' => 'bee03ef08529625c3d2c2e0f834fb50d19250ec7',
+      'reference' => '112be7bd5706bbe9c1613a275449ef82d8aa53ba',
     ),
     'topthink/think-captcha' => 
     array (

+ 1 - 1
vendor/services.php

@@ -1,5 +1,5 @@
 <?php 
-// This file is automatically generated at:2024-12-12 15:37:56
+// This file is automatically generated at:2024-12-20 13:26:08
 declare (strict_types = 1);
 return array (
   0 => 'think\\captcha\\CaptchaService',