From 453907430335db4c39373f3ed962deb7f8c393b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=85=A8=E6=A0=88=E5=B0=8F=E5=AD=A6=E7=94=9F?=
<1518079521@qq.com>
Date: Wed, 21 Jun 2023 16:47:46 +0800
Subject: [PATCH] update niucloud
---
.../addon/hello_world/app/dict/diy/pages.php | 1 +
.../hello_world/app/dict/diy/template.php | 2 +
.../hello_world/app/dict/notice/notice.php | 2 +
.../app/dict/schedule/schedule.php | 15 +
.../hello_world/app/job/AddonSchedule.php | 27 +
.../app/listener/AppManageListener.php | 3 +-
niucloud/addon/hello_world/sql/install.sql | 2 +-
niucloud/app/ExceptionHandle.php | 2 +-
niucloud/app/Request.php | 4 +-
.../app/adminapi/controller/auth/Auth.php | 11 +
niucloud/app/adminapi/controller/diy/Diy.php | 64 +-
.../app/adminapi/controller/notice/SmsLog.php | 2 +-
.../app/adminapi/controller/site/Site.php | 4 +
.../adminapi/controller/site/SiteAccount.php | 57 ++
niucloud/app/adminapi/controller/sys/Area.php | 22 +
.../app/adminapi/controller/sys/Config.php | 40 ++
niucloud/app/adminapi/controller/sys/Cron.php | 56 --
.../app/adminapi/controller/sys/Schedule.php | 107 ++++
.../app/adminapi/controller/sys/System.php | 3 +
niucloud/app/adminapi/route/auth.php | 2 +
niucloud/app/adminapi/route/diy.php | 12 +-
niucloud/app/adminapi/route/site.php | 10 +-
niucloud/app/adminapi/route/sys.php | 39 +-
niucloud/app/api/middleware/ApiChannel.php | 9 +-
niucloud/app/api/middleware/ApiCheckToken.php | 8 +-
.../app/api/route/dispatch/BindDispatch.php | 2 +-
niucloud/app/command/Schedule.php | 92 ---
niucloud/app/command/schedule/Schedule.php | 54 ++
niucloud/app/common.php | 15 +-
niucloud/app/dict/diy/PagesDict.php | 66 +-
niucloud/app/dict/diy/TemplateDict.php | 31 +-
niucloud/app/dict/menu/admin.php | 13 +
niucloud/app/dict/menu/site.php | 103 ++--
niucloud/app/dict/notice/notice.php | 6 +-
.../ScheduleDict.php} | 28 +-
niucloud/app/dict/schedule/schedule.php | 10 +-
niucloud/app/dict/site/SiteAccountLogDict.php | 32 +
niucloud/app/dict/sys/DateDict.php | 78 +++
niucloud/app/dict/sys/SmsDict.php | 2 +-
niucloud/app/event.php | 10 +-
niucloud/app/install/controller/Index.php | 8 +
niucloud/app/install/source/database.sql | 562 +++++++-----------
niucloud/app/job/schedule/SiteExpireClose.php | 3 +-
niucloud/app/lang/en/dict.php | 34 +-
niucloud/app/lang/zh-cn/api.php | 1 +
niucloud/app/lang/zh-cn/dict.php | 48 +-
.../app/listener/pay/PaySuccessListener.php | 4 +
.../listener/pay/RefundSuccessListener.php | 6 +
.../listener/pay/TransferSuccessListener.php | 3 +
.../app/listener/system/AppManageListener.php | 5 +-
.../app/listener/system/SiteIndexListener.php | 30 +
niucloud/app/model/addon/Addon.php | 2 +-
niucloud/app/model/article/Article.php | 15 +-
niucloud/app/model/diy/Diy.php | 5 +-
niucloud/app/model/member/Member.php | 24 +-
.../app/model/member/MemberAccountLog.php | 4 +-
niucloud/app/model/member/MemberCashOut.php | 17 +-
.../app/model/member/MemberCashOutAccount.php | 5 +-
.../model/order/RechargeOrderItemRefund.php | 5 +-
niucloud/app/model/pay/Pay.php | 9 +-
niucloud/app/model/pay/PayChannel.php | 7 +-
niucloud/app/model/pay/Refund.php | 6 +-
niucloud/app/model/pay/Transfer.php | 7 +-
niucloud/app/model/site/Site.php | 4 +-
niucloud/app/model/site/SiteAccountLog.php | 118 ++++
niucloud/app/model/sys/SysAgreement.php | 4 +-
niucloud/app/model/sys/SysMenu.php | 8 +-
niucloud/app/model/sys/SysNoticeLog.php | 22 +-
niucloud/app/model/sys/SysNoticeSmsLog.php | 52 +-
niucloud/app/model/sys/SysRole.php | 3 +-
.../sys/{SysCronTask.php => SysSchedule.php} | 59 +-
niucloud/app/model/sys/SysUser.php | 3 +-
.../admin/aliapp/AliappConfigService.php | 4 +-
.../admin/article/ArticleCategoryService.php | 12 +-
.../service/admin/article/ArticleService.php | 9 +-
.../app/service/admin/auth/AuthService.php | 23 +-
.../service/admin/auth/AuthSiteService.php | 27 +-
.../app/service/admin/auth/ConfigService.php | 3 +-
.../app/service/admin/auth/LoginService.php | 1 -
.../app/service/admin/cron/CronService.php | 55 --
.../app/service/admin/diy/DiyRouteService.php | 1 +
niucloud/app/service/admin/diy/DiyService.php | 331 +++++++++--
.../admin/generator/core/ModelGenerator.php | 2 +-
.../admin/generator/core/ServiceGenerator.php | 2 +-
.../generator/core/WebIndexGenerator.php | 2 +-
.../admin/generator/vm/admin_api_route.vm | 2 +-
.../admin/member/MemberAccountService.php | 2 +-
.../admin/notice/NoticeSmsLogService.php | 6 +-
.../admin/schedule/ScheduleService.php | 93 +++
.../admin/site/SiteAccountLogService.php | 79 +++
.../service/admin/site/SiteGroupService.php | 3 -
.../app/service/admin/site/SiteService.php | 40 +-
.../service/admin/stat/SiteStatService.php | 4 +
.../app/service/admin/sys/AreaService.php | 85 ++-
.../service/admin/sys/AttachmentService.php | 6 +-
.../app/service/admin/sys/ConfigService.php | 103 +++-
.../app/service/admin/sys/MenuService.php | 171 +++---
.../app/service/admin/sys/RoleService.php | 21 +-
.../app/service/admin/sys/SystemService.php | 12 +-
.../service/admin/user/UserRoleService.php | 35 +-
.../app/service/admin/user/UserService.php | 9 +-
.../api/article/ArticleCategoryService.php | 7 +-
.../service/api/article/ArticleService.php | 9 +-
niucloud/app/service/api/diy/DiyService.php | 16 +-
.../app/service/api/login/AuthService.php | 5 +-
.../app/service/api/member/MemberService.php | 4 +-
.../core/addon/CoreAddonBaseService.php | 3 +-
.../core/addon/CoreAddonInstallService.php | 40 +-
.../service/core/addon/CoreAddonService.php | 3 +-
niucloud/app/service/core/addon/WapTrait.php | 60 ++
.../core/aliapp/CoreAliappConfigService.php | 4 +-
.../core/member/CoreMemberAccountService.php | 2 +-
.../core/member/CoreMemberConfigService.php | 6 +-
.../core/member/CoreMemberLabelService.php | 8 -
.../core/notice/CoreNoticeLogService.php | 2 +-
.../core/notice/CoreNoticeSmsLogService.php | 17 +-
.../service/core/pay/CorePayEventService.php | 13 +-
.../app/service/core/pay/CorePayService.php | 8 +-
.../service/core/pay/CoreRefundService.php | 4 +-
.../service/core/pay/CoreTransferService.php | 2 +-
.../core/paytype/CoreBalanceService.php | 12 +-
.../service/core/schedule/CoreCronService.php | 203 -------
.../schedule/CoreScheduleInstallService.php | 85 +++
.../core/schedule/CoreScheduleService.php | 175 +++++-
.../core/site/CoreSiteAccountService.php | 86 +++
.../app/service/core/site/CoreSiteService.php | 73 ++-
.../service/core/sys/CoreAgreementService.php | 3 +-
.../app/service/core/sys/CoreAreaService.php | 24 +-
.../core/sys/CoreAttachmentService.php | 6 +-
.../service/core/sys/CoreConfigService.php | 6 +-
.../service/core/sys/CoreSysConfigService.php | 21 +-
.../service/core/upload/CoreImageService.php | 3 +-
.../core/weapp/CoreWeappConfigService.php | 3 +-
.../service/core/weapp/CoreWeappService.php | 3 +-
.../core/wechat/CoreWechatConfigService.php | 3 +-
.../core/wechat/CoreWechatServeService.php | 2 +-
niucloud/app/validate/diy/Diy.php | 14 +-
niucloud/app/validate/message/AliSms.php | 42 --
niucloud/composer.json | 3 +-
niucloud/composer.lock | 113 +++-
niucloud/config/console.php | 1 -
niucloud/config/cron.php | 9 -
niucloud/config/pay.php | 6 +-
niucloud/core/dict/BaseDict.php | 6 +-
niucloud/core/dict/Schedule.php | 43 +-
niucloud/core/upload/Aliyun.php | 3 +-
niucloud/core/util/Snowflake.php | 86 +++
niucloud/public/.gitignore | 4 +-
.../diy/template/default_index_cover.png | Bin 0 -> 101486 bytes
.../default_member_index_one_cover.png | Bin 0 -> 60295 bytes
.../default_member_index_two_cover.png | Bin 0 -> 201981 bytes
.../images/diy/template/tourism_cover.png | Bin 0 -> 295922 bytes
.../template/tourism_member_index_cover.png | Bin 0 -> 76038 bytes
.../images/member/public_money_bg.png | Bin 31107 -> 0 bytes
154 files changed, 3008 insertions(+), 1515 deletions(-)
create mode 100644 niucloud/addon/hello_world/app/dict/schedule/schedule.php
create mode 100644 niucloud/addon/hello_world/app/job/AddonSchedule.php
create mode 100644 niucloud/app/adminapi/controller/site/SiteAccount.php
delete mode 100644 niucloud/app/adminapi/controller/sys/Cron.php
create mode 100644 niucloud/app/adminapi/controller/sys/Schedule.php
delete mode 100644 niucloud/app/command/Schedule.php
create mode 100644 niucloud/app/command/schedule/Schedule.php
rename niucloud/app/dict/{sys/CronDict.php => schedule/ScheduleDict.php} (56%)
create mode 100644 niucloud/app/dict/site/SiteAccountLogDict.php
create mode 100644 niucloud/app/dict/sys/DateDict.php
create mode 100644 niucloud/app/listener/system/SiteIndexListener.php
create mode 100644 niucloud/app/model/site/SiteAccountLog.php
rename niucloud/app/model/sys/{SysCronTask.php => SysSchedule.php} (71%)
delete mode 100644 niucloud/app/service/admin/cron/CronService.php
create mode 100644 niucloud/app/service/admin/schedule/ScheduleService.php
create mode 100644 niucloud/app/service/admin/site/SiteAccountLogService.php
delete mode 100644 niucloud/app/service/core/schedule/CoreCronService.php
create mode 100644 niucloud/app/service/core/schedule/CoreScheduleInstallService.php
create mode 100644 niucloud/app/service/core/site/CoreSiteAccountService.php
delete mode 100644 niucloud/app/validate/message/AliSms.php
delete mode 100644 niucloud/config/cron.php
create mode 100644 niucloud/core/util/Snowflake.php
create mode 100644 niucloud/public/static/resource/images/diy/template/default_index_cover.png
create mode 100644 niucloud/public/static/resource/images/diy/template/default_member_index_one_cover.png
create mode 100644 niucloud/public/static/resource/images/diy/template/default_member_index_two_cover.png
create mode 100644 niucloud/public/static/resource/images/diy/template/tourism_cover.png
create mode 100644 niucloud/public/static/resource/images/diy/template/tourism_member_index_cover.png
delete mode 100644 niucloud/public/static/resource/images/member/public_money_bg.png
diff --git a/niucloud/addon/hello_world/app/dict/diy/pages.php b/niucloud/addon/hello_world/app/dict/diy/pages.php
index 1492ee40f..1d788bdf4 100644
--- a/niucloud/addon/hello_world/app/dict/diy/pages.php
+++ b/niucloud/addon/hello_world/app/dict/diy/pages.php
@@ -7,6 +7,7 @@ return [
'cover' => '', // 页面封面图
'preview' => '', // 页面预览图
'desc' => '', // 页面描述
+ 'mode' => 'diy', // 页面模式:diy:自定义,fixed:固定
// 页面数据源
"data" => [
"global" => [
diff --git a/niucloud/addon/hello_world/app/dict/diy/template.php b/niucloud/addon/hello_world/app/dict/diy/template.php
index 98a006df6..0e5621557 100644
--- a/niucloud/addon/hello_world/app/dict/diy/template.php
+++ b/niucloud/addon/hello_world/app/dict/diy/template.php
@@ -4,9 +4,11 @@ return [
'DIY_HELLO_WORLD_INDEX' => [
'title' => get_lang('dict_diy.page_hello_world_index'),
'page' => 'pages/hello_world/index',
+ 'action' => ''
],
'DIY_HELLO_WORLD_INFO' => [
'title' => get_lang('dict_diy.page_hello_world_info'),
'page' => 'pages/hello_world/info',
+ 'action' => ''
],
];
\ No newline at end of file
diff --git a/niucloud/addon/hello_world/app/dict/notice/notice.php b/niucloud/addon/hello_world/app/dict/notice/notice.php
index 0a9e304d6..def067e88 100644
--- a/niucloud/addon/hello_world/app/dict/notice/notice.php
+++ b/niucloud/addon/hello_world/app/dict/notice/notice.php
@@ -3,6 +3,8 @@ return [
'hello_world_test' => [
'key' => 'hello_world_test',
'app_type' => 'site',
+ 'receiver_type' => 1,
+ 'async' => false,
'name' => 'hello world消息',
'title' => 'hello world演示插件消息',
'variable' =>[
diff --git a/niucloud/addon/hello_world/app/dict/schedule/schedule.php b/niucloud/addon/hello_world/app/dict/schedule/schedule.php
new file mode 100644
index 000000000..57867a985
--- /dev/null
+++ b/niucloud/addon/hello_world/app/dict/schedule/schedule.php
@@ -0,0 +1,15 @@
+ 'addon_schedule',
+ 'name' => '插件计划任务',
+ 'desc' => '',
+ 'time' => [
+ 'type' => 'min',
+ 'min' => 1
+ ],
+ 'class' => 'addon\hello_world\app\job\AddonSchedule',
+ 'function' => ''
+ ],
+];
diff --git a/niucloud/addon/hello_world/app/job/AddonSchedule.php b/niucloud/addon/hello_world/app/job/AddonSchedule.php
new file mode 100644
index 000000000..182e81b4a
--- /dev/null
+++ b/niucloud/addon/hello_world/app/job/AddonSchedule.php
@@ -0,0 +1,27 @@
+ [
//插件如果要单独分类展示,需要专门定义
[
@@ -43,6 +43,5 @@ class AppManageListener
"url" => "/hello_world"
],
];
- return $data;
}
}
\ No newline at end of file
diff --git a/niucloud/addon/hello_world/sql/install.sql b/niucloud/addon/hello_world/sql/install.sql
index 5464ddfee..e2f11abf9 100644
--- a/niucloud/addon/hello_world/sql/install.sql
+++ b/niucloud/addon/hello_world/sql/install.sql
@@ -3,4 +3,4 @@ CREATE TABLE IF NOT EXISTS `{{prefix}}hello_world` (
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='演示插件表';
-INSERT INTO `{{prefix}}hello_world`(`id`, `name`) VALUES (1, '名称');
\ No newline at end of file
+INSERT INTO `{{prefix}}hello_world`(`name`) VALUES ('名称');
\ No newline at end of file
diff --git a/niucloud/app/ExceptionHandle.php b/niucloud/app/ExceptionHandle.php
index d27b4dc29..f89092007 100644
--- a/niucloud/app/ExceptionHandle.php
+++ b/niucloud/app/ExceptionHandle.php
@@ -91,7 +91,7 @@ class ExceptionHandle extends Handle
// 添加自定义异常处理机制
if ($e instanceof DbException) {
- return fail('DATA_GET_FAIL', [
+ return fail(get_lang('DATA_GET_FAIL').':'.$e->getMessage(), [
'file' => $e->getFile(),
'line' => $e->getLine(),
'message' => $e->getMessage(),
diff --git a/niucloud/app/Request.php b/niucloud/app/Request.php
index 4670f5e45..c8e8751ac 100644
--- a/niucloud/app/Request.php
+++ b/niucloud/app/Request.php
@@ -149,7 +149,7 @@ class Request extends \think\Request
* @return array|string|null
*/
public function adminSiteId(){
- return $this->header(system_name('admin_site_id_name')) ?? $this->defaultSiteId();
+ return $this->header(system_name('admin_site_id_name'));
}
/**
@@ -157,7 +157,7 @@ class Request extends \think\Request
* @return array|string|null
*/
public function apiSiteId(){
- return $this->header(system_name('api_site_id_name')) ?? $this->defaultSiteId();
+ return $this->header(system_name('api_site_id_name'));
}
/**
diff --git a/niucloud/app/adminapi/controller/auth/Auth.php b/niucloud/app/adminapi/controller/auth/Auth.php
index acc3adc96..22b9509d9 100644
--- a/niucloud/app/adminapi/controller/auth/Auth.php
+++ b/niucloud/app/adminapi/controller/auth/Auth.php
@@ -72,4 +72,15 @@ class Auth extends BaseAdminController
public function site(){
return success((new AuthSiteService())->getSiteInfo());
}
+
+ /**
+ * 选择可以选择的页面
+ * @return \think\Response
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
+ */
+ public function getShowMenuList(){
+ return success((new AuthSiteService())->getShowMenuList());
+ }
}
diff --git a/niucloud/app/adminapi/controller/diy/Diy.php b/niucloud/app/adminapi/controller/diy/Diy.php
index bcdbce201..ee693bcf2 100644
--- a/niucloud/app/adminapi/controller/diy/Diy.php
+++ b/niucloud/app/adminapi/controller/diy/Diy.php
@@ -23,7 +23,7 @@ use core\base\BaseAdminController;
class Diy extends BaseAdminController
{
/**
- * @notes 获取自定义页面列表
+ * @notes 获取自定义页面分页列表
* @return \think\Response
*/
public function lists()
@@ -35,6 +35,20 @@ class Diy extends BaseAdminController
return success(( new DiyService() )->getPage($data));
}
+ /**
+ * @notes 获取自定义页面列表
+ * @return \think\Response
+ */
+ public function getList()
+ {
+ $data = $this->request->params([
+ [ "title", "" ],
+ [ "type", "" ],
+ [ 'mode', '' ]
+ ]);
+ return success(( new DiyService() )->getList($data));
+ }
+
/**
* 自定义页面详情
* @param int $id
@@ -55,6 +69,8 @@ class Diy extends BaseAdminController
[ "title", "" ],
[ "name", "" ],
[ "type", "" ],
+ [ 'template', '' ],
+ [ 'mode', 'diy' ],
[ "value", "" ],
[ 'is_default', 0 ]
]);
@@ -75,6 +91,7 @@ class Diy extends BaseAdminController
[ "title", "" ],
[ "name", "" ],
[ "value", "" ],
+ [ 'is_change', '' ]
]);
$this->validate($data, 'app\validate\diy\Diy.edit');
( new DiyService() )->edit($id, $data);
@@ -113,8 +130,8 @@ class Diy extends BaseAdminController
$params = $this->request->params([
[ 'id', "" ],
[ "name", "" ],
- [ "template", "" ],
- [ 'template_name', '' ],
+ [ "type", "" ],
+ [ 'template', '' ],
[ "title", "" ],
]);
@@ -138,10 +155,12 @@ class Diy extends BaseAdminController
public function getTemplate()
{
$params = $this->request->params([
- [ 'type', "" ],
+ [ 'type', "" ], // 页面类型模板
+ [ 'action', '' ], // 页面是否装修标识,为空标识不装修,decorate:装修
+ [ 'mode', '' ] // 页面展示模式,diy:自定义,fixed:固定
]);
$diy_service = new DiyService();
- return success($diy_service->getTemplate($params[ 'type' ]));
+ return success($diy_service->getTemplate($params));
}
/**
@@ -157,4 +176,39 @@ class Diy extends BaseAdminController
return success('MODIFY_SUCCESS');
}
+ /**
+ * 获取装修页面列表
+ */
+ public function getDecoratePage()
+ {
+ return success(( new DiyService() )->getDecoratePage());
+ }
+
+ /**
+ * 切换模板
+ */
+ public function changeTemplate()
+ {
+ $data = $this->request->params([
+ [ "id", "" ],
+ [ 'type', '' ], // 页面类型
+ [ 'mode', '' ], // 页面展示模式,diy:自定义,fixed:固定
+ [ 'template', '' ] // 模板名称
+ ]);
+ return success(( new DiyService() )->changeTemplate($data));
+ }
+
+ /**
+ * 获取页面预览数据
+ */
+ public function getPreviewData()
+ {
+ $data = $this->request->params([
+ [ "id", "" ],
+ [ 'name', '' ]
+ ]);
+ $res = ( new DiyService() )->getPreviewData($data);
+ return success($res);
+ }
+
}
diff --git a/niucloud/app/adminapi/controller/notice/SmsLog.php b/niucloud/app/adminapi/controller/notice/SmsLog.php
index 62666f2e1..60303af6d 100644
--- a/niucloud/app/adminapi/controller/notice/SmsLog.php
+++ b/niucloud/app/adminapi/controller/notice/SmsLog.php
@@ -37,7 +37,7 @@ class SmsLog extends BaseAdminController
public function info($id)
{
- $res = ( new NoticeLogService() )->getInfo($id);
+ $res = ( new NoticeSmsLogService() )->getInfo($id);
return success($res);
}
diff --git a/niucloud/app/adminapi/controller/site/Site.php b/niucloud/app/adminapi/controller/site/Site.php
index 8c41c6594..c2af25072 100644
--- a/niucloud/app/adminapi/controller/site/Site.php
+++ b/niucloud/app/adminapi/controller/site/Site.php
@@ -120,4 +120,8 @@ class Site extends BaseAdminController
(new SiteService())->edit($id, $data);
return success('SUCCESS');
}
+ public function indexConfig()
+ {
+
+ }
}
diff --git a/niucloud/app/adminapi/controller/site/SiteAccount.php b/niucloud/app/adminapi/controller/site/SiteAccount.php
new file mode 100644
index 000000000..66f965c2f
--- /dev/null
+++ b/niucloud/app/adminapi/controller/site/SiteAccount.php
@@ -0,0 +1,57 @@
+request->params([
+ ['type', ''],
+ ['create_time', []],
+ ]);
+ return success((new SiteAccountLogService())->getPage($data));
+ }
+
+ /**
+ * 账单详情
+ * @param int $id
+ */
+ public function info(int $id)
+ {
+ return success((new SiteAccountLogService())->getInfo($id));
+ }
+ /**
+ * 累计账单
+ */
+ public function stat()
+ {
+ return success((new SiteAccountLogService())->stat());
+ }
+
+ public function accountType()
+ {
+ return success(SiteAccountLogDict::getType());
+ }
+}
diff --git a/niucloud/app/adminapi/controller/sys/Area.php b/niucloud/app/adminapi/controller/sys/Area.php
index e2c8d172e..d5c520544 100644
--- a/niucloud/app/adminapi/controller/sys/Area.php
+++ b/niucloud/app/adminapi/controller/sys/Area.php
@@ -34,4 +34,26 @@ class Area extends BaseAdminController
{
return success((new AreaService())->getAreaTree($level));
}
+
+ /**
+ * @param string $address
+ * 地址解析
+ */
+ public function addressInfo(){
+ $data = $this->request->params([
+ ['address', ''],
+ ]);
+ return success((new AreaService())->getAddress($data['address']));
+ }
+
+ /**
+ * @param string $location
+ * 逆地址解析
+ */
+ public function contraryAddress(){
+ $data = $this->request->params([
+ ['location', ''],
+ ]);
+ return success((new AreaService())->getAddressInfo($data['location']));
+ }
}
diff --git a/niucloud/app/adminapi/controller/sys/Config.php b/niucloud/app/adminapi/controller/sys/Config.php
index e3d90f7d4..2eaf22d2f 100644
--- a/niucloud/app/adminapi/controller/sys/Config.php
+++ b/niucloud/app/adminapi/controller/sys/Config.php
@@ -123,4 +123,44 @@ class Config extends BaseAdminController
public function getMap(){
return success((new ConfigService())->getMap());
}
+
+ /**
+ * 获取站点首页列表(如果正在使用is_use = 1)
+ */
+ public function getSiteIndexList()
+ {
+ return success((new ConfigService())->getSiteIndexList());
+ }
+
+ /**
+ * 首页配置
+ */
+ public function setSiteIndex()
+ {
+ $data = $this->request->params([
+ ['view_path', ''],
+ ]);
+ (new ConfigService())->setSiteIndexConfig($data);
+ return success();
+ }
+
+ /**
+ * 设置快捷菜单
+ */
+ public function setShortcutMenu()
+ {
+ $data = $this->request->params([
+ ['menu', []],
+ ]);
+ (new ConfigService())->setShortcutMenu($data['menu']);
+ return success();
+ }
+
+ /**
+ * 获取站点快捷菜单
+ */
+ public function getShortcutMenu()
+ {
+ return success(data:(new ConfigService())->getShortcutMenu());
+ }
}
diff --git a/niucloud/app/adminapi/controller/sys/Cron.php b/niucloud/app/adminapi/controller/sys/Cron.php
deleted file mode 100644
index cf20b7552..000000000
--- a/niucloud/app/adminapi/controller/sys/Cron.php
+++ /dev/null
@@ -1,56 +0,0 @@
-request->params([
- ['last_time', []],
- ['type', ''],
- ['title', '']
- ]);
- $list = (new CronService())->getPage($data);
- return success($list);
-
- }
-
- /**
- * 任务详情
- * @param $id
- * @return Response
- */
- public function info($id){
- return success((new CronService())->getInfo($id));
- }
-
- /**
- * 获取任务模式
- * @return \think\Response
- */
- public function getType(){
- return success((new CronDict())->getType());
- }
-}
diff --git a/niucloud/app/adminapi/controller/sys/Schedule.php b/niucloud/app/adminapi/controller/sys/Schedule.php
new file mode 100644
index 000000000..b91c15086
--- /dev/null
+++ b/niucloud/app/adminapi/controller/sys/Schedule.php
@@ -0,0 +1,107 @@
+request->params([
+ ['key', ''],
+ ['status', ''],
+ ]);
+ return success(data:(new ScheduleService())->getPage($data));
+
+ }
+
+
+ /**
+ * 获取任务模式
+ * @return \think\Response
+ */
+ public function getType(){
+ return success(data:ScheduleDict::getType());
+ }
+
+ /**
+ * 详情
+ * @param int $id
+ */
+ public function info(int $id)
+ {
+ return success(( new ScheduleService() )->getInfo($id));
+ }
+
+ /**
+ * 添加
+ * @return Response
+ */
+ public function add()
+ {
+ $data = $this->request->params([
+ [ 'key', '' ],
+ [ 'time', [] ],
+ [ 'status', ScheduleDict::OFF ],
+ ]);
+ ( new ScheduleService() )->add($data);
+ return success('ADD_SUCCESS');
+ }
+
+ /**
+ * 编辑
+ * @param int $id
+ * @return Response
+ */
+ public function edit(int $id)
+ {
+ $data = $this->request->params([
+ [ 'key', '' ],
+ [ 'time', [] ],
+ [ 'status', ScheduleDict::OFF ],
+ ]);
+ ( new ScheduleService() )->edit($id, $data);
+ return success('EDIT_SUCCESS');
+ }
+
+ /**
+ * 启用或关闭
+ * @param int $id
+ * @return \think\Response
+ */
+ public function modifyStatus(int $id){
+ $data = $this->request->params([
+ [ 'status', ScheduleDict::OFF ],
+ ]);
+ ( new ScheduleService() )->modifyStatus($id, $data['status']);
+ return success('EDIT_SUCCESS');
+ }
+ /**
+ * 删除
+ * @param int $id
+ */
+ public function del(int $id)
+ {
+
+ ( new ScheduleService() )->del($id);
+ return success('DELETE_SUCCESS');
+ }
+}
diff --git a/niucloud/app/adminapi/controller/sys/System.php b/niucloud/app/adminapi/controller/sys/System.php
index 377ff5cf8..46fd3c567 100644
--- a/niucloud/app/adminapi/controller/sys/System.php
+++ b/niucloud/app/adminapi/controller/sys/System.php
@@ -11,6 +11,7 @@
namespace app\adminapi\controller\sys;
+use app\service\admin\schedule\ScheduleService;
use app\service\admin\sys\SystemService;
use core\base\BaseAdminController;
@@ -70,4 +71,6 @@ class System extends BaseAdminController
public function checkSchedule(){
return success(data:(new SystemService())->checkSchedule());
}
+
+
}
diff --git a/niucloud/app/adminapi/route/auth.php b/niucloud/app/adminapi/route/auth.php
index 2afce3892..14158f339 100644
--- a/niucloud/app/adminapi/route/auth.php
+++ b/niucloud/app/adminapi/route/auth.php
@@ -32,6 +32,8 @@ Route::group('auth', function () {
Route::put('edit', 'auth.Auth/edit');
//授权站点信息
Route::get('site', 'auth.Auth/site');
+ //站点可以显示的菜单
+ Route::get('site/showmenu', 'auth.Auth/getShowMenuList');
})->middleware([
AdminCheckToken::class,
diff --git a/niucloud/app/adminapi/route/diy.php b/niucloud/app/adminapi/route/diy.php
index 5e6e8068e..94945a497 100644
--- a/niucloud/app/adminapi/route/diy.php
+++ b/niucloud/app/adminapi/route/diy.php
@@ -21,9 +21,17 @@ use think\facade\Route;
Route::group('diy', function() {
/***************************************************** 自定义页面管理 ****************************************************/
- //自定义页面列表
+ //自定义页面分页列表
Route::get('diy', 'diy.Diy/lists');
+ Route::get('list', 'diy.Diy/getList');
+
+ // 页面装修列表
+ Route::get('decorate', 'diy.Diy/getDecoratePage');
+
+ // 切换模板
+ Route::put('change', 'diy.Diy/changeTemplate');
+
//自定义页面详情
Route::get('diy/:id', 'diy.Diy/info');
@@ -60,6 +68,8 @@ Route::group('diy', function() {
// 编辑自定义页面分享内容
Route::put('diy/share', 'diy.Diy/modifyShare');
+ // 获取页面预览数据
+ Route::put('preview', 'diy.Diy/getPreviewData');
/***************************************************** 配置相关 *****************************************************/
diff --git a/niucloud/app/adminapi/route/site.php b/niucloud/app/adminapi/route/site.php
index 0e7ba889c..b6edc43f4 100644
--- a/niucloud/app/adminapi/route/site.php
+++ b/niucloud/app/adminapi/route/site.php
@@ -70,7 +70,15 @@ Route::group('site', function () {
Route::get('log/:id', 'site.UserLog/info');
/***************************************************** 站点菜单 **************************************************/
Route::get('site/menu', 'site.Site/menu');
-
+ /***************************************************** 站点账单 *************************************************/
+ //站点账单列表
+ Route::get('account', 'site.SiteAccount/lists');
+ //站点账单详情
+ Route::get('account/:id', 'site.SiteAccount/info');
+ //账单统计
+ Route::get('account/stat', 'site.SiteAccount/stat');
+ //账单类型
+ Route::get('account/type', 'site.SiteAccount/accountType');
})->middleware([
AdminCheckToken::class,
diff --git a/niucloud/app/adminapi/route/sys.php b/niucloud/app/adminapi/route/sys.php
index 6297910ba..c9792f679 100644
--- a/niucloud/app/adminapi/route/sys.php
+++ b/niucloud/app/adminapi/route/sys.php
@@ -72,6 +72,16 @@ Route::group('sys', function () {
//地图设置
Route::get('config/map', 'sys.Config/getMap');
+ //首页加载设置
+ Route::put('config/site_index', 'sys.Config/setSiteIndex');
+ //获取首页加载
+ Route::get('config/site_index', 'sys.Config/getSiteIndexList');
+
+ //快捷菜单设置
+ Route::put('config/shortcut_menu', 'sys.Config/setShortcutMenu');
+ //获取快捷菜单
+ Route::get('config/shortcut_menu', 'sys.Config/getShortcutMenu');
+
//登录注册设置
Route::get('config/login', 'login.Config/getConfig');
//登录注册设置
@@ -126,14 +136,10 @@ Route::group('sys', function () {
Route::get('area/list_by_pid/:pid', 'sys.Area/listByPid');
//通过层级获取列表
Route::get('area/tree/:level', 'sys.Area/tree');
+ //获取地址位置信息
+ Route::get('area/get_info', 'sys.Area/addressInfo');
+ Route::get('area/contrary', 'sys.Area/contraryAddress');
- /***************************************************** 任务管理 ****************************************************/
- //任务列表
- Route::get('cron', 'sys.Cron/lists');
- //任务详情
- Route::get('cron/:id', 'sys.Cron/info');
- //任务模式
- Route::get('cron/type', 'sys.Cron/getType');
/***************************************************** 渠道管理 ****************************************************/
Route::get('channel', 'sys.Channel/getChannelType');
//场景域名
@@ -144,12 +150,31 @@ Route::group('sys', function () {
Route::get('job', 'sys.System/checkJob');
//校验计划任务
Route::get('schedule', 'sys.System/checkSchedule');
+
+
+ /***************************************************** 计划任务 ****************************************************/
+ //计划任务列表
+ Route::get('schedule/list', 'sys.Schedule/lists');
+ //任务详情
+ Route::get('schedule/:id', 'sys.Schedule/info');
+ //设置任务状态
+ Route::put('schedule/modify/status/:id', 'sys.Schedule/modifyStatus');
+ //任务新增
+ Route::post('schedule', 'sys.Schedule/add');
+ //编辑任务
+ Route::put('schedule/:id', 'sys.Schedule/edit');
+ //删除任务
+ Route::delete('schedule/:id', 'sys.Schedule/del');
+ //任务模式
+ Route::get('schedule/type', 'sys.Schedule/getType');
/***************************************************** 应用管理 ****************************************************/
Route::get('applist', 'sys.App/getAppList');
/***************************************************** 清理缓存-刷新菜单 ****************************************************/
Route::post('schema/clear', 'sys.System/schemaCache');
+
+
})->middleware([
AdminCheckToken::class,
AdminCheckRole::class,
diff --git a/niucloud/app/api/middleware/ApiChannel.php b/niucloud/app/api/middleware/ApiChannel.php
index 0a6a9065b..e78513184 100644
--- a/niucloud/app/api/middleware/ApiChannel.php
+++ b/niucloud/app/api/middleware/ApiChannel.php
@@ -12,13 +12,15 @@
namespace app\api\middleware;
use app\Request;
+use app\service\core\site\CoreSiteService;
use Closure;
+use core\exception\AuthException;
use Exception;
use think\facade\Log;
/**
- * api渠道处理, 各种渠道的请求不叫特殊, 会在这儿将渠道的公共数据处理好
+ * api渠道处理, 各种渠道的请求, 会在这儿将渠道的公共数据处理好
*/
class ApiChannel
{
@@ -38,7 +40,10 @@ class ApiChannel
if (in_array($request->rule()->getRule(), $channel_rules)) {
$site_id = $request->param('site_id', -1);
if ($site_id != -1) {
- $request->pushHeader([ system_name('api_site_id_name') => $site_id ]);
+ $site_info = (new CoreSiteService())->getSiteCache($site_id);
+ if(empty($site_info)) throw new AuthException('SITE_NOT_EXIST');
+ $site_code = $site_info['code'] ?? '';
+ $request->pushHeader([ system_name('api_site_id_name') => $site_code ]);
}
}
return $next($request);
diff --git a/niucloud/app/api/middleware/ApiCheckToken.php b/niucloud/app/api/middleware/ApiCheckToken.php
index 090839dbb..0010a653c 100644
--- a/niucloud/app/api/middleware/ApiCheckToken.php
+++ b/niucloud/app/api/middleware/ApiCheckToken.php
@@ -30,11 +30,11 @@ class ApiCheckToken
/**
* @param Request $request
* @param Closure $next
- * @param bool $exception 是否把错误抛出
+ * @param bool $is_throw_exception 是否把错误抛出
* @return mixed
* @throws Exception
*/
- public function handle(Request $request, Closure $next, bool $exception = false)
+ public function handle(Request $request, Closure $next, bool $is_throw_exception = false)
{
$request->appType(AppTypeDict::API);
//检测站点
@@ -45,8 +45,8 @@ class ApiCheckToken
$token_info = ( new LoginService() )->parseToken($token);
} catch (AuthException $e) {
//是否将登录错误抛出
- if ($exception)
- return fail($e->getMessage());
+ if ($is_throw_exception)
+ return fail($e->getMessage(), [], $e->getCode());
}
if (!empty($token_info)) {
$request->memberId($token_info[ 'member_id' ]);
diff --git a/niucloud/app/api/route/dispatch/BindDispatch.php b/niucloud/app/api/route/dispatch/BindDispatch.php
index f8c31041a..f3b8ba26e 100644
--- a/niucloud/app/api/route/dispatch/BindDispatch.php
+++ b/niucloud/app/api/route/dispatch/BindDispatch.php
@@ -32,7 +32,7 @@ class BindDispatch extends Controller
$controller = 'weapp.Weapp';
$action = 'register';
break;
- };
+ }
$this->controller = $controller ?? '';
diff --git a/niucloud/app/command/Schedule.php b/niucloud/app/command/Schedule.php
deleted file mode 100644
index 97a430a3b..000000000
--- a/niucloud/app/command/Schedule.php
+++ /dev/null
@@ -1,92 +0,0 @@
-setName('schedule:run');
- }
-
- protected function execute(Input $input, Output $output)
- {
- //写入计划任务最后一次执行事件,用于环境监测
- $file = root_path('runtime').'.schedule';
- file_put_contents($file, time());
- $schedules = (new CoreScheduleService())->getList();
- foreach($schedules as $v){
- $class = $v['class'] ?: 'app\\job\\schedule\\'.Str::studly($v['key']);
- $function = $v['function'] ?: 'doJob';
- $call_back = [
- $class,
- $function
- ];
-
- $event = $this->call($call_back);
- switch($v['time']['type']){
- case 'min':
- $event->everyMinute();
- break;
- case 'hour':
- $event->hourly();
- break;
- case 'day':
- $event->daily();
- break;
- case 'week':
- $event->weekly();
- break;
- case 'month':
- $event->monthly();
- break;
- }
-
- }
-
- parent::execute($input, $output);
- }
-
- /**
- * 获取计划事件默认使用的时区
- */
- protected function scheduleTimezone(): DateTimeZone|string|null
- {
- return 'Asia/Shanghai';
- }
-
-// protected function getCrontab($data): string
-// {
-// $crontab = '';
-// switch ($data['type']) {
-// case 'sec':// 每隔几秒
-// $crontab = '*/' . $data['sec'] . ' * * * * *';
-// break;
-// case 'min':// 每隔几分
-// $crontab = '0 */' . $data['min'] . ' * * * *';
-// break;
-// case 'hour':// 每隔几时第几分钟执行
-// $crontab = '0 ' . $data['min'] . ' * * * *';
-// break;
-// case 'day':// 每日几时几分几秒
-// $crontab = $data['sec'] . ' ' . $data['min'] . ' ' . $data['hour'] . ' * * *';
-// break;
-// case 'week':// 每周一次,周几具体时间执行
-// $crontab = $data['sec'] . ' ' . $data['min'] . ' ' . $data['hour'] . ' * * ' . $data['week'];
-// break;
-// case 'month':// 每月一次,某日具体时间执行
-// $crontab = $data['sec'] . ' ' . $data['min'] . ' ' . $data['hour'] . ' ' . $data['day'] . ' * *';
-// break;
-// }
-// return $crontab;
-// }
-
-}
\ No newline at end of file
diff --git a/niucloud/app/command/schedule/Schedule.php b/niucloud/app/command/schedule/Schedule.php
new file mode 100644
index 000000000..cd7dd82e0
--- /dev/null
+++ b/niucloud/app/command/schedule/Schedule.php
@@ -0,0 +1,54 @@
+expression($this->getCrontab($this->vars['time']));
+ }
+
+ /**
+ * 执行任务
+ * @return mixed
+ */
+ protected function execute()
+ {
+ //...具体的任务执行
+ (new CoreScheduleService())->execute($this->vars);
+ }
+
+ protected function getCrontab($data): string
+ {
+ $crontab = '';
+ $min = $data['min'] ?? '*';
+ $hour = $data['hour'] ?? '*';
+ $day = $data['day'] ?? '*';
+ $week = $data['week'] ?? '*';
+ switch ($data['type']) {
+ case 'min':// 每隔几分
+ $crontab = '*/' . $min . ' * * * *';
+ break;
+ case 'hour':// 每隔几时第几分钟执行
+ $crontab = $min . ' */' . $hour . ' * * *';
+ break;
+ case 'day':// 每隔几日几时几分几秒执行
+ $crontab = $min . ' ' . $hour . ' */' . $day . ' * *';
+ break;
+ case 'week':// 每周一次,周几具体时间执行
+ $crontab = $min . ' ' . $hour . ' * * ' . $week;
+ break;
+ case 'month':// 每月一次,某日具体时间执行
+ $crontab = $min . ' ' . $hour . ' ' . $day . ' * *';
+ break;
+ }
+ return $crontab;
+ }
+}
diff --git a/niucloud/app/common.php b/niucloud/app/common.php
index b6d3c46d2..37c2931d6 100644
--- a/niucloud/app/common.php
+++ b/niucloud/app/common.php
@@ -5,7 +5,7 @@ use think\Response;
use think\facade\Lang;
use think\facade\Queue;
use think\facade\Cache;
-
+use core\util\Snowflake;
// 应用公共文件
/**
@@ -369,8 +369,11 @@ function filter($string)
*/
function create_no(string $prefix = '', string $tag = '')
{
- return $prefix . substr(md5($tag), -5) . uniqid();
-
+ $dataCenterId = 1;
+ $machineId = 2;
+ $snowflake = new Snowflake($dataCenterId, $machineId);
+ $id = $snowflake->generateId();
+ return $prefix.$tag.$id;
}
/**
@@ -416,8 +419,7 @@ function unique_random($len = 10)
{
$str = 'qwertyuiopasdfghjklzxcvbnmasdfgh';
str_shuffle($str);
- $res = substr(str_shuffle($str), 0, $len);
- return $res;
+ return substr(str_shuffle($str), 0, $len);
}
/**
@@ -623,6 +625,7 @@ function parse_sql($content = '', $string = false, $replace = [])
* 递归查询目录下所有文件
* @param $path
* @param $data
+ * @param $search
* @return void
*/
function search_dir($path, &$data, $search = '')
@@ -677,8 +680,8 @@ function getFileMap($path, $arr = [])
* 如果不存在则写入缓存
* @param string|null $name
* @param $value
- * @param $options
* @param $tag
+ * @param $options
* @return mixed|string
*/
function cache_remember(string $name = null, $value = '', $tag = null, $options = null){
diff --git a/niucloud/app/dict/diy/PagesDict.php b/niucloud/app/dict/diy/PagesDict.php
index d140aaa76..a61f23ed3 100644
--- a/niucloud/app/dict/diy/PagesDict.php
+++ b/niucloud/app/dict/diy/PagesDict.php
@@ -23,18 +23,19 @@ class PagesDict
/**
* 获取页面数据
- * @param string $type
+ * @param array $params
* @return array|string|null
*/
- public static function getPages($type = '')
+ public static function getPages($params = [])
{
$system_pages = [
'DIY_INDEX' => [
'default_index' => [ // 页面标识
"title" => "首页", // 页面名称
- 'cover' => '', // 页面封面图
+ 'cover' => 'static/resource/images/diy/template/default_index_cover.png', // 页面封面图
'preview' => '', // 页面预览图
- 'desc' => '', // 页面描述
+ 'desc' => '官方推出的系统首页', // 页面描述
+ 'mode' => 'diy', // 页面模式:diy:自定义,fixed:固定
// 页面数据源
"data" => [
"global" => [
@@ -255,14 +256,26 @@ class PagesDict
]
]
]
- ]
+ ],
+// 'tourism' => [
+// "title" => "旅游", // 页面名称
+// 'cover' => 'static/resource/images/diy/template/tourism_cover.png', // 页面封面图
+// 'preview' => '', // 页面预览图
+// 'desc' => '酒店旅游住宿门票景点', // 页面描述
+// 'mode' => 'fixed', // 页面模式:diy:自定义,fixed:固定
+// 'data' => [
+// 'component' => 'tourism-index', // 模板组件名称
+// 'link' => '' // 装修链接
+// ]
+// ]
],
'DIY_MEMBER_INDEX' => [
'default_member_index_one' => [
"title" => "个人中心(风格一)", // 页面名称
- 'cover' => '', // 页面封面图
+ 'cover' => 'static/resource/images/diy/template/default_member_index_one_cover.png', // 页面封面图
'preview' => '', // 页面预览图
- 'desc' => '', // 页面描述
+ 'desc' => '官方推出个人中心(风格一)', // 页面描述
+ 'mode' => 'diy',
// 页面数据源
"data" => [
"global" => [
@@ -583,9 +596,10 @@ class PagesDict
],
'default_member_index_two' => [
"title" => "个人中心(风格二)", // 页面名称
- 'cover' => '', // 页面封面图
+ 'cover' => 'static/resource/images/diy/template/default_member_index_two_cover.png', // 页面封面图
'preview' => '', // 页面预览图
- 'desc' => '', // 页面描述
+ 'desc' => '官方推出个人中心(风格二)', // 页面描述
+ 'mode' => 'diy',
// 页面数据源
"data" => [
"global" => [
@@ -904,14 +918,40 @@ class PagesDict
]
]
- ]
+ ],
+// 'tourism' => [
+// "title" => "旅游", // 页面名称
+// 'cover' => 'static/resource/images/diy/template/tourism_member_index_cover.png', // 页面封面图
+// 'preview' => '', // 页面预览图
+// 'desc' => '酒店旅游住宿门票景点', // 页面描述
+// 'mode' => 'fixed', // 页面模式:diy:自定义,fixed:固定
+// 'data' => [
+// 'component' => 'tourism-member', // 模板组件名称
+// 'link' => '' // 装修链接
+// ]
+// ]
]
];
$pages = ( new DictLoader("UniappPages") )->load($system_pages);
- if (empty($type)) {
- return $pages;
+ if (!empty($params[ 'type' ])) {
+ if (!empty($pages[ $params[ 'type' ] ])) {
+ $temp = $pages[ $params[ 'type' ] ];
+ if (isset($params[ 'mode' ]) && !empty($params[ 'mode' ])) {
+ foreach ($temp as $k => $v) {
+ if ($params[ 'mode' ] != $v[ 'mode' ]) {
+ unset($temp[ $k ]);
+ }
+ }
+ }
+ } else {
+
+ return [];
+ }
+
+ return $temp;
}
- return $pages[ $type ] ?? '';
+
+ return $pages;
}
}
\ No newline at end of file
diff --git a/niucloud/app/dict/diy/TemplateDict.php b/niucloud/app/dict/diy/TemplateDict.php
index 573533422..9cb6f05c7 100644
--- a/niucloud/app/dict/diy/TemplateDict.php
+++ b/niucloud/app/dict/diy/TemplateDict.php
@@ -23,30 +23,47 @@ class TemplateDict
/**
* 获取页面模板
- * @param string $type
- * @return array|string
+ * @param array $params
+ * @return array|string|null
*/
- public static function getTemplate($type = '')
+ public static function getTemplate($params = [])
{
$system_pages = [
'DIY_INDEX' => [
'title' => get_lang('dict_diy.page_index'),
'page' => 'pages/index/index',
+ 'action' => 'decorate' // 页面是否装修标识,为空标识不装修,decorate:装修
],
'DIY_MEMBER_INDEX' => [
'title' => get_lang('dict_diy.page_member_index'),
'page' => 'pages/member/index',
+ 'action' => 'decorate'
],
'DIY_PAGE' => [
'title' => get_lang('dict_diy.page_diy'),
'page' => 'pages/index/diy',
+ 'action' => ''
]
];
- $pages = (new DictLoader("UniappTemplate"))->load($system_pages);
- if (empty($type)) {
- return $pages;
+
+ $pages = ( new DictLoader("UniappTemplate") )->load($system_pages);
+
+ if (!empty($params[ 'type' ]) && !empty($pages[ $params[ 'type' ] ])) {
+ return [ $params[ 'type' ] => $pages[ $params[ 'type' ] ] ];
}
- return $pages[ $type ] ?? '';
+
+ if (!empty($params[ 'action' ])) {
+ $temp = [];
+ foreach ($pages as $k => $v) {
+ if (isset($v[ 'action' ]) && $params[ 'action' ] == $v[ 'action' ]) {
+ $temp[ $k ] = $v;
+ }
+
+ }
+ return $temp;
+ }
+
+ return $pages;
}
}
\ No newline at end of file
diff --git a/niucloud/app/dict/menu/admin.php b/niucloud/app/dict/menu/admin.php
index 4824fb02a..8949f9642 100644
--- a/niucloud/app/dict/menu/admin.php
+++ b/niucloud/app/dict/menu/admin.php
@@ -525,6 +525,19 @@
'sort' => 50,
'status' => 1,
'is_show' => 1,
+ ],
+ [
+ 'menu_name' => '计划任务',
+ 'menu_key' => 'tools_schedule',
+ 'menu_type' => 1,
+ 'icon' => 'element-SetUp',
+ 'api_url' => '',
+ 'router_path' => 'schedule',
+ 'view_path' => 'tools/schedule',
+ 'methods' => '',
+ 'sort' => 40,
+ 'status' => 1,
+ 'is_show' => 1,
]
]
],
diff --git a/niucloud/app/dict/menu/site.php b/niucloud/app/dict/menu/site.php
index 26bf034e6..93e18493b 100644
--- a/niucloud/app/dict/menu/site.php
+++ b/niucloud/app/dict/menu/site.php
@@ -28,8 +28,8 @@ return
'is_show' => 1,
'children' => [
[
- 'menu_name' => '首页装修',
- 'menu_key' => 'diy_page_index',
+ 'menu_name' => '页面装修',
+ 'menu_key' => 'diy_page_decorate',
'menu_type' => 1,
'icon' => 'element-House',
'api_url' => '',
@@ -40,19 +40,6 @@ return
'status' => 1,
'is_show' => 1,
],
- [
- 'menu_name' => '个人中心',
- 'menu_key' => 'diy_page_member',
- 'menu_type' => 1,
- 'icon' => 'element-ScaleToOriginal',
- 'api_url' => '',
- 'router_path' => 'member',
- 'view_path' => 'diy/member',
- 'methods' => '',
- 'sort' => 90,
- 'status' => 1,
- 'is_show' => 1,
- ],
[
'menu_name' => '保存',
'menu_key' => 'diy_page_update',
@@ -62,12 +49,12 @@ return
'router_path' => '',
'view_path' => '',
'methods' => 'post',
- 'sort' => 80,
+ 'sort' => 95,
'status' => 1,
'is_show' => 1,
],
[
- 'menu_name' => '页面管理',
+ 'menu_name' => '微页面',
'menu_key' => 'diy_page_list',
'menu_type' => 1,
'icon' => 'iconfont-icondianpuzhuangxiu',
@@ -75,7 +62,20 @@ return
'router_path' => 'list',
'view_path' => 'diy/list',
'methods' => 'get',
- 'sort' => 70,
+ 'sort' => 90,
+ 'status' => 1,
+ 'is_show' => 1,
+ ],
+ [
+ 'menu_name' => '页面路径',
+ 'menu_key' => 'diy_page_route',
+ 'menu_type' => 1,
+ 'icon' => 'iconfont-icondianpuzhuangxiu',
+ 'api_url' => 'diy/diy',
+ 'router_path' => 'route',
+ 'view_path' => 'diy/route',
+ 'methods' => 'get',
+ 'sort' => 85,
'status' => 1,
'is_show' => 1,
],
@@ -88,25 +88,24 @@ return
'router_path' => 'tabbar',
'view_path' => 'diy/tabbar',
'methods' => 'get',
- 'sort' => 60,
+ 'sort' => 80,
'status' => 1,
'is_show' => 1,
- 'children' =>
+ 'children' => [
[
- [
- 'menu_name' => '保存',
- 'menu_key' => 'diy_tabbar_update',
- 'menu_type' => 2,
- 'icon' => '',
- 'api_url' => 'diy/bottom',
- 'router_path' => '',
- 'view_path' => '',
- 'methods' => 'post',
- 'sort' => 100,
- 'status' => 1,
- 'is_show' => 1,
- ],
+ 'menu_name' => '保存',
+ 'menu_key' => 'diy_tabbar_update',
+ 'menu_type' => 2,
+ 'icon' => '',
+ 'api_url' => 'diy/bottom',
+ 'router_path' => '',
+ 'view_path' => '',
+ 'methods' => 'post',
+ 'sort' => 100,
+ 'status' => 1,
+ 'is_show' => 1,
],
+ ],
],
[
'menu_name' => '素材管理',
@@ -117,7 +116,7 @@ return
'router_path' => 'attachment',
'view_path' => 'tools/attachment',
'methods' => 'get',
- 'sort' => 50,
+ 'sort' => 75,
'status' => 1,
'is_show' => 1,
]
@@ -148,6 +147,19 @@ return
'sort' => 0,
'status' => 1,
'is_show' => 0,
+ ],
+ [
+ 'menu_name' => '页面预览',
+ 'menu_key' => 'page_preview',
+ 'menu_type' => 1,
+ 'icon' => '',
+ 'api_url' => '',
+ 'router_path' => 'preview',
+ 'view_path' => 'diy/preview',
+ 'methods' => '',
+ 'sort' => 1,
+ 'status' => 1,
+ 'is_show' => 0,
]
]
],
@@ -472,6 +484,19 @@ return
'status' => 1,
'is_show' => 1,
'children' => [
+ [
+ 'menu_name' => '账单管理',
+ 'menu_key' => 'site_account_list',
+ 'menu_type' => 1,
+ 'icon' => 'element-Postcard',
+ 'api_url' => 'finance/account',
+ 'router_path' => 'account',
+ 'view_path' => 'finance/account',
+ 'methods' => 'get',
+ 'sort' => 100,
+ 'status' => 1,
+ 'is_show' => 1,
+ ],
[
'menu_name' => '会员提现',
'menu_key' => 'cash_out_list',
@@ -484,7 +509,7 @@ return
'sort' => 99,
'status' => 1,
'is_show' => 1,
- ]
+ ],
]
],
[
@@ -887,7 +912,7 @@ return
'sort' => 100,
'status' => 1,
'is_show' => 1,
-
+
],
[
'menu_name' => '协议管理',
@@ -997,7 +1022,7 @@ return
'sort' => 90,
'status' => 1,
'is_show' => 1,
- 'children' => [
+ 'children' => [
[
'menu_name' => '设置',
'menu_key' => 'setting_pay_transfer_set',
@@ -1010,7 +1035,7 @@ return
'sort' => 90,
'status' => 1,
'is_show' => 1,
-
+
],
]
],
@@ -1151,7 +1176,7 @@ return
'sort' => 12,
'status' => 1,
'is_show' => 1,
-
+
],
[
'menu_name' => '发送记录',
diff --git a/niucloud/app/dict/notice/notice.php b/niucloud/app/dict/notice/notice.php
index b8b4e910c..85b8da2b3 100644
--- a/niucloud/app/dict/notice/notice.php
+++ b/niucloud/app/dict/notice/notice.php
@@ -2,7 +2,7 @@
return [
'verify_code' => [
'key' => 'verify_code',
- 'receiver_type' => 1,
+ 'receiver_type' => 0,
'name' => '手机验证码',
'title' => '管理端验证码登录',
'async' => false,
@@ -13,7 +13,7 @@ return [
//手机验证码,站点应用发送
'member_verify_code' => [
'key' => 'member_verify_code',
- 'receiver_type' => 2,
+ 'receiver_type' => 1,
'name' => '手机验证码',
'title' => '前端验证码登录,注册,手机验证',
'async' => false,
@@ -25,7 +25,7 @@ return [
'recharge_success' => [
'key' => 'recharge_success',
- 'receiver_type' => 2,
+ 'receiver_type' => 1,
'name' => '充值成功通知',
'title' => '会员充值成功后发送',
'async' => true,
diff --git a/niucloud/app/dict/sys/CronDict.php b/niucloud/app/dict/schedule/ScheduleDict.php
similarity index 56%
rename from niucloud/app/dict/sys/CronDict.php
rename to niucloud/app/dict/schedule/ScheduleDict.php
index dd297b76d..4d22b83a9 100644
--- a/niucloud/app/dict/sys/CronDict.php
+++ b/niucloud/app/dict/schedule/ScheduleDict.php
@@ -9,41 +9,35 @@
// | Author: Niucloud Team
// +----------------------------------------------------------------------
-namespace app\dict\sys;
+namespace app\dict\schedule;
-class CronDict
+class ScheduleDict
{
const CRON = 'cron';//定时任务
const CROND = 'crond';//周期任务
- const MINUTE = 'minute';//分钟
-
- const DAY = 'day';//天
- const WEEK = 'week';//星期
- const MONTH = 'month';//月份
+ const ON = 1;
+ const OFF = 2;
/**
* 任务模式
* @return array
*/
public static function getType(){
return [
- self::CRON => get_lang('dict_cron.type_cron'),//定时任务
- self::CROND => get_lang('dict_cron.type_crond'),//周期任务
+ self::CRON => get_lang('dict_schedule.type_cron'),//定时任务
+ self::CROND => get_lang('dict_schedule.type_crond'),//周期任务
];
}
+
/**
- * 周期类型
+ * 任务启用状态
* @return array
*/
- public static function getCrondType(){
+ public static function getStatus(){
return [
- self::MINUTE => get_lang('dict_cron.type_minute'),//分钟
- self::DAY => get_lang('dict_cron.type_day'),//天
- self::WEEK => get_lang('dict_cron.type_week'),//星期
- self::MONTH => get_lang('dict_cron.type_month'),//月份
+ self::ON => get_lang('dict_schedule.on'),//启用
+ self::OFF => get_lang('dict_schedule.off'),//关闭
];
}
-
-
}
\ No newline at end of file
diff --git a/niucloud/app/dict/schedule/schedule.php b/niucloud/app/dict/schedule/schedule.php
index 2219e0181..9f71cd3a9 100644
--- a/niucloud/app/dict/schedule/schedule.php
+++ b/niucloud/app/dict/schedule/schedule.php
@@ -4,8 +4,10 @@ return [
[
'key' => 'order_close',
'name' => '未支付订单自动关闭',
+ 'desc' => '',
'time' => [
'type' => 'min',
+ 'min' => 1
],
'class' => '',
'function' => ''
@@ -13,10 +15,14 @@ return [
[
'key' => 'site_expire_close',
'name' => '站点到期自动关闭',
+ 'desc' => '',
'time' => [
- 'type' => 'min',
+ 'type' => 'day',
+ 'day' => 1,
+ 'hour' => 1,
+ 'min' => 1
],
- 'class' => '',
+ 'class' => 'app\job\schedule\SiteExpireClose',
'function' => ''
]
];
diff --git a/niucloud/app/dict/site/SiteAccountLogDict.php b/niucloud/app/dict/site/SiteAccountLogDict.php
new file mode 100644
index 000000000..0bf013f4b
--- /dev/null
+++ b/niucloud/app/dict/site/SiteAccountLogDict.php
@@ -0,0 +1,32 @@
+ get_lang('dict_site.pay'),//支付
+ self::REFUND => get_lang('dict_site.refund'),//退款
+ self::TRANSFER => get_lang('dict_site.transfer'),//转账
+ ];
+ }
+
+}
\ No newline at end of file
diff --git a/niucloud/app/dict/sys/DateDict.php b/niucloud/app/dict/sys/DateDict.php
new file mode 100644
index 000000000..a23c783d5
--- /dev/null
+++ b/niucloud/app/dict/sys/DateDict.php
@@ -0,0 +1,78 @@
+ get_lang('dict_date.mon'),//周一
+ self::TUE => get_lang('dict_date.tue'),//周二
+ self::WED => get_lang('dict_date.wed'),//周三
+ self::THUR => get_lang('dict_date.thur'),//周四
+ self::FRI => get_lang('dict_date.fri'),//周五
+ self::SAT => get_lang('dict_date.sat'),//周六
+ self::SUN => get_lang('dict_date.sun'),//周日
+ ];
+ }
+
+ /**
+ * 月份
+ * @return array
+ */
+ public function getMonth(){
+ return [
+ self::JAN => get_lang('dict_date.jan'),//1月
+ self::FEB => get_lang('dict_date.feb'),//2月
+ self::MAR => get_lang('dict_date.mar'),//3月
+ self::APR => get_lang('dict_date.apr'),//4月
+ self::MAY => get_lang('dict_date.may'),//5月
+ self::JUN => get_lang('dict_date.jun'),//6月
+ self::JUL => get_lang('dict_date.jul'),//7月
+ self::AUG => get_lang('dict_date.aug'),//8月
+ self::SEPT => get_lang('dict_date.sept'),//9月
+ self::OCT => get_lang('dict_date.oct'),//10月
+ self::NOV => get_lang('dict_date.nov'),//11月
+ self::DEC => get_lang('dict_date.dec'),//12月
+ ];
+ }
+
+}
\ No newline at end of file
diff --git a/niucloud/app/dict/sys/SmsDict.php b/niucloud/app/dict/sys/SmsDict.php
index bc933e4c6..68ac9cd6e 100644
--- a/niucloud/app/dict/sys/SmsDict.php
+++ b/niucloud/app/dict/sys/SmsDict.php
@@ -53,7 +53,7 @@ class SmsDict
const SUCCESS = 'success';
const FAIL = 'fail';
- public function getStatusType(){
+ public static function getStatusType(){
return [
self::SENDING => 'dict_sms.status_sending',
self::SUCCESS => 'dict_sms.status_success',
diff --git a/niucloud/app/event.php b/niucloud/app/event.php
index 0a5009b33..7b255d26f 100644
--- a/niucloud/app/event.php
+++ b/niucloud/app/event.php
@@ -39,17 +39,23 @@ $system_event = [
//退款成功
'RefundSuccess' => [ 'app\listener\pay\RefundSuccessListener' ],
//转账成功
- 'TransferSuccess' => [ 'app\listener\pay\TransferSuccessListener' ],
+ 'TransferSuccess' => [ 'app\listener\pay\TransferSuccessListener' ], 'SiteIndex' => [
+ 'app\listener\system\SiteIndexListener'
+ ],
// 任务失败统一回调,有四种定义方式
'queue_failed'=> [
['app\listener\job\QueueFailedLoggerListener', 'report'],
],
+ //系统应用管理加载
'AppManage' => [
'app\listener\system\AppManageListener'
],
-
+ //站点首页加载
+ 'siteIndex' => [
+ 'app\listener\system\SiteIndexListener'
+ ],
//消息模板数据内容
'NoticeData' => [
'app\listener\notice_template\VerifyCode',//手机验证码
diff --git a/niucloud/app/install/controller/Index.php b/niucloud/app/install/controller/Index.php
index c24c613fb..5dde6a6ae 100644
--- a/niucloud/app/install/controller/Index.php
+++ b/niucloud/app/install/controller/Index.php
@@ -8,6 +8,7 @@ use app\model\sys\SysUser;
use app\service\admin\install\InstallSystemService;
use app\service\admin\site\SiteGroupService;
use app\service\admin\site\SiteService;
+use app\service\core\schedule\CoreScheduleInstallService;
use think\facade\Cache;
use think\facade\Db;
use think\facade\View;
@@ -320,6 +321,13 @@ class Index extends BaseInstall
$this->setSuccessLog([ '菜单初始化失败', 'error' ]);
return fail('菜单初始化失败');
}
+ //初始化计划任务
+ $res = ( new CoreScheduleInstallService())->installSystemSchedule();
+ if (!$res) {
+ $this->setSuccessLog([ '计划任务初始化失败', 'error' ]);
+ return fail('计划任务初始化失败');
+ }
+
$user = ( new SysUser() )->where([ [ 'uid', '=', 1 ] ])->findOrEmpty();
if (!$user->isEmpty()) {
diff --git a/niucloud/app/install/source/database.sql b/niucloud/app/install/source/database.sql
index 785b685f6..7df2d7252 100644
--- a/niucloud/app/install/source/database.sql
+++ b/niucloud/app/install/source/database.sql
@@ -1,4 +1,5 @@
-SET NAMES 'utf8mb4';
+
+SET NAMES 'utf8mb4';
DROP TABLE IF EXISTS addon;
@@ -34,14 +35,6 @@ DROP TABLE IF EXISTS member_label;
DROP TABLE IF EXISTS member_level;
-DROP TABLE IF EXISTS `order`;
-
-DROP TABLE IF EXISTS order_item;
-
-DROP TABLE IF EXISTS order_item_refund;
-
-DROP TABLE IF EXISTS order_log;
-
DROP TABLE IF EXISTS pay;
DROP TABLE IF EXISTS pay_channel;
@@ -50,8 +43,18 @@ DROP TABLE IF EXISTS pay_refund;
DROP TABLE IF EXISTS pay_transfer;
+DROP TABLE IF EXISTS recharge_order;
+
+DROP TABLE IF EXISTS recharge_order_item;
+
+DROP TABLE IF EXISTS recharge_order_item_refund;
+
+DROP TABLE IF EXISTS recharge_order_log;
+
DROP TABLE IF EXISTS site;
+DROP TABLE IF EXISTS site_account_log;
+
DROP TABLE IF EXISTS site_group;
DROP TABLE IF EXISTS sys_agreement;
@@ -76,6 +79,8 @@ DROP TABLE IF EXISTS sys_notice_sms_log;
DROP TABLE IF EXISTS sys_role;
+DROP TABLE IF EXISTS sys_schedule;
+
DROP TABLE IF EXISTS sys_user;
DROP TABLE IF EXISTS sys_user_log;
@@ -88,9 +93,6 @@ DROP TABLE IF EXISTS wechat_media;
DROP TABLE IF EXISTS wechat_reply;
---
--- `ns_wechat_reply`
---
CREATE TABLE wechat_reply (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
name varchar(64) NOT NULL DEFAULT '' COMMENT '规则名称',
@@ -102,13 +104,12 @@ CREATE TABLE wechat_reply (
content text NOT NULL COMMENT '回复内容',
status tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '启动状态:1-启动;0-关闭',
sort int(10) UNSIGNED NOT NULL DEFAULT 50 COMMENT '排序',
- create_time int(11) NOT NULL COMMENT '创建时间',
- update_time int(11) NOT NULL COMMENT '更新时间',
- delete_time int(11) NOT NULL COMMENT '删除时间',
+ create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
+ update_time int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
+ delete_time int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 16384,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '公众号消息回调表';
@@ -116,9 +117,6 @@ COMMENT = '公众号消息回调表';
ALTER TABLE wechat_reply
ADD INDEX keyword (keyword, reply_type);
---
--- `ns_wechat_media`
---
CREATE TABLE wechat_media (
id int(11) NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -130,7 +128,6 @@ CREATE TABLE wechat_media (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 1872,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '微信素材表';
@@ -138,9 +135,6 @@ COMMENT = '微信素材表';
ALTER TABLE wechat_media
ADD INDEX type (type, site_id);
---
--- `ns_wechat_fans`
---
CREATE TABLE wechat_fans (
fans_id int(11) NOT NULL AUTO_INCREMENT COMMENT '粉丝ID',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -165,7 +159,6 @@ CREATE TABLE wechat_fans (
PRIMARY KEY (fans_id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 5461,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '微信粉丝列表';
@@ -176,9 +169,6 @@ ADD INDEX openid (openid, site_id);
ALTER TABLE wechat_fans
ADD INDEX unionid (unionid, site_id);
---
--- `ns_sys_user_role`
---
CREATE TABLE sys_user_role (
id int(11) NOT NULL AUTO_INCREMENT,
uid int(11) NOT NULL DEFAULT 0 COMMENT '用户id',
@@ -189,6 +179,7 @@ CREATE TABLE sys_user_role (
PRIMARY KEY (id)
)
ENGINE = INNODB,
+AUTO_INCREMENT = 2,
AVG_ROW_LENGTH = 481,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
@@ -203,9 +194,6 @@ ADD INDEX site_id (site_id);
ALTER TABLE sys_user_role
ADD INDEX uid (uid);
---
--- `ns_sys_user_log`
---
CREATE TABLE sys_user_log (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '管理员操作记录ID',
ip varchar(16) NOT NULL DEFAULT '' COMMENT '登录IP',
@@ -219,11 +207,9 @@ CREATE TABLE sys_user_log (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 857,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '管理员操作记录表',
-ROW_FORMAT = COMPACT;
+COMMENT = '管理员操作记录表';
ALTER TABLE sys_user_log
ADD INDEX create_time (create_time);
@@ -234,9 +220,6 @@ ADD INDEX site_id (site_id);
ALTER TABLE sys_user_log
ADD INDEX uid (uid);
---
--- `ns_sys_user`
---
CREATE TABLE sys_user (
uid smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '系统用户ID',
username varchar(255) NOT NULL DEFAULT '' COMMENT '用户账号',
@@ -255,11 +238,11 @@ CREATE TABLE sys_user (
INDEX uid (uid)
)
ENGINE = INNODB,
+AUTO_INCREMENT = 2,
AVG_ROW_LENGTH = 372,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '后台管理员表',
-ROW_FORMAT = COMPACT;
+COMMENT = '后台管理员表';
ALTER TABLE sys_user
ADD INDEX delete_time (delete_time);
@@ -273,12 +256,27 @@ ADD INDEX password (password);
ALTER TABLE sys_user
ADD INDEX update_time (update_time);
-ALTER TABLE sys_user
-ADD INDEX username (username (191));
+CREATE TABLE sys_schedule (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ site_id int(11) NOT NULL DEFAULT 0,
+ addon varchar(255) NOT NULL DEFAULT '' COMMENT '所属插件',
+ `key` varchar(255) NOT NULL DEFAULT '' COMMENT '计划任务模板key',
+ status int(11) NOT NULL DEFAULT 1 COMMENT '任务状态 是否启用',
+ time varchar(500) NOT NULL DEFAULT '' COMMENT '任务周期 json结构',
+ count int(11) NOT NULL DEFAULT 0 COMMENT '执行次数',
+ last_time int(11) NOT NULL DEFAULT 0 COMMENT '最后执行时间',
+ next_time int(11) NOT NULL DEFAULT 0 COMMENT '下次执行时间',
+ create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
+ delete_time int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
+ update_time int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
+ sort int(11) NOT NULL DEFAULT 0 COMMENT '排序',
+ PRIMARY KEY (id)
+)
+ENGINE = INNODB,
+CHARACTER SET utf8mb4,
+COLLATE utf8mb4_general_ci,
+COMMENT = '系统任务';
---
--- `ns_sys_role`
---
CREATE TABLE sys_role (
role_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '角色id',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -290,11 +288,9 @@ CREATE TABLE sys_role (
PRIMARY KEY (role_id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 1638,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '角色表',
-ROW_FORMAT = COMPACT;
+COMMENT = '角色表';
ALTER TABLE sys_role
ADD INDEX site_id (site_id);
@@ -302,9 +298,6 @@ ADD INDEX site_id (site_id);
ALTER TABLE sys_role
ADD INDEX status (status);
---
--- `ns_sys_notice_sms_log`
---
CREATE TABLE sys_notice_sms_log (
id int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
site_id int(11) NOT NULL DEFAULT 0,
@@ -323,14 +316,10 @@ CREATE TABLE sys_notice_sms_log (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 496,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '短信发送表';
---
--- `ns_sys_notice_log`
---
CREATE TABLE sys_notice_log (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '通知记录ID',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -350,24 +339,19 @@ CREATE TABLE sys_notice_log (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 712,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '通知记录表',
-ROW_FORMAT = COMPACT;
+COMMENT = '通知记录表';
ALTER TABLE sys_notice_log
ADD INDEX member_id (member_id);
ALTER TABLE sys_notice_log
-ADD INDEX message_key (`key` (191));
+ADD INDEX message_key (`key`);
ALTER TABLE sys_notice_log
ADD INDEX uid (uid);
---
--- `ns_sys_notice`
---
CREATE TABLE sys_notice (
id int(11) NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点ID',
@@ -385,18 +369,13 @@ CREATE TABLE sys_notice (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 2048,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '通知模型',
-ROW_FORMAT = COMPACT;
+COMMENT = '通知模型';
ALTER TABLE sys_notice
ADD INDEX message_key (`key`, site_id);
---
--- `ns_sys_menu`
---
CREATE TABLE sys_menu (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
app_type varchar(255) NOT NULL DEFAULT 'admin' COMMENT '应用类型',
@@ -421,21 +400,17 @@ ENGINE = INNODB,
AVG_ROW_LENGTH = 406,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '菜单表',
-ROW_FORMAT = COMPACT;
+COMMENT = '菜单表';
ALTER TABLE sys_menu
ADD INDEX is_show (is_show);
ALTER TABLE sys_menu
-ADD INDEX menu_key (menu_key (191), app_type (191));
+ADD INDEX menu_key (menu_key, app_type);
ALTER TABLE sys_menu
-ADD INDEX parent_key (parent_key (191));
+ADD INDEX parent_key (parent_key);
---
--- `ns_sys_cron_task`
---
CREATE TABLE sys_cron_task (
id int(11) NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0,
@@ -457,14 +432,10 @@ CREATE TABLE sys_cron_task (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 8192,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = ' 系统任务';
---
--- `ns_sys_config`
---
CREATE TABLE sys_config (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -477,18 +448,13 @@ CREATE TABLE sys_config (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 910,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '系统配置表',
-ROW_FORMAT = COMPACT;
+COMMENT = '系统配置表';
ALTER TABLE sys_config
-ADD INDEX config_key (config_key (191), site_id);
+ADD INDEX config_key (config_key, site_id);
---
--- `ns_sys_attachment_category`
---
CREATE TABLE sys_attachment_category (
id int(11) NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -501,11 +467,9 @@ CREATE TABLE sys_attachment_category (
UNIQUE INDEX id (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 3276,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '附件分类表',
-ROW_FORMAT = COMPACT;
+COMMENT = '附件分类表';
ALTER TABLE sys_attachment_category
ADD INDEX pid (pid);
@@ -513,9 +477,6 @@ ADD INDEX pid (pid);
ALTER TABLE sys_attachment_category
ADD INDEX sort (sort);
---
--- `ns_sys_attachment`
---
CREATE TABLE sys_attachment (
att_id int(11) NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -533,11 +494,9 @@ CREATE TABLE sys_attachment (
PRIMARY KEY (att_id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 702,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '附件管理表',
-ROW_FORMAT = COMPACT;
+COMMENT = '附件管理表';
ALTER TABLE sys_attachment
ADD INDEX cate_id (cate_id);
@@ -548,9 +507,6 @@ ADD INDEX create_time (create_time);
ALTER TABLE sys_attachment
ADD INDEX site_id (site_id);
---
--- `ns_sys_area`
---
CREATE TABLE sys_area (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
pid int(11) NOT NULL DEFAULT 0 COMMENT '父级',
@@ -582,9 +538,6 @@ ADD INDEX longitude (longitude, latitude);
ALTER TABLE sys_area
ADD INDEX pid (pid);
---
--- `ns_sys_agreement`
---
CREATE TABLE sys_agreement (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -596,7 +549,6 @@ CREATE TABLE sys_agreement (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 6553,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '协议表';
@@ -607,9 +559,6 @@ ADD INDEX agreement_key (agreement_key);
ALTER TABLE sys_agreement
ADD INDEX site_id (site_id);
---
--- `ns_site_group`
---
CREATE TABLE site_group (
group_id int(11) NOT NULL AUTO_INCREMENT COMMENT '分组ID',
group_name varchar(255) NOT NULL DEFAULT '' COMMENT '分组名称',
@@ -621,16 +570,27 @@ CREATE TABLE site_group (
PRIMARY KEY (group_id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 2048,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '店铺分组(分组权限)';
---
--- `ns_site`
---
+CREATE TABLE site_account_log (
+ id int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
+ type varchar(255) NOT NULL DEFAULT 'pay' COMMENT '账单类型pay,refund,transfer',
+ money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '交易金额',
+ trade_no varchar(255) NOT NULL DEFAULT '' COMMENT '对应类型交易单号',
+ create_time varchar(255) NOT NULL DEFAULT '0' COMMENT '添加时间',
+ PRIMARY KEY (id)
+)
+ENGINE = INNODB,
+CHARACTER SET utf8mb4,
+COLLATE utf8mb4_general_ci,
+COMMENT = '站点账单记录';
+
CREATE TABLE site (
site_id int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ site_code varchar(32) NOT NULL DEFAULT '' COMMENT '站点code码',
site_name varchar(50) NOT NULL DEFAULT '' COMMENT '站点名称',
group_id int(11) NOT NULL DEFAULT 0 COMMENT '分组ID(0:不限制)',
keywords varchar(255) NOT NULL DEFAULT '' COMMENT '关键字',
@@ -648,7 +608,7 @@ CREATE TABLE site (
phone varchar(255) NOT NULL DEFAULT '' COMMENT '客服电话',
business_hours varchar(255) NOT NULL DEFAULT '' COMMENT '营业时间',
create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
- expire_time BIGINT NOT NULL DEFAULT 0 COMMENT '到期时间(如果是0 无限期)',
+ expire_time bigint(20) NOT NULL DEFAULT 0 COMMENT '到期时间(如果是0 无限期)',
front_end_name varchar(50) NOT NULL DEFAULT '' COMMENT '前台名称',
front_end_logo varchar(255) NOT NULL DEFAULT '' COMMENT '前台logo',
icon varchar(255) NOT NULL DEFAULT '' COMMENT '网站图标',
@@ -656,11 +616,11 @@ CREATE TABLE site (
PRIMARY KEY (site_id)
)
ENGINE = INNODB,
+AUTO_INCREMENT = 2,
AVG_ROW_LENGTH = 1365,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '站点表',
-ROW_FORMAT = COMPACT;
+COMMENT = '站点表';
ALTER TABLE site
ADD INDEX create_time (create_time);
@@ -668,9 +628,99 @@ ADD INDEX create_time (create_time);
ALTER TABLE site
ADD INDEX group_id (group_id);
---
--- `ns_pay_transfer`
---
+CREATE TABLE recharge_order_log (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ order_id int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
+ site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
+ action varchar(255) NOT NULL DEFAULT '' COMMENT '操作内容',
+ uid int(11) NOT NULL DEFAULT 0 COMMENT '操作人id',
+ nick_name varchar(50) NOT NULL DEFAULT '' COMMENT '操作人名称',
+ order_status int(11) NOT NULL DEFAULT 0 COMMENT '订单状态,操作后',
+ action_way bigint(20) NOT NULL DEFAULT 2 COMMENT '操作类型1买家2卖家 3 系统任务',
+ order_status_name varchar(255) NOT NULL DEFAULT '' COMMENT '订单状态名称,操作后',
+ action_time int(11) NOT NULL DEFAULT 0 COMMENT '操作时间',
+ PRIMARY KEY (id)
+)
+ENGINE = INNODB,
+CHARACTER SET utf8mb4,
+COLLATE utf8mb4_general_ci,
+COMMENT = '订单操作记录表';
+
+CREATE TABLE recharge_order_item_refund (
+ refund_id int(11) NOT NULL AUTO_INCREMENT,
+ order_item_id int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
+ order_id int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
+ order_no varchar(255) NOT NULL DEFAULT '' COMMENT '订单编号',
+ refund_no varchar(255) NOT NULL DEFAULT '0' COMMENT '退款单号',
+ site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
+ member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
+ num decimal(10, 3) NOT NULL DEFAULT 0.000 COMMENT '退货数量',
+ money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '总退款',
+ status int(11) NOT NULL DEFAULT 0 COMMENT '退款状态',
+ create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
+ audit_time int(11) NOT NULL DEFAULT 0 COMMENT '审核时间',
+ transfer_time int(11) NOT NULL DEFAULT 0 COMMENT '转账时间',
+ item_type varchar(255) NOT NULL DEFAULT '' COMMENT '项目类型',
+ PRIMARY KEY (refund_id)
+)
+ENGINE = INNODB,
+CHARACTER SET utf8mb4,
+COLLATE utf8mb4_general_ci,
+COMMENT = '订单退款表';
+
+CREATE TABLE recharge_order_item (
+ order_item_id int(11) NOT NULL AUTO_INCREMENT,
+ order_id int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
+ site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
+ member_id int(11) NOT NULL DEFAULT 0 COMMENT '购买会员id',
+ item_id int(11) NOT NULL DEFAULT 0 COMMENT '项目id',
+ item_type varchar(255) NOT NULL DEFAULT '' COMMENT '项目类型',
+ item_name varchar(400) NOT NULL DEFAULT '' COMMENT '项目名称',
+ item_image varchar(2000) NOT NULL DEFAULT '' COMMENT '项目图片',
+ price decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '项目单价',
+ num decimal(10, 3) NOT NULL DEFAULT 0.000 COMMENT '购买数量',
+ item_money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '项目总价',
+ is_refund int(11) NOT NULL DEFAULT 0 COMMENT '是否退款',
+ refund_no varchar(255) NOT NULL DEFAULT '' COMMENT '退款编号',
+ refund_status int(11) NOT NULL DEFAULT 0 COMMENT '退款状态',
+ create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
+ PRIMARY KEY (order_item_id)
+)
+ENGINE = INNODB,
+CHARACTER SET utf8mb4,
+COLLATE utf8mb4_general_ci,
+COMMENT = '订单商品表';
+
+CREATE TABLE recharge_order (
+ order_id int(11) NOT NULL AUTO_INCREMENT,
+ site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
+ order_no varchar(50) NOT NULL DEFAULT '' COMMENT '订单编号',
+ order_from varchar(55) NOT NULL DEFAULT '' COMMENT '订单来源',
+ order_type varchar(50) NOT NULL DEFAULT '' COMMENT '订单类型',
+ out_trade_no varchar(50) NOT NULL DEFAULT '' COMMENT '支付流水号',
+ order_status int(11) NOT NULL DEFAULT 0 COMMENT '订单状态',
+ refund_status int(11) NOT NULL DEFAULT 0 COMMENT '退款状态',
+ member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
+ ip varchar(20) NOT NULL DEFAULT '' COMMENT '会员ip',
+ member_message varchar(50) NOT NULL DEFAULT '' COMMENT '会员留言信息',
+ order_item_money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '订单项目金额',
+ order_discount_money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '订单优惠金额',
+ order_money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '订单金额',
+ create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
+ pay_time int(11) NOT NULL DEFAULT 0 COMMENT '订单支付时间',
+ close_time int(11) NOT NULL DEFAULT 0 COMMENT '订单关闭时间',
+ is_delete int(11) NOT NULL DEFAULT 0 COMMENT '是否删除(针对后台)',
+ is_enable_refund int(11) NOT NULL DEFAULT 0 COMMENT '是否允许退款',
+ remark varchar(255) NOT NULL DEFAULT '' COMMENT '商家留言',
+ invoice_id int(11) NOT NULL DEFAULT 0 COMMENT '发票id,0表示不开发票',
+ close_reason varchar(255) NOT NULL DEFAULT '' COMMENT '关闭原因',
+ PRIMARY KEY (order_id)
+)
+ENGINE = INNODB,
+CHARACTER SET utf8mb4,
+COLLATE utf8mb4_general_ci,
+COMMENT = '订单表';
+
CREATE TABLE pay_transfer (
id int(11) NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -697,7 +747,6 @@ CREATE TABLE pay_transfer (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 3276,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '转账表';
@@ -714,19 +763,19 @@ ADD INDEX member_withdraw_site_id (site_id, main_id);
ALTER TABLE pay_transfer
ADD INDEX member_withdraw_status (transfer_status);
---
--- `ns_pay_refund`
---
+ALTER TABLE pay_transfer
+ADD UNIQUE INDEX UK_ns_pay_transfer_transfer_no (transfer_no);
+
CREATE TABLE pay_refund (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
- refund_no varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '退款单号',
- out_trade_no varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '支付流水号',
- type varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '支付方式',
+ refund_no varchar(255) NOT NULL DEFAULT '' COMMENT '退款单号',
+ out_trade_no varchar(255) NOT NULL DEFAULT '' COMMENT '支付流水号',
+ type varchar(255) NOT NULL DEFAULT '' COMMENT '支付方式',
channel varchar(50) NOT NULL DEFAULT '' COMMENT '支付渠道',
money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '支付金额',
- reason varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '退款原因',
- status varchar(255) NOT NULL DEFAULT '0' COMMENT '支付状态(0.待退款 1. 退款中中 2. 已退款 -1已关闭)',
+ reason varchar(255) NOT NULL DEFAULT '' COMMENT '退款原因',
+ status varchar(255) NOT NULL DEFAULT '0' COMMENT '支付状态(0.待退款 1. 退款中 2. 已退款 -1已关闭)',
create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
refund_time int(11) NOT NULL DEFAULT 0 COMMENT '支付时间',
close_time int(11) NOT NULL DEFAULT 0 COMMENT '关闭时间',
@@ -734,19 +783,18 @@ CREATE TABLE pay_refund (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 5461,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '支付记录表';
---
--- `ns_pay_channel`
---
+ALTER TABLE pay_refund
+ADD UNIQUE INDEX UK_ns_pay_refund_refund_no (refund_no);
+
CREATE TABLE pay_channel (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
- site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
- type varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '支付类型',
- channel varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '支付渠道',
+ site_id int(11) NOT NULL DEFAULT 1 COMMENT '站点id',
+ type varchar(255) NOT NULL DEFAULT '' COMMENT '支付类型',
+ channel varchar(255) NOT NULL DEFAULT '' COMMENT '支付渠道',
config text NOT NULL COMMENT '支付配置',
create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
update_time int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
@@ -755,14 +803,10 @@ CREATE TABLE pay_channel (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 496,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '支付渠道配置表';
---
--- `ns_pay`
---
CREATE TABLE pay (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -785,7 +829,6 @@ CREATE TABLE pay (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 16384,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '支付记录表';
@@ -793,122 +836,6 @@ COMMENT = '支付记录表';
ALTER TABLE pay
ADD UNIQUE INDEX UK_ns_pay_out_trade_no (out_trade_no);
---
--- `ns_recharge_order_log`
---
-CREATE TABLE recharge_order_log (
- id int(11) NOT NULL AUTO_INCREMENT,
- order_id int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
- site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
- action varchar(255) NOT NULL DEFAULT '' COMMENT '操作内容',
- uid int(11) NOT NULL DEFAULT 0 COMMENT '操作人id',
- nick_name varchar(50) NOT NULL DEFAULT '' COMMENT '操作人名称',
- order_status int(11) NOT NULL DEFAULT 0 COMMENT '订单状态,操作后',
- action_way bigint(20) NOT NULL DEFAULT 2 COMMENT '操作类型1买家2卖家 3 系统任务',
- order_status_name varchar(255) NOT NULL DEFAULT '' COMMENT '订单状态名称,操作后',
- action_time int(11) NOT NULL DEFAULT 0 COMMENT '操作时间',
- PRIMARY KEY (id)
-)
-ENGINE = INNODB,
-AVG_ROW_LENGTH = 223,
-CHARACTER SET utf8mb4,
-COLLATE utf8mb4_general_ci,
-COMMENT = '订单操作记录表',
-ROW_FORMAT = COMPACT;
-
---
--- `ns_recharge_order_item_refund`
---
-CREATE TABLE recharge_order_item_refund (
- refund_id int(11) NOT NULL AUTO_INCREMENT,
- order_item_id int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
- order_id int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
- order_no varchar(255) NOT NULL DEFAULT '' COMMENT '订单编号',
- refund_no varchar(255) NOT NULL DEFAULT '0' COMMENT '退款单号',
- site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
- member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
- num decimal(10, 3) NOT NULL DEFAULT 0.000 COMMENT '退货数量',
- money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '总退款',
- status int(11) NOT NULL DEFAULT 0 COMMENT '退款状态',
- create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
- audit_time int(11) NOT NULL DEFAULT 0 COMMENT '审核时间',
- transfer_time int(11) NOT NULL DEFAULT 0 COMMENT '转账时间',
- item_type varchar(255) NOT NULL DEFAULT '' COMMENT '项目类型',
- PRIMARY KEY (refund_id)
-)
-ENGINE = INNODB,
-AVG_ROW_LENGTH = 16384,
-CHARACTER SET utf8mb4,
-COLLATE utf8mb4_general_ci,
-COMMENT = '订单退款表',
-ROW_FORMAT = COMPACT;
-
---
--- `recharge_order_item`
---
-CREATE TABLE recharge_order_item (
- order_item_id int(11) NOT NULL AUTO_INCREMENT,
- order_id int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
- site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
- member_id int(11) NOT NULL DEFAULT 0 COMMENT '购买会员id',
- item_id int(11) NOT NULL DEFAULT 0 COMMENT '项目id',
- item_type varchar(255) NOT NULL DEFAULT '' COMMENT '项目类型',
- item_name varchar(400) NOT NULL DEFAULT '' COMMENT '项目名称',
- item_image varchar(2000) NOT NULL DEFAULT '' COMMENT '项目图片',
- price decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '项目单价',
- num decimal(10, 3) NOT NULL DEFAULT 0.000 COMMENT '购买数量',
- item_money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '项目总价',
- is_refund int(11) NOT NULL DEFAULT 0 COMMENT '是否退款',
- refund_no varchar(255) NOT NULL DEFAULT '' COMMENT '退款编号',
- refund_status int(11) NOT NULL DEFAULT 0 COMMENT '退款状态',
- create_time int(11) NOT NULL DEFAULT 0,
- PRIMARY KEY (order_item_id)
-)
-ENGINE = INNODB,
-AVG_ROW_LENGTH = 16384,
-CHARACTER SET utf8mb4,
-COLLATE utf8mb4_general_ci,
-COMMENT = '订单商品表',
-ROW_FORMAT = COMPACT;
-
---
--- `recharge_order`
---
-CREATE TABLE `recharge_order` (
- order_id int(11) NOT NULL AUTO_INCREMENT,
- site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
- order_no varchar(50) NOT NULL DEFAULT '' COMMENT '订单编号',
- order_from varchar(55) NOT NULL DEFAULT '' COMMENT '订单来源',
- order_type varchar(50) NOT NULL DEFAULT '' COMMENT '订单类型',
- out_trade_no varchar(50) NOT NULL DEFAULT '' COMMENT '支付流水号',
- order_status int(11) NOT NULL DEFAULT 0 COMMENT '订单状态',
- refund_status int(11) NOT NULL DEFAULT 0 COMMENT '退款状态',
- member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
- ip varchar(20) NOT NULL DEFAULT '' COMMENT '会员ip',
- member_message varchar(50) NOT NULL DEFAULT '' COMMENT '会员留言信息',
- order_item_money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '订单项目金额',
- order_discount_money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '订单优惠金额',
- order_money decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '订单金额',
- create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
- pay_time int(11) NOT NULL DEFAULT 0 COMMENT '订单支付时间',
- close_time int(11) NOT NULL DEFAULT 0 COMMENT '订单关闭时间',
- is_delete int(11) NOT NULL DEFAULT 0 COMMENT '是否删除(针对后台)',
- is_enable_refund int(11) NOT NULL DEFAULT 0 COMMENT '是否允许退款',
- remark varchar(255) NOT NULL DEFAULT '' COMMENT '商家留言',
- invoice_id int(11) NOT NULL DEFAULT 0 COMMENT '发票id,0表示不开发票',
- close_reason varchar(255) NOT NULL DEFAULT '' COMMENT '关闭原因',
- PRIMARY KEY (order_id)
-)
-ENGINE = INNODB,
-AVG_ROW_LENGTH = 16384,
-CHARACTER SET utf8mb4,
-COLLATE utf8mb4_general_ci,
-COMMENT = '订单表',
-ROW_FORMAT = COMPACT;
-
---
--- `ns_member_level`
---
CREATE TABLE member_level (
level_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '会员等级',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -921,11 +848,9 @@ CREATE TABLE member_level (
PRIMARY KEY (level_id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 16384,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '会员等级',
-ROW_FORMAT = COMPACT;
+COMMENT = '会员等级';
ALTER TABLE member_level
ADD INDEX site_id (site_id);
@@ -933,9 +858,6 @@ ADD INDEX site_id (site_id);
ALTER TABLE member_level
ADD INDEX status (status);
---
--- `ns_member_label`
---
CREATE TABLE member_label (
label_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '标签id',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -948,11 +870,9 @@ CREATE TABLE member_label (
INDEX label_id (label_id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 8192,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '会员标签',
-ROW_FORMAT = COMPACT;
+COMMENT = '会员标签';
ALTER TABLE member_label
ADD INDEX site_id (site_id);
@@ -960,13 +880,10 @@ ADD INDEX site_id (site_id);
ALTER TABLE member_label
ADD INDEX sort (sort);
---
--- `ns_member_cash_out_account`
---
CREATE TABLE member_cash_out_account (
account_id int(11) NOT NULL AUTO_INCREMENT,
- site_id int(11) NOT NULL COMMENT '站点id',
- member_id int(11) NOT NULL COMMENT '会员id',
+ site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
+ member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
account_type varchar(255) NOT NULL DEFAULT '' COMMENT '账户类型',
bank_name varchar(255) NOT NULL DEFAULT '' COMMENT '银行名称',
realname varchar(255) NOT NULL DEFAULT '' COMMENT '真实名称',
@@ -976,14 +893,10 @@ CREATE TABLE member_cash_out_account (
PRIMARY KEY (account_id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 8192,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '会员提现账户';
---
--- `ns_member_cash_out`
---
CREATE TABLE member_cash_out (
id int(11) NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -1014,7 +927,6 @@ CREATE TABLE member_cash_out (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 297,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '会员提现表';
@@ -1034,9 +946,6 @@ ADD INDEX member_withdraw_status (status);
ALTER TABLE member_cash_out
ADD INDEX member_withdraw_withdraw_no (cash_out_no);
---
--- `ns_member_address`
---
CREATE TABLE member_address (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
@@ -1057,18 +966,13 @@ CREATE TABLE member_address (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 16384,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '会员收货地址',
-ROW_FORMAT = COMPACT;
+COMMENT = '会员收货地址';
ALTER TABLE member_address
ADD INDEX IDX_member_address (member_id, site_id);
---
--- `ns_member_account_log`
---
CREATE TABLE member_account_log (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
member_id int(11) NOT NULL DEFAULT 0 COMMENT '用户id',
@@ -1083,27 +987,22 @@ CREATE TABLE member_account_log (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 4096,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '会员账单表',
-ROW_FORMAT = COMPACT;
+COMMENT = '会员账单表';
ALTER TABLE member_account_log
-ADD INDEX account_type (account_type (191));
+ADD INDEX account_type (account_type);
ALTER TABLE member_account_log
ADD INDEX create_time (create_time);
ALTER TABLE member_account_log
-ADD INDEX from_type (from_type (191));
+ADD INDEX from_type (from_type);
ALTER TABLE member_account_log
ADD INDEX member_id (member_id);
---
--- `ns_member`
---
CREATE TABLE member (
member_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
member_no varchar(255) NOT NULL DEFAULT '' COMMENT '会员编码',
@@ -1145,7 +1044,7 @@ CREATE TABLE member (
growth_get int(11) NOT NULL DEFAULT 0 COMMENT '累计获得成长值',
commission decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '当前佣金',
commission_get decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '佣金获取',
- commission_cash_outing decimal(10, 2) NOT NULL COMMENT '提现中佣金',
+ commission_cash_outing decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '提现中佣金',
is_member tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否是会员',
member_time int(11) NOT NULL DEFAULT 0 COMMENT '成为会员时间',
is_del tinyint(4) NOT NULL DEFAULT 0 COMMENT '0正常 1已删除',
@@ -1159,36 +1058,31 @@ CREATE TABLE member (
PRIMARY KEY (member_id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 4096,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
-COMMENT = '会员表',
-ROW_FORMAT = COMPACT;
+COMMENT = '会员表';
ALTER TABLE member
ADD INDEX mobile (mobile);
ALTER TABLE member
-ADD INDEX password (password (191));
+ADD INDEX password (password);
ALTER TABLE member
ADD INDEX site_id (site_id);
ALTER TABLE member
-ADD INDEX username (username (191));
+ADD INDEX username (username);
ALTER TABLE member
-ADD INDEX weapp_openid (weapp_openid (191));
+ADD INDEX weapp_openid (weapp_openid);
ALTER TABLE member
-ADD INDEX wx_openid (wx_openid (191));
+ADD INDEX wx_openid (wx_openid);
ALTER TABLE member
-ADD INDEX wx_unionid (wx_unionid (191));
+ADD INDEX wx_unionid (wx_unionid);
---
--- `ns_jobs_failed`
---
CREATE TABLE jobs_failed (
id int(11) NOT NULL AUTO_INCREMENT,
`connection` text NOT NULL,
@@ -1203,9 +1097,6 @@ CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '消息队列任务失败记录表';
---
--- `ns_jobs`
---
CREATE TABLE jobs (
id int(11) NOT NULL AUTO_INCREMENT,
queue varchar(255) NOT NULL,
@@ -1217,16 +1108,13 @@ CREATE TABLE jobs (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 5461,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '消息队列任务表';
-ALTER TABLE jobs ADD INDEX queue (queue);
+ALTER TABLE jobs
+ADD INDEX queue (queue);
---
--- `ns_generate_table`
---
CREATE TABLE generate_table (
id int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
table_name varchar(255) NOT NULL DEFAULT '' COMMENT '表名',
@@ -1238,14 +1126,10 @@ CREATE TABLE generate_table (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 780,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '代码生成表';
---
--- `ns_generate_column`
---
CREATE TABLE generate_column (
id int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
table_id int(11) NOT NULL DEFAULT 0 COMMENT '表id',
@@ -1263,18 +1147,14 @@ CREATE TABLE generate_column (
view_type varchar(100) DEFAULT 'input' COMMENT '显示类型',
dict_type varchar(255) DEFAULT '' COMMENT '字典类型',
create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
- update_time int(11) NOT NULL DEFAULT 0 NULL COMMENT '修改时间',
+ update_time int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 321,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '代码生成表字段信息表';
---
--- `ns_diy_route`
---
CREATE TABLE diy_route (
id int(11) NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
@@ -1287,22 +1167,21 @@ CREATE TABLE diy_route (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 2730,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '自定义路由';
---
--- `ns_diy_page`
---
CREATE TABLE diy_page (
id int(11) NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
title varchar(255) NOT NULL DEFAULT '' COMMENT '页面名称',
name varchar(255) NOT NULL DEFAULT '' COMMENT '页面标识',
type varchar(255) NOT NULL DEFAULT '' COMMENT '页面模板',
+ template varchar(255) NOT NULL DEFAULT '' COMMENT '模板名称',
+ mode varchar(255) NOT NULL DEFAULT 'diy' COMMENT '页面展示模式,diy:自定义,fixed:固定',
value longtext DEFAULT NULL COMMENT '页面数据,json格式',
is_default int(11) NOT NULL DEFAULT 0 COMMENT '是否默认页面,1:是,0:否',
+ is_change int(11) NOT NULL DEFAULT 0 COMMENT '数据是否发生过变化,1:变化了,2:没有',
share varchar(1000) NOT NULL DEFAULT '' COMMENT '分享内容',
visit_count int(11) NOT NULL DEFAULT 0 COMMENT '访问量',
create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
@@ -1310,14 +1189,10 @@ CREATE TABLE diy_page (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 5461,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '自定义页面';
---
--- `ns_article_category`
---
CREATE TABLE article_category (
category_id int(11) NOT NULL AUTO_INCREMENT COMMENT '文章分类id',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点ID',
@@ -1329,7 +1204,6 @@ CREATE TABLE article_category (
PRIMARY KEY (category_id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 8192,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '文章分类表';
@@ -1346,9 +1220,6 @@ ADD INDEX site_id (site_id);
ALTER TABLE article_category
ADD INDEX sort (sort);
---
--- `ns_article`
---
CREATE TABLE article (
id int(11) NOT NULL AUTO_INCREMENT COMMENT '文章id',
category_id int(11) NOT NULL COMMENT '文章分类',
@@ -1368,7 +1239,6 @@ CREATE TABLE article (
PRIMARY KEY (id)
)
ENGINE = INNODB,
-AVG_ROW_LENGTH = 5461,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '文章表';
@@ -1388,9 +1258,6 @@ ADD INDEX IDX_article_site_id (site_id);
ALTER TABLE article
ADD INDEX IDX_ns_article_sort (sort);
---
--- `ns_addon_log`
---
CREATE TABLE addon_log (
id int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
action varchar(40) NOT NULL DEFAULT '' COMMENT '操作类型 install 安装 uninstall 卸载 update 更新',
@@ -1405,18 +1272,15 @@ CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = '插件日志表';
---
--- `ns_addon`
---
CREATE TABLE addon (
id int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
- title varchar(40) NOT NULL DEFAULT '' COMMENT '插件名称',
- icon varchar(255) NOT NULL DEFAULT '' COMMENT '插件图标',
- `key` varchar(20) NOT NULL DEFAULT '' COMMENT '插件标识',
- `desc` text DEFAULT NULL COMMENT '插件描述',
+ title varchar(40) NOT NULL DEFAULT '' COMMENT '插件名称',
+ icon varchar(255) NOT NULL DEFAULT '' COMMENT '插件图标',
+ `key` varchar(20) NOT NULL DEFAULT '' COMMENT '插件标识',
+ `desc` text DEFAULT NULL COMMENT '插件描述',
status tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态',
- author varchar(40) NOT NULL DEFAULT '' COMMENT '作者',
- version varchar(20) NOT NULL DEFAULT '' COMMENT '版本号',
+ author varchar(40) NOT NULL DEFAULT '' COMMENT '作者',
+ version varchar(20) NOT NULL DEFAULT '' COMMENT '版本号',
create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
install_time int(11) NOT NULL DEFAULT 0 COMMENT '安装时间',
update_time int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
@@ -1431,9 +1295,12 @@ COMMENT = '插件表';
ALTER TABLE addon
ADD UNIQUE INDEX UK_title (title);
---
--- Dumping data for table ns_sys_area
---
+INSERT INTO sys_user_role VALUES
+(1, 1, 0, '', 0, 1);
+
+INSERT INTO sys_user VALUES
+(1, '', '', '', '', '', 0, 0, 0, 1, 0, 0, 0);
+
INSERT INTO sys_area VALUES
(110000, 0, '北京市', '北京', '116.40529', '39.904987', 1, 0, 1),
(110100, 110000, '北京市', '北京', '116.40529', '39.904987', 2, 0, 1),
@@ -5081,10 +4948,5 @@ INSERT INTO sys_area VALUES
(460400499, 460400, '洋浦经济开发区', '洋浦经济开发区', '109.202064', '19.736941', 3, 0, 1),
(460400500, 460400, '华南热作学院', '华南热作学院', '109.494073', '19.505382', 3, 0, 1);
-INSERT INTO sys_user_role(id, uid, site_id, is_admin) VALUE
-(1, 1, 0, 1);
-
-INSERT INTO sys_user(uid, username) VALUE
-(1, '');
-INSERT INTO site(site_id, site_name, app_type) VALUE
-(1, 'niucloud-admin', 'admin');
+INSERT INTO site VALUES
+(1, '', 'niucloud-admin', 0, '', 'admin', '', '', 1, '', '', 0, 0, 0, '', '', '', '', 0, 0, '', '', '', '0');
diff --git a/niucloud/app/job/schedule/SiteExpireClose.php b/niucloud/app/job/schedule/SiteExpireClose.php
index d8c3cbe0c..0204238dc 100644
--- a/niucloud/app/job/schedule/SiteExpireClose.php
+++ b/niucloud/app/job/schedule/SiteExpireClose.php
@@ -13,6 +13,7 @@ namespace app\job\schedule;
use app\service\core\site\CoreSiteService;
use core\base\BaseJob;
+use think\facade\Log;
/**
* 站点到期自动关闭
@@ -28,7 +29,7 @@ class SiteExpireClose extends BaseJob
$core_site_service->expire($v['site_id']);
}
}
-// Log::write('站点到期自动关闭'.date('Y-m-d h:i:s'));
+ Log::write('站点到期自动关闭'.date('Y-m-d h:i:s'));
return true;
}
}
diff --git a/niucloud/app/lang/en/dict.php b/niucloud/app/lang/en/dict.php
index 20d00b82d..8a9eefd0b 100644
--- a/niucloud/app/lang/en/dict.php
+++ b/niucloud/app/lang/en/dict.php
@@ -98,14 +98,11 @@ return [
'status_off' => 'off'
],
//自动任务时间间隔
- 'dict_cron' => [
- 'type_minute' => 'minute',
- 'type_day' => 'day',
- 'type_week' => 'week',
- 'type_month' => 'month',
-
+ 'dict_schedule' => [
'type_cron' => 'time work',
- 'type_crond' => 'period work'
+ 'type_crond' => 'period work',
+ 'on' => 'on',
+ 'off' => 'off'
],
//支付相关
'dict_pay' => [
@@ -270,4 +267,27 @@ return [
'sms_notice_records' => 'send log',
'map_setting' => 'map config',
],
+ 'dict_date' => [
+ //week
+ 'mon' => 'monday',
+ 'tue' => 'tuesday',
+ 'wed' => 'wednesday',
+ 'thur' => 'thursday',
+ 'fri' => 'friday',
+ 'sat' => 'saturday',
+ 'sun' => 'sunday',
+ //month
+ 'jan' => 'january',
+ 'feb' => 'february',
+ 'mar' => 'march',
+ 'apr' => 'april',
+ 'may' => 'may',
+ 'jun' => 'june',
+ 'jul' => 'july',
+ 'aug' => 'august',
+ 'sept' => 'sept',
+ 'oct' => 'october',
+ 'nov' => 'november',
+ 'dec' => 'december',
+ ],
];
diff --git a/niucloud/app/lang/zh-cn/api.php b/niucloud/app/lang/zh-cn/api.php
index 832ee5ea6..bbc3b9242 100644
--- a/niucloud/app/lang/zh-cn/api.php
+++ b/niucloud/app/lang/zh-cn/api.php
@@ -38,6 +38,7 @@ return [
'ADDON_INSTALL_NOT_EXIST' => '未找到插件安装任务',
'ADDON_INSTALL_EXECUTED' => '插件安装任务已执行',
'INSTALL_CHECK_NOT_PASS' => '安装校验未通过',
+ 'SITE_INDEX_VIEW_PATH_NOT_EXIST' => '当前首页路径不存在',
//登录注册重置账号....
diff --git a/niucloud/app/lang/zh-cn/dict.php b/niucloud/app/lang/zh-cn/dict.php
index aa64e5d45..d916f9c17 100644
--- a/niucloud/app/lang/zh-cn/dict.php
+++ b/niucloud/app/lang/zh-cn/dict.php
@@ -42,7 +42,15 @@ return [
'status_on' => '正常',
'status_experience' => '体验期',
'status_expire' => '已到期',
- 'status_close' => '已停止'
+ 'status_close' => '已停止',
+ 'pay' => '收款',
+ 'refund' => '退款',
+ 'transfer' => '转账',
+ ],
+ // 站点
+ 'dict_site_index' => [
+ //站点类型
+ 'system' => '框架首页',
],
'dict_notice' => [
'type_sms' => '短信',
@@ -125,14 +133,11 @@ return [
'status_off' => '停用'
],
//自动任务时间间隔
- 'dict_cron' => [
- 'type_minute' => '分钟',
- 'type_day' => '天',
- 'type_week' => '星期',
- 'type_month' => '月',
-
+ 'dict_schedule' => [
'type_cron' => '定时任务',
- 'type_crond' => '周期任务'
+ 'type_crond' => '周期任务',
+ 'on' => '启用',
+ 'off' => '关闭'
],
//支付相关
'dict_pay' => [
@@ -263,6 +268,31 @@ return [
'mysql_ask' => '大于等于5.7',
'php_authority_ask' => '开启',
'file_authority_ask' => '可读可写'
- ]
+ ],
+ //日期
+ 'dict_date' => [
+ //星期
+ 'mon' => '周一',
+ 'tue' => '周二',
+ 'wed' => '周三',
+ 'thur' => '周四',
+ 'fri' => '周五',
+ 'sat' => '周六',
+ 'sun' => '周日',
+ //月份
+ 'jan' => '1月',
+ 'feb' => '2月',
+ 'mar' => '3月',
+ 'apr' => '4月',
+ 'may' => '5月',
+ 'jun' => '6月',
+ 'jul' => '7月',
+ 'aug' => '8月',
+ 'sept' => '9月',
+ 'oct' => '10月',
+ 'nov' => '11月',
+ 'dec' => '12月',
+
+ ],
];
diff --git a/niucloud/app/listener/pay/PaySuccessListener.php b/niucloud/app/listener/pay/PaySuccessListener.php
index 120c407b6..ab637f9d8 100644
--- a/niucloud/app/listener/pay/PaySuccessListener.php
+++ b/niucloud/app/listener/pay/PaySuccessListener.php
@@ -12,6 +12,7 @@
namespace app\listener\pay;
use app\service\core\order\recharge\CoreRechargeOrderService;
+use app\service\core\site\CoreSiteAccountService;
/**
* 支付异步回调事件
@@ -25,5 +26,8 @@ class PaySuccessListener
{
(new CoreRechargeOrderService())->pay($pay_info);
}
+ //账单记录添加
+ (new CoreSiteAccountService())->addPayLog($pay_info);
+
}
}
\ No newline at end of file
diff --git a/niucloud/app/listener/pay/RefundSuccessListener.php b/niucloud/app/listener/pay/RefundSuccessListener.php
index 48be20575..c453b0c8e 100644
--- a/niucloud/app/listener/pay/RefundSuccessListener.php
+++ b/niucloud/app/listener/pay/RefundSuccessListener.php
@@ -11,8 +11,10 @@
namespace app\listener\pay;
+use app\model\site\SiteAccountLog;
use app\service\core\order\recharge\CoreRechargeOrderService;
use app\service\core\order\recharge\CoreRechargeRefundService;
+use app\service\core\site\CoreSiteAccountService;
/**
* 退款成功事件
@@ -21,10 +23,14 @@ class RefundSuccessListener
{
public function handle(array $refund_info)
{
+ //添加账单记录
+ (new CoreSiteAccountService())->addRefundLog($refund_info['site_id'], $refund_info['refund_no']);
+ //交易单据处理
$trade_type = $refund_info['trade_type'] ?? '';
if($trade_type == 'recharge')
{
(new CoreRechargeRefundService())->refundComplete($refund_info['refund_no']);
}
+
}
}
\ No newline at end of file
diff --git a/niucloud/app/listener/pay/TransferSuccessListener.php b/niucloud/app/listener/pay/TransferSuccessListener.php
index 6e68b05b5..48701ffe1 100644
--- a/niucloud/app/listener/pay/TransferSuccessListener.php
+++ b/niucloud/app/listener/pay/TransferSuccessListener.php
@@ -13,6 +13,7 @@ namespace app\listener\pay;
use app\dict\cash_out\CashOutTypeDict;
use app\service\core\member\CoreMemberCashOutService;
+use app\service\core\site\CoreSiteAccountService;
/**
* 转账事件
@@ -21,6 +22,8 @@ class TransferSuccessListener
{
public function handle(array $info)
{
+ //添加账单记录
+ (new CoreSiteAccountService())->addTransferLog($info['site_id'], $info['transfer_no']);
//会员零钱提现
if($info['trade_type'] == CashOutTypeDict::MEMBER_CASH_OUT)
{
diff --git a/niucloud/app/listener/system/AppManageListener.php b/niucloud/app/listener/system/AppManageListener.php
index 36dc283c2..22aa56f0a 100644
--- a/niucloud/app/listener/system/AppManageListener.php
+++ b/niucloud/app/listener/system/AppManageListener.php
@@ -20,7 +20,7 @@ class AppManageListener
{
public function handle()
{
- $data = [
+ return [
"category" =>[
[
@@ -45,9 +45,8 @@ class AppManageListener
"desc" => get_lang('dict_app_manage.member_recharge'),
"icon" => "static/resource/images/app/recharge_icon.png",
"cover" => "static/resource/images/app/recharge_cover.png",
- "url" => "/finance/recharge"
+ "url" => "/order/recharge/order"
],
];
- return $data;
}
}
\ No newline at end of file
diff --git a/niucloud/app/listener/system/SiteIndexListener.php b/niucloud/app/listener/system/SiteIndexListener.php
new file mode 100644
index 000000000..114276e04
--- /dev/null
+++ b/niucloud/app/listener/system/SiteIndexListener.php
@@ -0,0 +1,30 @@
+ get_lang("dict_site_index.system"),
+ "view_path" => "index/site_index"
+ ]
+ ];
+ }
+}
\ No newline at end of file
diff --git a/niucloud/app/model/addon/Addon.php b/niucloud/app/model/addon/Addon.php
index 271a58cd5..8df9e59fe 100644
--- a/niucloud/app/model/addon/Addon.php
+++ b/niucloud/app/model/addon/Addon.php
@@ -45,7 +45,7 @@ class Addon extends BaseModel
*/
public function getStatusNameAttr($value, $data)
{
- return AddonDict::getStatus()[ $data[ 'status' ] ?? '' ] ?? '';
+ return AddonDict::getStatus()[ $data[ 'status' ]] ?? '';
}
/**
diff --git a/niucloud/app/model/article/Article.php b/niucloud/app/model/article/Article.php
index 945f55f8b..2e8c9ed2f 100644
--- a/niucloud/app/model/article/Article.php
+++ b/niucloud/app/model/article/Article.php
@@ -11,6 +11,7 @@
namespace app\model\article;
+use app\model\site\Site;
use core\base\BaseModel;
use think\db\Query;
use think\model\relation\HasOne;
@@ -99,12 +100,16 @@ class Article extends BaseModel
}
public function getArticleUrlAttr($value, $data) {
- $site_tag = $data['site_id'] == 1 ? '' : '/s' . $data['site_id'];
- $data = [
- 'wap_url' => ( !empty(env("system.wap_domain")) ? env("system.wap_domain") : request()->domain() ) . "/wap" . $site_tag . "/pages/article/detail?id={$data['id']}",
- 'web_url' => ( !empty(env("system.web_domain")) ? env("system.web_domain") : request()->domain() ) . "/web" . $site_tag . "/article/detail?id={$data['id']}"
+ $site = Site::find($data['site_id']);
+ $site_tag = $site['site_code'];
+
+ $wap_domain = !empty(env("system.wap_domain")) ? preg_replace('#/$#', '', env("system.wap_domain")) : request()->domain();
+ $web_domain = !empty(env("system.web_domain")) ? preg_replace('#/$#', '', env("system.web_domain")) : request()->domain();
+
+ return [
+ 'wap_url' => $wap_domain . "/wap/" . $site_tag . "/pages/article/detail?id={$data['id']}",
+ 'web_url' => $web_domain . "/web/" . $site_tag . "/article/detail?id={$data['id']}"
];
- return $data;
}
}
diff --git a/niucloud/app/model/diy/Diy.php b/niucloud/app/model/diy/Diy.php
index 295c2107f..1ca8bfe7f 100644
--- a/niucloud/app/model/diy/Diy.php
+++ b/niucloud/app/model/diy/Diy.php
@@ -47,7 +47,10 @@ class Diy extends BaseModel
*/
public function getTypeNameAttr($value, $data)
{
- return TemplateDict::getTemplate($data[ 'type' ] ?? '')[ 'title' ] ?? '';
+ if (!empty($data[ 'type' ])) {
+ return TemplateDict::getTemplate([ 'type' => $data[ 'type' ] ])[ $data[ 'type' ] ][ 'title' ] ?? '';
+ }
+ return '';
}
/**
diff --git a/niucloud/app/model/member/Member.php b/niucloud/app/model/member/Member.php
index 51e942e41..883a5fa74 100644
--- a/niucloud/app/model/member/Member.php
+++ b/niucloud/app/model/member/Member.php
@@ -72,7 +72,9 @@ class Member extends BaseModel
*/
public function getStatusNameAttr($value, $data)
{
- return MemberDict::getStatus()[$data['status'] ?? ''] ?? '';
+ if(empty($data['status']))
+ return '';
+ return MemberDict::getStatus()[$data['status']] ?? '';
}
/**
* 注册来源字段转化
@@ -81,7 +83,9 @@ class Member extends BaseModel
*/
public function getRegisterChannelNameAttr($value, $data)
{
- return MemberRegisterChannelDict::getType()[ $data[ 'register_channel' ] ?? '' ] ?? '';
+ if(empty($data['register_channel']))
+ return '';
+ return MemberRegisterChannelDict::getType()[ $data[ 'register_channel' ]] ?? '';
}
/**
@@ -91,7 +95,9 @@ class Member extends BaseModel
*/
public function getRegisterTypeNameAttr($value, $data)
{
- return MemberRegisterTypeDict::getType()[ $data[ 'register_type' ] ?? '' ] ?? '';
+ if(empty($data['register_type']))
+ return '';
+ return MemberRegisterTypeDict::getType()[ $data[ 'register_type' ]] ?? '';
}
/**
@@ -101,7 +107,9 @@ class Member extends BaseModel
*/
public function getLoginChannelNameAttr($value, $data)
{
- return ChannelDict::getType()[ $data[ 'login_channel' ] ?? '' ] ?? '';
+ if(empty($data['login_channel']))
+ return '';
+ return ChannelDict::getType()[ $data[ 'login_channel' ]] ?? '';
}
/**
@@ -111,7 +119,9 @@ class Member extends BaseModel
*/
public function getLoginTypeNameAttr($value, $data)
{
- return MemberLoginTypeDict::getType()[ $data[ 'login_type' ] ?? '' ] ?? '';
+ if(empty($data['login_type']))
+ return '';
+ return MemberLoginTypeDict::getType()[ $data[ 'login_type' ]] ?? '';
}
/**
@@ -122,7 +132,9 @@ class Member extends BaseModel
*/
public function getSexNameAttr($value, $data)
{
- return CommonDict::getSexType()[ $data[ 'sex' ] ?? '' ] ?? '';
+ if(empty($data['sex']))
+ return '';
+ return CommonDict::getSexType()[ $data[ 'sex' ]] ?? '';
}
/**
diff --git a/niucloud/app/model/member/MemberAccountLog.php b/niucloud/app/model/member/MemberAccountLog.php
index 9dbaaf515..45f7c707b 100644
--- a/niucloud/app/model/member/MemberAccountLog.php
+++ b/niucloud/app/model/member/MemberAccountLog.php
@@ -44,7 +44,9 @@ class MemberAccountLog extends BaseModel
*/
public function getAccountTypeNameAttr($value,$data)
{
- return MemberAccountTypeDict::getType()[$data['account_type'] ?? ''] ?? '';
+ if(empty($data['account_type']))
+ return '';
+ return MemberAccountTypeDict::getType()[$data['account_type']] ?? '';
}
/**
diff --git a/niucloud/app/model/member/MemberCashOut.php b/niucloud/app/model/member/MemberCashOut.php
index c650d5f00..c535b4248 100644
--- a/niucloud/app/model/member/MemberCashOut.php
+++ b/niucloud/app/model/member/MemberCashOut.php
@@ -76,7 +76,9 @@ class MemberCashOut extends BaseModel
* @return mixed|string
*/
public function getAccountTypeNameAttr($value, $data){
- return MemberAccountTypeDict::getType()[ $data[ 'account_type' ] ?? '' ] ?? '';
+ if(empty($data['account_type']))
+ return '';
+ return MemberAccountTypeDict::getType()[ $data[ 'account_type' ]] ?? '';
}
/**
* 提现状态名称
@@ -85,7 +87,9 @@ class MemberCashOut extends BaseModel
* @return mixed|string
*/
public function getStatusNameAttr($value, $data){
- return MemberCashOutDict::getStatus()[ $data[ 'status' ] ?? '' ] ?? '';
+ if(empty($data[ 'status' ]))
+ return '';
+ return MemberCashOutDict::getStatus()[ $data[ 'status' ]] ?? '';
}
/**
* 转账方式名称
@@ -95,7 +99,10 @@ class MemberCashOut extends BaseModel
*/
public function getTransferTypeNameAttr($value, $data)
{
- return TransferDict::getTransferType()[ $data[ 'transfer_type' ] ?? '' ]['name'] ?? '';
+ if(empty($data[ 'transfer_type' ]))
+ return '';
+ $temp = TransferDict::getTransferType()[ $data[ 'transfer_type' ]] ?? [];
+ return $temp['name'] ?? '';
}
/**
@@ -105,7 +112,9 @@ class MemberCashOut extends BaseModel
* @return mixed|string
*/
public function getTransferStatusNameAttr($value, $data){
- return TransferDict::getStatus()[ $data[ 'transfer_status' ] ?? '' ] ?? '';
+ if(empty($data[ 'transfer_status' ]))
+ return '';
+ return TransferDict::getStatus()[ $data[ 'transfer_status' ]] ?? '';
}
/**
* 会员搜索
diff --git a/niucloud/app/model/member/MemberCashOutAccount.php b/niucloud/app/model/member/MemberCashOutAccount.php
index 5f099c1ab..c1e22a690 100644
--- a/niucloud/app/model/member/MemberCashOutAccount.php
+++ b/niucloud/app/model/member/MemberCashOutAccount.php
@@ -39,7 +39,10 @@ class MemberCashOutAccount extends BaseModel
* @return mixed|string
*/
public function getAccountTypeNameAttr($value, $data){
- return TransferDict::getTransferType()[ $data[ 'transfer_type' ] ?? '' ] ?? '';
+ if(empty($data[ 'transfer_type' ]))
+ return '';
+ $temp = TransferDict::getTransferType()[ $data[ 'transfer_type' ]] ?? [];
+ return $temp['name'] ?? '';
}
/**
diff --git a/niucloud/app/model/order/RechargeOrderItemRefund.php b/niucloud/app/model/order/RechargeOrderItemRefund.php
index f7f24c59d..0b991459f 100644
--- a/niucloud/app/model/order/RechargeOrderItemRefund.php
+++ b/niucloud/app/model/order/RechargeOrderItemRefund.php
@@ -49,7 +49,10 @@ class RechargeOrderItemRefund extends BaseModel
*/
public function getStatusNameAttr($value, $data)
{
- return RechargeOrderDict::getRefundStatus()[$data['status'] ?? '']['name'] ?? '';
+ if(empty($data['status']))
+ return '';
+ $temp = RechargeOrderDict::getRefundStatus()[$data['status']] ?? [];
+ return $temp['name'] ?? '';
}
/**
diff --git a/niucloud/app/model/pay/Pay.php b/niucloud/app/model/pay/Pay.php
index d010a003d..40fe79096 100644
--- a/niucloud/app/model/pay/Pay.php
+++ b/niucloud/app/model/pay/Pay.php
@@ -53,7 +53,9 @@ class Pay extends BaseModel
*/
public function getStatusNameAttr($value, $data)
{
- return PayDict::getStatus()[$data['status'] ?? ''] ?? '';
+ if(empty($data['status']))
+ return '';
+ return PayDict::getStatus()[$data['status']] ?? '';
}
/**
* 支付方式字段转化
@@ -62,7 +64,10 @@ class Pay extends BaseModel
*/
public function getTypeNameAttr($value, $data)
{
- return PayDict::getPayType()[$data['type'] ?? '']['name'] ?? '';
+ if(empty($data['type']))
+ return '';
+ $temp = PayDict::getPayType()[$data['type']] ?? [];
+ return $temp['name'] ?? '';
}
}
diff --git a/niucloud/app/model/pay/PayChannel.php b/niucloud/app/model/pay/PayChannel.php
index a745f3389..da24a7864 100644
--- a/niucloud/app/model/pay/PayChannel.php
+++ b/niucloud/app/model/pay/PayChannel.php
@@ -47,7 +47,9 @@ class PayChannel extends BaseModel
*/
public function getTypeNameAttr($value, $data)
{
- return PayDict::getPayType()[$data['type'] ?? '']['name'] ?? '';
+ if(empty($data['type'])) return '';
+ $temp = PayDict::getPayType()[$data['type']] ?? [];
+ return $temp['name'] ?? '';
}
/**
@@ -57,7 +59,8 @@ class PayChannel extends BaseModel
*/
public function getChannelNameAttr($value, $data)
{
- return ChannelDict::getType()[$data['channel'] ?? ''] ?? '';
+ if(empty($data['channel'])) return '';
+ return ChannelDict::getType()[$data['channel']] ?? '';
}
}
diff --git a/niucloud/app/model/pay/Refund.php b/niucloud/app/model/pay/Refund.php
index 9eaef4ee3..446c3dcc4 100644
--- a/niucloud/app/model/pay/Refund.php
+++ b/niucloud/app/model/pay/Refund.php
@@ -47,7 +47,8 @@ class Refund extends BaseModel
*/
public function getStatusNameAttr($value, $data)
{
- return RefundDict::getStatus()[$data['status'] ?? ''] ?? '';
+ if(empty($data['status'])) return '';
+ return RefundDict::getStatus()[$data['status']] ?? '';
}
/**
@@ -57,7 +58,8 @@ class Refund extends BaseModel
*/
public function getTypeNameAttr($value, $data)
{
- return RefundDict::getType()[$data['type'] ?? ''] ?? '';
+ if(empty($data['type'])) return '';
+ return RefundDict::getType()[$data['type']] ?? '';
}
}
diff --git a/niucloud/app/model/pay/Transfer.php b/niucloud/app/model/pay/Transfer.php
index 9d88c91d6..eb5edfa40 100644
--- a/niucloud/app/model/pay/Transfer.php
+++ b/niucloud/app/model/pay/Transfer.php
@@ -48,7 +48,8 @@ class Transfer extends BaseModel
*/
public function getTransferStatusNameAttr($value, $data)
{
- return TransferDict::getStatus()[$data['transfer_status'] ?? ''] ?? '';
+ if(empty($data['transfer_status'])) return '';
+ return TransferDict::getStatus()[$data['transfer_status']] ?? '';
}
@@ -59,7 +60,9 @@ class Transfer extends BaseModel
*/
public function getTransferTypeNameAttr($value, $data)
{
- return TransferDict::getTransferType()[$data['transfer_type'] ?? '']['name'] ?? '';
+ if(empty($data['transfer_type'])) return '';
+ $temp = TransferDict::getTransferType()[$data['transfer_type']] ?? [];
+ return $temp['name'] ?? '';
}
}
diff --git a/niucloud/app/model/site/Site.php b/niucloud/app/model/site/Site.php
index 4bbe2ad74..285a1b1d4 100644
--- a/niucloud/app/model/site/Site.php
+++ b/niucloud/app/model/site/Site.php
@@ -46,7 +46,9 @@ class Site extends BaseModel
*/
public function getStatusNameAttr($value, $data)
{
- return SiteDict::getStatus()[$data['status'] ?? ''] ?? '';
+ if(empty($data['status']))
+ return '';
+ return SiteDict::getStatus()[$data['status']] ?? '';
}
/**
* 关键字搜索
diff --git a/niucloud/app/model/site/SiteAccountLog.php b/niucloud/app/model/site/SiteAccountLog.php
new file mode 100644
index 000000000..6f795bbe7
--- /dev/null
+++ b/niucloud/app/model/site/SiteAccountLog.php
@@ -0,0 +1,118 @@
+where([['out_trade_no', '=', $data['trade_no']]])->append(['type_name'])->findOrEmpty()->toArray();
+ break;
+ case 'refund' :
+ return (new Refund())->where([['refund_no', '=', $data['trade_no']]])->findOrEmpty()->toArray();
+ break;
+ case 'transfer':
+ return (new Transfer())->where([['transfer_no', '=', $data['trade_no']]])->findOrEmpty()->toArray();
+ break;
+ default:
+ return [];
+ }
+ }
+ /**
+ * 状态字段转化
+ * @param $value
+ * @return mixed
+ */
+ public function searchTypeAttr($query, $value, $data)
+ {
+ if ($value) {
+ $query->where('type', '=', $value );
+ }
+ }
+
+ /**
+ * 金额转化
+ * @param $value
+ * @return mixed
+ */
+ public function getMoneyAttr($value, $data)
+ {
+ if(strpos($data['money'], "-") !== false){
+ return $data['money'];
+ }else{
+ return "+".$data['money'];
+ }
+ }
+
+ /**
+ * 创建时间搜索器
+ * @param $value
+ */
+ public function searchCreateTimeAttr(Query $query, $value, $data)
+ {
+ $start_time = empty($value[ 0 ]) ? 0 : strtotime($value[ 0 ]);
+ $end_time = empty($value[ 1 ]) ? 0 : strtotime($value[ 1 ]);
+ if ($start_time > 0 && $end_time > 0) {
+ $query->whereBetweenTime('create_time', $start_time, $end_time);
+ } else if ($start_time > 0 && $end_time == 0) {
+ $query->where([ [ 'create_time', '>=', $start_time ] ]);
+ } else if ($start_time == 0 && $end_time > 0) {
+ $query->where([ [ 'create_time', '<=', $end_time ] ]);
+ }
+ }
+
+
+}
diff --git a/niucloud/app/model/sys/SysAgreement.php b/niucloud/app/model/sys/SysAgreement.php
index f1e9b4aa5..c41f2c9f8 100644
--- a/niucloud/app/model/sys/SysAgreement.php
+++ b/niucloud/app/model/sys/SysAgreement.php
@@ -12,6 +12,7 @@
namespace app\model\sys;
use app\dict\sys\AgreementDict;
+use app\dict\sys\StorageDict;
use core\base\BaseModel;
/**
@@ -45,6 +46,7 @@ class SysAgreement extends BaseModel
*/
public function getAgreementKeyNameAttr($value, $data)
{
- return AgreementDict::getType()[$data['agreement_key'] ?? ''] ?? '';
+ if(empty($data['agreement_key'])) return '';
+ return AgreementDict::getType()[$data['agreement_key']] ?? '';
}
}
diff --git a/niucloud/app/model/sys/SysMenu.php b/niucloud/app/model/sys/SysMenu.php
index b6c34306a..f9b050daa 100644
--- a/niucloud/app/model/sys/SysMenu.php
+++ b/niucloud/app/model/sys/SysMenu.php
@@ -58,7 +58,9 @@ class SysMenu extends BaseModel
*/
public function getMenuTypeNameAttr($value,$data)
{
- return MenuTypeDict::getMenuType()[$data['menu_type'] ?? ''] ?? '';
+ if(empty($data['menu_type']))
+ return '';
+ return MenuTypeDict::getMenuType()[$data['menu_type']] ?? '';
}
/**
@@ -69,6 +71,8 @@ class SysMenu extends BaseModel
*/
public function getStatusNameAttr($value,$data)
{
- return MenuDict::getStatus()[$data['status'] ?? ''] ?? '';
+ if(empty($data['status']))
+ return '';
+ return MenuDict::getStatus()[$data['status']] ?? '';
}
}
diff --git a/niucloud/app/model/sys/SysNoticeLog.php b/niucloud/app/model/sys/SysNoticeLog.php
index 87050ba0a..4354d4fba 100644
--- a/niucloud/app/model/sys/SysNoticeLog.php
+++ b/niucloud/app/model/sys/SysNoticeLog.php
@@ -11,7 +11,9 @@
namespace app\model\sys;
+use app\dict\notice\NoticeDict;
use app\dict\notice\NoticeTypeDict;
+use app\dict\sys\SmsDict;
use core\base\BaseModel;
use think\db\Query;
@@ -52,7 +54,9 @@ class SysNoticeLog extends BaseModel
*/
public function getContentAttr($value,$data)
{
- $temp = json_decode($value);
+ if($value){
+ $temp = json_decode($value, true);
+ }
if(!$temp){
$temp = $value;
}
@@ -66,8 +70,12 @@ class SysNoticeLog extends BaseModel
*/
public function getNameAttr($value,$data)
{
- $temp = \app\dict\notice\NoticeDict::getNotice()[$data['key'] ?? ''] ?? '';
- return $temp['name'] ?? '';
+ $name = '';
+ if(!empty($data['key'])){
+ $temp = NoticeDict::getNotice()[$data['key']] ?? [];
+ $name = $temp['name'] ?? '';
+ }
+ return $name;
}
/**
@@ -78,8 +86,12 @@ class SysNoticeLog extends BaseModel
*/
public function getNoticeTypeNameAttr($value,$data)
{
- $temp = NoticeTypeDict::getType()[$data['notice_type'] ?? ''] ?? '';
- return $temp['name'] ?? '';
+ $name = '';
+ if (!empty($data['notice_type'])) {
+ $temp = NoticeTypeDict::getType()[$data['notice_type']] ?? [];
+ $name = $temp['name'] ?? '';
+ }
+ return $name;
}
/**
* 消息类型
diff --git a/niucloud/app/model/sys/SysNoticeSmsLog.php b/niucloud/app/model/sys/SysNoticeSmsLog.php
index 3ca06646a..110191131 100644
--- a/niucloud/app/model/sys/SysNoticeSmsLog.php
+++ b/niucloud/app/model/sys/SysNoticeSmsLog.php
@@ -11,12 +11,13 @@
namespace app\model\sys;
+use app\dict\notice\NoticeDict;
use app\dict\sys\SmsDict;
use core\base\BaseModel;
/**
* 系统短信消息发送记录
- * Class SysMessageLog
+ * Class SysNoticeSmsLog
* @package app\model\sys
*/
class SysNoticeSmsLog extends BaseModel
@@ -35,7 +36,7 @@ class SysNoticeSmsLog extends BaseModel
protected $name = 'sys_notice_sms_log';
protected $type = [
- 'send_time' => 'timestamp',
+ 'send_time' => 'timestamp',
];
// 设置json类型字段
@@ -49,24 +50,31 @@ class SysNoticeSmsLog extends BaseModel
* @param $data
* @return string
*/
- public function getResultAttr($value,$data)
+ public function getResultAttr($value, $data)
{
- $temp = json_decode($value);
- if(!$temp){
+ if ($value) {
+ $temp = json_decode($value, true);
+ }
+ if (empty($temp)) {
$temp = $value;
}
- return $temp;
+ return $temp ?? '';
}
+
/**
* 名称
* @param $value
* @param $data
* @return string
*/
- public function getNameAttr($value,$data)
+ public function getNameAttr($value, $data)
{
- $temp = \app\dict\notice\NoticeDict::getNotice()[$data['key'] ?? ''];
- return $temp['name'] ?? '';
+ $name = '';
+ if (!empty($data['key'])) {
+ $temp = NoticeDict::getNotice()[$data['key']] ?? [];
+ $name = $temp['name'] ?? '';
+ }
+ return $name;
}
/**
@@ -75,9 +83,13 @@ class SysNoticeSmsLog extends BaseModel
* @param $data
* @return string
*/
- public function getStatusNameAttr($value,$data)
+ public function getStatusNameAttr($value, $data)
{
- return SmsDict::getStatusType()[$data['status'] ?? ''] ?? '';
+ $name = '';
+ if (!empty($data['status'])) {
+ $name = SmsDict::getStatusType()[$data['status']] ?? '';
+ }
+ return $name;
}
/**
@@ -86,11 +98,25 @@ class SysNoticeSmsLog extends BaseModel
* @param $data
* @return string
*/
- public function getSmsTypesNameAttr($value,$data)
+ public function getSmsTypesNameAttr($value, $data)
{
- $temp = SmsDict::getType()[$data['sms_type'] ?? ''] ?? [];
+ if(empty($data['sms_type'])) return '';
+ $temp = SmsDict::getType()[$data['sms_type']] ?? [];
return $temp['name'] ?? '';
}
+
+ /**
+ * 消息标识
+ * @param $value
+ * @return mixed
+ */
+ public function searchKeyAttr($query, $value)
+ {
+ if ($value) {
+ $query->where('key', $value);
+ }
+ }
+
/**
* 短信方式
* @param $value
diff --git a/niucloud/app/model/sys/SysRole.php b/niucloud/app/model/sys/SysRole.php
index 9d6bdbd7a..194cd660f 100644
--- a/niucloud/app/model/sys/SysRole.php
+++ b/niucloud/app/model/sys/SysRole.php
@@ -45,7 +45,8 @@ class SysRole extends BaseModel
* @return string
*/
public function getStatusNameAttr($value, $data){
- return RoleStatusDict::getStatus()[$data['status'] ?? ''] ?? '';
+ if(empty($data['status'])) return '';
+ return RoleStatusDict::getStatus()[$data['status']] ?? '';
}
diff --git a/niucloud/app/model/sys/SysCronTask.php b/niucloud/app/model/sys/SysSchedule.php
similarity index 71%
rename from niucloud/app/model/sys/SysCronTask.php
rename to niucloud/app/model/sys/SysSchedule.php
index 61baf4d3c..e97eb7bd5 100644
--- a/niucloud/app/model/sys/SysCronTask.php
+++ b/niucloud/app/model/sys/SysSchedule.php
@@ -11,16 +11,14 @@
namespace app\model\sys;
-use app\dict\sys\CronDict;
+use app\dict\schedule\ScheduleDict;
use core\base\BaseModel;
use think\db\Query;
/**
* 定时任务模型
- * Class SysArea
- * @package app\model\sys
*/
-class SysCronTask extends BaseModel
+class SysSchedule extends BaseModel
{
/**
@@ -33,7 +31,7 @@ class SysCronTask extends BaseModel
* 模型名称
* @var string
*/
- protected $name = 'sys_cron_task';
+ protected $name = 'sys_schedule';
protected $type = [
'last_time' => 'timestamp',
@@ -42,50 +40,47 @@ class SysCronTask extends BaseModel
];
// 设置json类型字段
- protected $json = ['data'];
+ protected $json = ['time'];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
+
+
/**
- * 任务模式
+ * 启用状态
* @param $value
* @return mixed
*/
- public function getTypeNameAttr($value, $data)
+ public function getStatusNameAttr($value, $data)
{
- return CronDict::getType()[$data['type'] ?? ''] ?? '';
+ if(empty($data['status'])) return '';
+ return ScheduleDict::getStatus()[$data['status']] ?? '';
}
-
- /**
- * 任务周期
- * @param $value
- * @return mixed
- */
- public function getCrondTypeNameAttr($value, $data)
- {
- return CronDict::getCrondType()[$data['crond_type'] ?? ''] ?? '';
- }
- /**
- * 任务名称搜索器
- * @param $value
- */
- public function searchTitleAttr(Query $query, $value, $data)
- {
- if ($value) {
- $query->whereLike('title', '%'.$value.'%');
- }
- }
-
/**
* 任务类型搜索器
* @param $value
*/
- public function searchTypeAttr(Query $query, $value, $data)
+ public function searchKeyAttr(Query $query, $value, $data)
{
if ($value) {
- $query->where('type', $value);
+ $query->where('key', $value);
}
}
+ /**
+ * 状态搜索
+ * @param Query $query
+ * @param $value
+ * @param $data
+ * @return void
+ */
+ public function searchStatusAttr(Query $query, $value, $data)
+ {
+ if ($value) {
+ $query->where('status', $value);
+ }
+ }
+
+
/**
* 执行时间搜索器
* @param $value
diff --git a/niucloud/app/model/sys/SysUser.php b/niucloud/app/model/sys/SysUser.php
index 56236aad8..8aaabd3fb 100644
--- a/niucloud/app/model/sys/SysUser.php
+++ b/niucloud/app/model/sys/SysUser.php
@@ -72,7 +72,8 @@ class SysUser extends BaseModel
*/
public function getStatusNameAttr($value, $data)
{
- return UserDict::getStatus()[$data['status'] ?? ''] ?? '';
+ if(empty($data['status'])) return '';
+ return UserDict::getStatus()[$data['status']] ?? '';
}
public function getCreateTimeAttr($value, $data)
diff --git a/niucloud/app/service/admin/aliapp/AliappConfigService.php b/niucloud/app/service/admin/aliapp/AliappConfigService.php
index 34c95d5cd..5014da58f 100644
--- a/niucloud/app/service/admin/aliapp/AliappConfigService.php
+++ b/niucloud/app/service/admin/aliapp/AliappConfigService.php
@@ -27,9 +27,7 @@ class AliappConfigService extends BaseAdminService
*/
public function getAliappConfig()
{
- $config_info = (new CoreAliappConfigService())->getAliappConfig($this->site_id);
- return $config_info;
-
+ return (new CoreAliappConfigService())->getAliappConfig($this->site_id);
}
/**
diff --git a/niucloud/app/service/admin/article/ArticleCategoryService.php b/niucloud/app/service/admin/article/ArticleCategoryService.php
index f99b5e648..ffe610e87 100644
--- a/niucloud/app/service/admin/article/ArticleCategoryService.php
+++ b/niucloud/app/service/admin/article/ArticleCategoryService.php
@@ -38,8 +38,7 @@ class ArticleCategoryService extends BaseAdminService
$field = 'category_id, site_id, name, sort, is_show, create_time, update_time';
$order = 'create_time desc';
$search_model = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['name'], $where)->field($field)->order($order)->append(["article_num"]);
- $list = $this->pageQuery($search_model);
- return $list;
+ return $this->pageQuery($search_model);
}
/**
@@ -50,8 +49,7 @@ class ArticleCategoryService extends BaseAdminService
$field = 'category_id, site_id, name, sort';
$order = 'sort desc';
- $list = $this->model->where([['site_id', '=', $this->site_id], ['is_show', '=', 1]])->field($field)->order($order)->select()->toArray();
- return $list;
+ return $this->model->where([['site_id', '=', $this->site_id], ['is_show', '=', 1]])->field($field)->order($order)->select()->toArray();
}
/**
@@ -62,8 +60,7 @@ class ArticleCategoryService extends BaseAdminService
{
$field = 'category_id, site_id, name, sort, is_show, create_time, update_time';
- $info = $this->model->field($field)->where([['category_id', '=', $id], ['site_id', '=', $this->site_id]])->append(["article_num"])->findOrEmpty()->toArray();
- return $info;
+ return $this->model->field($field)->where([['category_id', '=', $id], ['site_id', '=', $this->site_id]])->append(["article_num"])->findOrEmpty()->toArray();
}
/**
@@ -96,8 +93,7 @@ class ArticleCategoryService extends BaseAdminService
*/
public function del(int $id)
{
- $res = $this->model->where([['category_id', '=', $id], ['site_id', '=', $this->site_id]])->delete();
- return $res;
+ return $this->model->where([['category_id', '=', $id], ['site_id', '=', $this->site_id]])->delete();
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/article/ArticleService.php b/niucloud/app/service/admin/article/ArticleService.php
index e7babdc85..ab2c4c504 100644
--- a/niucloud/app/service/admin/article/ArticleService.php
+++ b/niucloud/app/service/admin/article/ArticleService.php
@@ -39,8 +39,7 @@ class ArticleService extends BaseAdminService
$field = 'id, category_id, site_id, title, intro, summary, image, author, content, visit, visit_virtual, is_show, sort, create_time, update_time';
$order = 'create_time desc';
$search_model = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ 'title', 'category_id', 'is_show'], $where)->with('articleCategory')->field($field)->order($order)->append(['article_url']);
- $list = $this->pageQuery($search_model);
- return $list;
+ return $this->pageQuery($search_model);
}
/**
@@ -51,8 +50,7 @@ class ArticleService extends BaseAdminService
{
$field = 'id, category_id, site_id, title, intro, summary, image, author, content, visit, visit_virtual, is_show, sort, create_time, update_time';
- $info = $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->with('articleCategory')->field($field)->findOrEmpty()->toArray();
- return $info;
+ return $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->with('articleCategory')->field($field)->findOrEmpty()->toArray();
}
/**
@@ -86,8 +84,7 @@ class ArticleService extends BaseAdminService
*/
public function del(int $id)
{
- $res = $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->delete();
- return $res;
+ return $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->delete();
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/auth/AuthService.php b/niucloud/app/service/admin/auth/AuthService.php
index ab25ad248..5e397602e 100644
--- a/niucloud/app/service/admin/auth/AuthService.php
+++ b/niucloud/app/service/admin/auth/AuthService.php
@@ -19,6 +19,7 @@ use app\service\admin\sys\MenuService;
use app\service\admin\sys\RoleService;
use app\service\admin\user\UserRoleService;
use app\service\admin\user\UserService;
+use app\service\core\site\CoreSiteService;
use core\base\BaseAdminService;
use core\exception\AuthException;
use Exception;
@@ -35,21 +36,15 @@ class AuthService extends BaseAdminService
* @param $site_id
*/
public function checkSiteAuth(Request $request){
- $site_id = $request->adminSiteId();
- //没有当前站点的信息
- if(!$this->getAuthRole($site_id))
- {
- throw new AuthException('NO_SITE_PERMISSION');
- }
-
- //查询站点信息并返回
- $site_service = new SiteService();
- $site_info = $site_service->getSiteCache($site_id);
+ $site_code = $request->adminSiteId();
+ //todo 将站点编号转化为站点id
+ $site_info = (new CoreSiteService())->getSiteInfoBySiteCode($site_code);
//站点不存在
- if(empty($site_info))
- {
- throw new AuthException('SITE_NOT_EXIST');
- }
+ if(empty($site_info)) throw new AuthException('SITE_NOT_EXIST');
+ $site_id = $site_info['site_id'];
+ //没有当前站点的信息
+ if(!$this->getAuthRole($site_id)) throw new AuthException('NO_SITE_PERMISSION');
+
$request->siteId($site_id);
$request->appType($site_info['app_type']);
return true;
diff --git a/niucloud/app/service/admin/auth/AuthSiteService.php b/niucloud/app/service/admin/auth/AuthSiteService.php
index 3063ff1a8..09ef67db8 100644
--- a/niucloud/app/service/admin/auth/AuthSiteService.php
+++ b/niucloud/app/service/admin/auth/AuthSiteService.php
@@ -12,7 +12,11 @@
namespace app\service\admin\auth;
+use app\dict\sys\AppTypeDict;
+use app\dict\sys\MenuDict;
+use app\dict\sys\MenuTypeDict;
use app\model\site\Site;
+use app\model\sys\SysMenu;
use app\service\admin\site\SiteService;
use core\base\BaseAdminService;
use think\facade\Cache;
@@ -50,18 +54,11 @@ class AuthSiteService extends BaseAdminService
$auth_service = new AuthService();
$user_role_list = $auth_service->getAuthSiteRoleList();
$site_ids = array_column($user_role_list, 'site_id');
- $site_list = $this->model->where([['site_id', 'in', $site_ids]])->field('app_type,site_name,logo')->column('site_id, site_name, logo, app_type');
- return $site_list;
+ return $this->model->where([['site_id', 'in', $site_ids]])->field('app_type,site_name,logo')->column('site_id, site_name, logo, app_type');
},
SiteService::$cache_tag_name
);
-// return Cache::tag(SiteService::$cache_tag_name)->remember($cache_name, function (){
-// $auth_service = new AuthService();
-// $user_role_list = $auth_service->getAuthSiteRoleList();
-// $site_ids = array_column($user_role_list, 'site_id');
-// $site_list = $this->model->where([['site_id', 'in', $site_ids]])->field('app_type,site_name,logo')->column('site_id, site_name, logo, app_type');
-// return $site_list;
-// });
+
}
/**
@@ -82,5 +79,15 @@ class AuthSiteService extends BaseAdminService
return (new SiteService())->getApiList($this->site_id, $status);
}
-
+ /**
+ * 查询当前站点可以单独显示的菜单(仅支持站点端调用)
+ * @return SysMenu[]|array|\think\Collection
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
+ */
+ public function getShowMenuList(){
+ $menu_keys = (new SiteService())->getMenuIdsBySiteId($this->site_id, 1);
+ return (new SysMenu())->where([['menu_key', 'in', $menu_keys], ['menu_type', '=', MenuTypeDict::MENU], ['app_type', '=', AppTypeDict::SITE],['is_show', '=', 1]])->select()->toArray();
+ }
}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/auth/ConfigService.php b/niucloud/app/service/admin/auth/ConfigService.php
index df339059c..1d21743f3 100644
--- a/niucloud/app/service/admin/auth/ConfigService.php
+++ b/niucloud/app/service/admin/auth/ConfigService.php
@@ -37,13 +37,12 @@ class ConfigService extends BaseAdminService
public function getConfig()
{
$info = (new CoreConfigService())->getConfig($this->request->defaultSiteId(), ConfigKeyDict::ADMIN_LOGIN)['value'] ?? [];
- $config = [
+ return [
'is_captcha' => $info['is_captcha'] ?? 0,//是否启用验证码
'is_site_captcha' => $info['is_site_captcha'] ?? 0,//是否启用站点验证码
'bg' => $info['bg'] ?? '',//平台登录端 背景
'site_bg' => $info['site_bg'] ?? '',//站点登录端 背景
];
- return $config;
}
/**
diff --git a/niucloud/app/service/admin/auth/LoginService.php b/niucloud/app/service/admin/auth/LoginService.php
index ffd924ab6..eab3f884d 100644
--- a/niucloud/app/service/admin/auth/LoginService.php
+++ b/niucloud/app/service/admin/auth/LoginService.php
@@ -70,7 +70,6 @@ class LoginService extends BaseAdminService
throw new AuthException('USER_LOCK');
}
-
if($app_type == AppTypeDict::ADMIN){
$default_site_id = $this->request->defaultSiteId();
$userrole = (new UserRoleService())->getUserRole($default_site_id, $userinfo->uid);
diff --git a/niucloud/app/service/admin/cron/CronService.php b/niucloud/app/service/admin/cron/CronService.php
deleted file mode 100644
index e4fe5ee95..000000000
--- a/niucloud/app/service/admin/cron/CronService.php
+++ /dev/null
@@ -1,55 +0,0 @@
-core_cron_service = new CoreCronService();
- }
-
- /**
- * 自动任务列表
- * @param array $where
- * @return mixed
- */
- public function getPage(array $where = [])
- {
- return $this->core_cron_service->getPage($this->site_id, $where);
- }
-
-
- /**
- * 分组详情
- * @param int $group_id
- * @return array
- */
- public function getInfo(int $id)
- {
- return $this->core_cron_service->getInfo($this->site_id, $id);
-
- }
-
-
-
-}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/diy/DiyRouteService.php b/niucloud/app/service/admin/diy/DiyRouteService.php
index 84adeea48..907004176 100644
--- a/niucloud/app/service/admin/diy/DiyRouteService.php
+++ b/niucloud/app/service/admin/diy/DiyRouteService.php
@@ -143,6 +143,7 @@ class DiyRouteService extends BaseAdminService
public function modifyShare($data)
{
$field = 'id';
+ $data[ 'site_id' ] = $this->site_id;
$info = $this->model->field($field)->where([ [ 'name', '=', $data[ 'name' ] ], [ 'site_id', '=', $this->site_id ] ])->findOrEmpty()->toArray();
if (!empty($info)) {
$this->model->where([ [ 'id', '=', $info[ 'id' ] ], [ 'site_id', '=', $this->site_id ] ])->update([ 'share' => $data[ 'share' ] ]);
diff --git a/niucloud/app/service/admin/diy/DiyService.php b/niucloud/app/service/admin/diy/DiyService.php
index 9b3d700bf..d130be811 100644
--- a/niucloud/app/service/admin/diy/DiyService.php
+++ b/niucloud/app/service/admin/diy/DiyService.php
@@ -16,6 +16,7 @@ use app\dict\diy\LinkDict;
use app\dict\diy\PagesDict;
use app\dict\diy\TemplateDict;
use app\model\diy\Diy;
+use app\model\site\Site;
use app\service\admin\sys\SystemService;
use core\base\BaseAdminService;
use Exception;
@@ -36,14 +37,14 @@ class DiyService extends BaseAdminService
}
/**
- * 获取自定义页面列表
+ * 获取自定义页面分页列表
* @param array $where
* @return array
*/
public function getPage(array $where = [])
{
$where[] = [ 'site_id', '=', $this->site_id ];
- $field = 'id,site_id,title,name,type,is_default,share,visit_count,create_time,update_time';
+ $field = 'id,site_id,title,name,template,type,mode,is_default,share,visit_count,create_time,update_time';
$order = "is_default desc,update_time desc";
$search_model = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ "title", "type" ], $where)->field($field)->order($order)->append([ 'type_name' ]);
$list = $this->pageQuery($search_model);
@@ -51,17 +52,19 @@ class DiyService extends BaseAdminService
}
/**
+ * 获取自定义页面列表
* @param array $where
+ * @param string $field
* @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
- public function getList(array $where = [])
+ public function getList(array $where = [], $field = 'id,site_id,title,name,template,type,mode,is_default,share,visit_count,create_time,update_time')
{
- $where[] = [ 'site_id', '=', $this->site_id ];
- $field = 'id,site_id,title,name,type,is_default,share,visit_count,create_time,update_time';
$order = "is_default desc,update_time desc";
- $list = $this->model->where($where)->field($field)->select()->order($order)->toArray();
+ $list = $this->model->where([ [ [ 'site_id', '=', $this->site_id ] ] ])->withSearch([ "title", "type", 'mode' ], $where)->field($field)->select()->order($order)->toArray();
return $list;
-
}
/**
@@ -71,19 +74,29 @@ class DiyService extends BaseAdminService
*/
public function getInfo(int $id)
{
- $field = 'id,site_id,title,name,type,value,is_default,share,visit_count';
-
+ $field = 'id,site_id,title,name,template,type,mode,value,is_default,share,visit_count';
$info = $this->model->field($field)->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->findOrEmpty()->toArray();
return $info;
}
public function getInfoByName(string $name)
{
- $field = 'id,site_id,title,name,type,value,is_default,share,visit_count';
+ $field = 'id,site_id,title,name,template,type,mode,value,is_default,share,visit_count';
$info = $this->model->field($field)->where([ [ 'name', '=', $name ], [ 'site_id', '=', $this->site_id ], [ 'is_default', '=', 1 ] ])->findOrEmpty()->toArray();
return $info;
}
+ /**
+ * 查询数量
+ * @param array $where
+ * @return int
+ * @throws \think\db\exception\DbException
+ */
+ public function getCount(array $where = [])
+ {
+ return $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ 'type' ], $where)->count();
+ }
+
/**
* 添加自定义页面
* @param array $data
@@ -147,7 +160,7 @@ class DiyService extends BaseAdminService
}
Db::startTrans();
$this->model->where([ [ 'name', '=', $info[ 'name' ] ], [ 'site_id', '=', $this->site_id ] ])->update([ 'is_default' => 0 ]);
- $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->update([ 'is_default' => 1 ]);
+ $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->update([ 'is_default' => 1, 'update_time' => time() ]);
Db::commit();
return true;
} catch (\Exception $e) {
@@ -163,7 +176,7 @@ class DiyService extends BaseAdminService
*/
public function getInit(array $params = [])
{
- $page_template = TemplateDict::getTemplate();
+ $template = $this->getTemplate();
$time = time();
$data = [];
@@ -175,61 +188,80 @@ class DiyService extends BaseAdminService
if (!empty($data)) {
// 编辑赋值
- if (isset($page_template[ $data[ 'type' ] ])) {
- $page = $page_template[ $data[ 'type' ] ];
+
+ if (isset($template[ $data[ 'type' ] ])) {
+ $page = $template[ $data[ 'type' ] ];
$data[ 'type_name' ] = $page[ 'title' ];
$data[ 'page' ] = $page[ 'page' ];
}
} else {
+
// 新页面赋值
- $type = 'DIY_PAGE';
+ $title = $params[ 'title' ] ? $params[ 'title' ] : '页面' . $time;
+ $type = $params[ 'type' ] ? $params[ 'type' ] : 'DIY_PAGE';
+ $name = $type == 'DIY_PAGE' ? 'DIY_PAGE_RANDOM_' . $time : $type;
$type_name = '';
- $name = $params[ 'name' ];
- $page_route = '';
+ $template_name = $params[ 'template' ] ?? ''; // 页面模板名称
+ $page_route = ''; // 页面路径
+ $mode = 'diy'; // 页面模式,diy:自定义,fixed:固定
$value = '';
- if (isset($page_template[ $params[ 'template' ] ])) {
- $page = $page_template[ $params[ 'template' ] ];
- $name = $params[ 'template' ] == 'DIY_PAGE' ? 'DIY_PAGE_RANDOM_' . $time : $params[ 'template' ];
- $type = $params[ 'template' ];
+ $is_default = 0;
+
+ // 查询默认第一个页面模板数据
+ if (isset($template[ $params[ 'name' ] ])) {
+ $page = $template[ $params[ 'name' ] ];
+ $name = $params[ 'name' ];
+ $type = $params[ 'name' ];
+ $title = $page[ 'title' ];
$type_name = $page[ 'title' ];
$page_route = $page[ 'page' ];
- // 查询指定页面数据
- $page_data = $this->getPageData($params[ 'template' ], $params[ 'template_name' ]);
+ $page_data = $this->getFirstPageData($type);
if (!empty($page_data)) {
$value = json_encode($page_data[ 'data' ], JSON_UNESCAPED_UNICODE);
+ $is_default = 1;
+ $template_name = $page_data[ 'template' ];
+ $mode = $page_data[ 'mode' ];
+ }
+ } else if (isset($template[ $type ])) {
+ // 查询指定页面数据
+ $page = $template[ $type ];
+ $type_name = $page[ 'title' ];
+ $page_route = $page[ 'page' ];
+
+ // 如果页面类型一条数据也没有,那么要默认 使用中
+ $count = $this->getCount([ 'type' => $type ]);
+ if ($count == 0) {
+ $is_default = 1;
+ }
+
+ if (!empty($params[ 'template' ])) {
+ $page_template = $page[ 'template' ][ $params[ 'template' ] ];
+ $mode = $page_template[ 'mode' ];
+ $page_data = $page_template[ 'data' ];
+ $page_data[ 'global' ][ 'title' ] = $title;
+ $value = json_encode($page_data, JSON_UNESCAPED_UNICODE);
}
}
+
$data = [
'name' => $name,
- 'title' => $params[ 'title' ] ? $params[ 'title' ] : '页面' . $time,
+ 'title' => $title,
'type' => $type,
'type_name' => $type_name,
+ 'template' => $template_name,
'page' => $page_route,
+ 'mode' => $mode,
'value' => $value,
- 'is_default' => 0
+ 'is_default' => $is_default
];
- if (isset($page_template[ $params[ 'name' ] ])) {
- $page = $page_template[ $params[ 'name' ] ];
- $data[ 'name' ] = $params[ 'template' ] ? $params[ 'template' ] : $params[ 'name' ];
- $data[ 'type' ] = $data[ 'name' ];
- $data[ 'title' ] = $page[ 'title' ];
- $data[ 'type_name' ] = $page[ 'title' ];
- $data[ 'page' ] = $page[ 'page' ];
-
- // 查询默认页面数据
- $page_data = $this->getFirstPageData($data[ 'name' ]);
- if (!empty($page_data)) {
- $data[ 'value' ] = json_encode($page_data[ 'data' ], JSON_UNESCAPED_UNICODE);
- $data[ 'is_default' ] = 1;
- }
- }
}
- $data[ 'component' ] = $this->getComponentList($data[ 'name' ]);
+ $data[ 'component' ] = $this->getComponentList($data[ 'type' ]);
$data[ 'domain_url' ] = ( new SystemService() )->getUrl();
- $data[ 'site_id' ] = $this->site_id;
+ $site = Site::find($this->site_id);
+ $data[ 'site_id' ] = $site[ 'site_code' ];
return $data;
}
@@ -279,7 +311,7 @@ class DiyService extends BaseAdminService
// 查询自定义页面
if ($k == 'DIY_PAGE') {
$diy_service = new DiyService();
- $list = $diy_service->getList([ [ 'type', '=', 'DIY_PAGE' ] ]);
+ $list = $diy_service->getList([ 'type' => 'DIY_PAGE' ]);
foreach ($list as $ck => $cv) {
$link[ $k ][ 'child_list' ][] = [
'name' => $cv[ 'name' ],
@@ -312,28 +344,32 @@ class DiyService extends BaseAdminService
/**
* 获取页面模板
- * @param string $type
+ * @param array $params
* @return array|string
*/
- public function getTemplate(string $type)
+ public function getTemplate($params = [])
{
- $page_template = TemplateDict::getTemplate($type);
+ $page_template = TemplateDict::getTemplate($params);
foreach ($page_template as $k => $v) {
// 查询页面数据
- $page_template[ $k ][ 'template' ] = PagesDict::getPages($k);
+ $page_params = [
+ 'type' => $k,
+ 'mode' => $params[ 'mode' ] ?? ''
+ ];
+ $page_template[ $k ][ 'template' ] = PagesDict::getPages($page_params);
}
return $page_template;
}
/**
* 获取页面数据
- * @param $template
+ * @param $type
* @param $name
* @return array
*/
- public function getPageData($template, $name)
+ public function getPageData($type, $name)
{
- $pages = PagesDict::getPages($template);
+ $pages = PagesDict::getPages([ 'type' => $type ]);
if (isset($pages[ $name ])) {
return $pages[ $name ];
}
@@ -342,18 +378,207 @@ class DiyService extends BaseAdminService
/**
* 获取默认页面数据
- * @param $template
+ * @param $type
* @return array|mixed
*/
- public function getFirstPageData($template)
+ public function getFirstPageData($type)
{
- $pages = PagesDict::getPages($template);
+ $pages = PagesDict::getPages([ 'type' => $type ]);
if (!empty($pages)) {
+ $template = array_key_first($pages);
$page = array_shift($pages);
$page[ 'template' ] = $template;
+ $page[ 'type' ] = $type;
return $page;
}
return [];
}
+ /**
+ * 获取页面装修列表
+ * @return array|string|null
+ */
+ public function getDecoratePage()
+ {
+
+ // 查询可装修的页面
+ $template = $this->getTemplate([ 'action' => 'decorate' ]);
+
+ // 遍历查询页面数据,使用了那套模板
+ foreach ($template as $k => $v) {
+
+ // 查询我的微页面
+ $template[ $k ][ 'my_page' ] = $this->getList([ 'type' => $k, 'mode' => 'diy' ], 'id,title,name,template,type,is_default,mode');
+ $template[ $k ][ 'domain_url' ] = ( new SystemService() )->getUrl();
+
+ // 查询默认页面数据
+ $default_page_data = $this->getFirstPageData($k);
+ $use_template = [
+ 'id' => 0,
+ 'name' => $k,
+ 'title' => $default_page_data[ 'title' ], // 模板名称
+ 'template' => $default_page_data[ 'template' ], // 模板标识
+ 'cover' => $default_page_data[ 'cover' ], // 封面图
+ 'preview' => $default_page_data[ 'preview' ], // 预览图
+ 'desc' => $default_page_data[ 'desc' ], // 模板描述
+ 'mode' => $default_page_data[ 'mode' ], // 页面模式:diy:自定义,fixed:固定
+ 'hope' => 'template', // 默认选中 模板
+ 'url' => '' // 自定义页面链接,实时预览效果
+ ];
+
+ // 查询页面数据
+ $info = $this->getInfoByName($k);
+
+ if (!empty($info)) {
+ $use_template[ 'id' ] = $info[ 'id' ];
+ $use_template[ 'title' ] = $info[ 'title' ];
+
+ // 检测模板是否存在
+ if (!empty($info[ 'template' ])) {
+ if (in_array($info[ 'template' ], array_keys($v[ 'template' ]))) {
+ $use_template[ 'template' ] = $info[ 'template' ];
+ $use_template[ 'mode' ] = $info[ 'mode' ];
+ $use_template[ 'hope' ] = $info[ 'mode' ] == 'fixed' ? 'template' : $info[ 'mode' ];
+ }
+ }
+
+ $use_template[ 'preview' ] = ''; // 默认图
+ $use_template[ 'desc' ] = '通过自定义装修的页面';
+
+ // 查询模板页面数
+ $page_data = $this->getPageData($k, $use_template[ 'template' ]);
+ if (!empty($page_data)) {
+ $use_template[ 'cover' ] = $page_data[ 'cover' ]; // 默认图
+ $use_template[ 'desc' ] = $page_data[ 'desc' ];
+ } else {
+ // 自定义页面,实时预览效果
+ $site = Site::find($this->site_id);
+ $use_template[ 'url' ] = '/pages/index/diy?&mode=preview&site_id=' . $site[ 'site_code' ] . '&id=' . $info[ 'id' ];
+ }
+ }
+ $template[ $k ][ 'use_template' ] = $use_template;
+ }
+
+ return $template;
+ }
+
+ /**
+ * 切换模板
+ * @param array $params
+ * @return array|mixed
+ * @throws Exception
+ */
+ public function changeTemplate(array $params = [])
+ {
+ if ($params[ 'mode' ] == 'diy') {
+ // 自定义页面
+
+ // 查询
+ if (!empty($params[ 'id' ])) {
+ // 使用了微页面
+ $info = $this->getInfo($params[ 'id' ]);
+ if (!empty($info)) {
+ // 状态 变为 使用中
+ $this->setUse($info[ 'id' ]);
+ }
+ return $info;
+ } elseif ($params[ 'template' ]) {
+
+ // 查询模板信息
+ $page_data = $this->getPageData($params[ 'type' ], $params[ 'template' ]);
+
+ // 查询表中未修改的模板数据
+ $field = 'id';
+ $condition = [
+ [ 'site_id', '=', $this->site_id ],
+ [ 'type', '=', $params[ 'type' ] ],
+ [ 'template', '=', $params[ 'template' ] ],
+ [ 'mode', '=', $params[ 'mode' ] ],
+ [ 'is_change', '=', 0 ]
+ ];
+ $info = $this->model->field($field)->where($condition)->findOrEmpty()->toArray();
+ if (!empty($info)) {
+ // 状态 变为 使用中
+ $this->setUse($info[ 'id' ]);
+ return $info;
+ } else {
+ // 新增 数据
+ $data = [
+ 'title' => $page_data[ 'title' ],
+ 'name' => $params[ 'type' ],
+ 'type' => $params[ 'type' ],
+ 'value' => json_encode($page_data[ 'data' ], JSON_UNESCAPED_UNICODE),
+ 'template' => $params[ 'template' ],
+ 'mode' => $params[ 'mode' ]
+ ];
+ $res = $this->add($data);
+ $this->setUse($res);
+ }
+
+ }
+
+ } elseif ($params[ 'mode' ] == 'fixed') {
+ // 固定模板
+
+ // 查询模板信息
+ $page_data = $this->getPageData($params[ 'type' ], $params[ 'template' ]);
+
+ // 检查表里是否存在数据
+ $field = 'id';
+ $condition = [
+ [ 'site_id', '=', $this->site_id ],
+ [ 'type', '=', $params[ 'type' ] ],
+ [ 'template', '=', $params[ 'template' ] ],
+ [ 'mode', '=', $params[ 'mode' ] ]
+ ];
+ $info = $this->model->field($field)->where($condition)->findOrEmpty()->toArray();
+ if (!empty($info)) {
+ // 状态 变为 使用中
+ $this->setUse($info[ 'id' ]);
+ } else {
+ // 新增 数据
+ $data = [
+ 'title' => $page_data[ 'title' ],
+ 'name' => $params[ 'type' ],
+ 'type' => $params[ 'type' ],
+ 'value' => json_encode($page_data[ 'data' ], JSON_UNESCAPED_UNICODE),
+ 'template' => $params[ 'template' ],
+ 'mode' => $params[ 'mode' ]
+ ];
+ $res = $this->add($data);
+ $this->setUse($res);
+ }
+ return $info;
+ }
+ return $params;
+ }
+
+ /**
+ * 获取页面预览数据
+ * @param array $params
+ * @return array
+ */
+ public function getPreviewData(array $params = [])
+ {
+ $info = [];
+ if (!empty($params[ 'id' ])) {
+ $info = $this->getInfo($params[ 'id' ]);
+ } elseif (!empty($params[ 'name' ])) {
+ $info = $this->getInfoByName($params[ 'name' ]);
+ }
+
+ $res = [
+ 'page' => $this->getTemplate([ 'type' => 'DIY_PAGE' ])[ 'DIY_PAGE' ][ 'page' ]
+ ];
+
+ if (!empty($info)) {
+ if ($info[ 'is_default' ] == 1) {
+ $template = $this->getTemplate([ 'type' => $info[ 'type' ] ])[ $info[ 'type' ] ];
+ $res[ 'page' ] = $template[ 'page' ] . '?id=' . $info[ 'id' ];
+ }
+ }
+
+ return $res;
+ }
+
}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/generator/core/ModelGenerator.php b/niucloud/app/service/admin/generator/core/ModelGenerator.php
index 330a7e46d..f06f036dc 100644
--- a/niucloud/app/service/admin/generator/core/ModelGenerator.php
+++ b/niucloud/app/service/admin/generator/core/ModelGenerator.php
@@ -115,7 +115,7 @@ class ModelGenerator extends BaseGenerator
if (!$column['is_search']) {
continue;
}
- $function_str .= '/**'.PHP_EOL.' * 搜索器:'.$this->table['table_content'].$column['column_comment'].''.PHP_EOL.' * @param $value'.PHP_EOL.' * @param $data'.PHP_EOL.' */'.PHP_EOL;
+ $function_str .= '/**'.PHP_EOL.' * 搜索器:'.$this->table['table_content'].$column['column_comment'].PHP_EOL.' * @param $value'.PHP_EOL.' * @param $data'.PHP_EOL.' */'.PHP_EOL;
$function_str .= 'public function search'.Str::studly($column['column_name']).'Attr($query, $value, $data)'.PHP_EOL;
$function_str .= '{'.PHP_EOL;
$function_str .= ' if ($value) {'.PHP_EOL;
diff --git a/niucloud/app/service/admin/generator/core/ServiceGenerator.php b/niucloud/app/service/admin/generator/core/ServiceGenerator.php
index fd07d4e50..e93bd1b88 100644
--- a/niucloud/app/service/admin/generator/core/ServiceGenerator.php
+++ b/niucloud/app/service/admin/generator/core/ServiceGenerator.php
@@ -70,7 +70,7 @@ class ServiceGenerator extends BaseGenerator
{
$field = [];
foreach ($this->tableColumn as $column) {
- if ($column['is_lists'] || $column['is_insert'] || $column['is_update']) {
+ if ($column['is_query']) {
$field[] = $column['column_name'];
}
}
diff --git a/niucloud/app/service/admin/generator/core/WebIndexGenerator.php b/niucloud/app/service/admin/generator/core/WebIndexGenerator.php
index 577953972..040b996e5 100644
--- a/niucloud/app/service/admin/generator/core/WebIndexGenerator.php
+++ b/niucloud/app/service/admin/generator/core/WebIndexGenerator.php
@@ -101,7 +101,7 @@ class WebIndexGenerator extends BaseGenerator
$file_name = str_replace('_', '-', Str::lower($this->getTableName())).'-edit';
if($this->className){
- $file_name = Str::lower($this->className) . '-edit';;
+ $file_name = Str::lower($this->className) . '-edit';
}
return '<'.$file_name.' ref="edit'.$this->getUCaseClassName().'Dialog" @complete="load'.$this->getUCaseName().'List" />';
diff --git a/niucloud/app/service/admin/generator/vm/admin_api_route.vm b/niucloud/app/service/admin/generator/vm/admin_api_route.vm
index af5842563..7d38b5d5f 100644
--- a/niucloud/app/service/admin/generator/vm/admin_api_route.vm
+++ b/niucloud/app/service/admin/generator/vm/admin_api_route.vm
@@ -28,7 +28,7 @@ Route::group('{MODULE_NAME}', function () {
//添加{NOTES}
Route::post('{ROUTE_NAME}', '{MODULE_NAME}.{UCASE_CLASS_NAME}/add');
//编辑{NOTES}
- Route::put('{ROUTE_NAME}/:id', '{MODULE_NAME}.{UCASE_CLASS_NAME}/update');
+ Route::put('{ROUTE_NAME}/:id', '{MODULE_NAME}.{UCASE_CLASS_NAME}/edit');
//删除{NOTES}
Route::delete('{ROUTE_NAME}/:id', '{MODULE_NAME}.{UCASE_CLASS_NAME}/del');
diff --git a/niucloud/app/service/admin/member/MemberAccountService.php b/niucloud/app/service/admin/member/MemberAccountService.php
index 45633e110..b695016fb 100644
--- a/niucloud/app/service/admin/member/MemberAccountService.php
+++ b/niucloud/app/service/admin/member/MemberAccountService.php
@@ -61,7 +61,7 @@ class MemberAccountService extends BaseAdminService
public function getInfo(int $id)
{
$field = 'id, member_id, site_id, account_type, account_data, from_type, related_id, create_time, memo';
- return $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->with('memberInfo')->field($field)->findOrEmpty()->append([ 'from_type_name', 'account_type_name' ])->toArray();
+ return $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->with('memberInfo')->field($field)->append([ 'from_type_name', 'account_type_name' ])->findOrEmpty()->toArray();
}
/**
diff --git a/niucloud/app/service/admin/notice/NoticeSmsLogService.php b/niucloud/app/service/admin/notice/NoticeSmsLogService.php
index 16aee5514..8f5da5fe9 100644
--- a/niucloud/app/service/admin/notice/NoticeSmsLogService.php
+++ b/niucloud/app/service/admin/notice/NoticeSmsLogService.php
@@ -17,7 +17,7 @@ use app\service\core\notice\CoreNoticeSmsLogService;
use core\base\BaseAdminService;
/**
- * 消息管理服务层
+ * 短信消息管理服务层
*/
class NoticeSmsLogService extends BaseAdminService
{
@@ -40,8 +40,8 @@ class NoticeSmsLogService extends BaseAdminService
* 获取消息内容
* @param string $key
*/
- public function getInfo(string $key)
+ public function getInfo(int $id)
{
- return (new CoreNoticeLogService())->getInfo($this->site_id, $key);
+ return (new CoreNoticeSmsLogService())->getInfo($this->site_id, $id);
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/schedule/ScheduleService.php b/niucloud/app/service/admin/schedule/ScheduleService.php
new file mode 100644
index 000000000..ca2dfdaa5
--- /dev/null
+++ b/niucloud/app/service/admin/schedule/ScheduleService.php
@@ -0,0 +1,93 @@
+getPage($data);
+ }
+
+ /**
+ * 获取信息
+ * @param int $id
+ * @return array
+ */
+ public function getInfo(int $id){
+ return (new CoreScheduleService())->getInfo($id);
+ }
+ /**
+ * 启用或关闭
+ * @param int $id
+ * @param $status
+ * @return true
+ */
+ public function modifyStatus(int $id, $status)
+ {
+ return (new CoreScheduleService())->modifyStatus($id, $status);
+ }
+
+ /**
+ * 添加
+ * @param array $data
+ */
+ public function add(array $data)
+ {
+ $res = (new CoreScheduleService())->add($data);
+ return $res->id;
+
+ }
+
+ /**
+ * 编辑
+ * @param int $id
+ * @param array $data
+ */
+ public function edit(int $id, array $data)
+ {
+ (new CoreScheduleService())->edit($id, $data);
+ return true;
+ }
+
+ /**
+ * 删除
+ * @param int $id
+ */
+ public function del(int $id)
+ {
+ return (new CoreScheduleService())->del($id);
+ }
+}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/site/SiteAccountLogService.php b/niucloud/app/service/admin/site/SiteAccountLogService.php
new file mode 100644
index 000000000..7d2b81d26
--- /dev/null
+++ b/niucloud/app/service/admin/site/SiteAccountLogService.php
@@ -0,0 +1,79 @@
+model = new SiteAccountLog();
+ }
+
+ /**
+ * 获取账单列表
+ * @param array $where
+ * @param string $order
+ * @return mixed
+ */
+ public function getPage(array $where = [])
+ {
+
+ $field = 'id, site_id, type, money, trade_no, create_time';
+ $search_model = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ 'create_time', 'type' ], $where)->field($field)->append([ 'type_name', 'pay_info', 'money' ])->order('create_time desc');
+ $list = $this->pageQuery($search_model);
+ return $list;
+ }
+
+ /**
+ * 获取账单详情
+ * @param int $id
+ * @return array
+ */
+ public function getInfo(int $id)
+ {
+ $field = 'id, site_id, type, money, trade_no, create_time';
+ return $this->model->where([ [ 'site_id', '=', $this->site_id ], ['id', '=', $id]])->field($field)->append([ 'type_name', 'pay_info' ])->findOrEmpty()->toArray();
+
+ }
+
+ /**
+ * 统计数据
+ * @return array
+ */
+ public function stat()
+ {
+ return [
+ 'pay' => $this->model->where([[ 'site_id', '=', $this->site_id ], ['type', '=', 'pay']])->sum("money")*1,
+ 'refund' => $this->model->where([[ 'site_id', '=', $this->site_id ], ['type', '=', 'refund']])->sum("money")*-1,
+ 'transfer' => $this->model->where([[ 'site_id', '=', $this->site_id ], ['type', '=', 'transfer']])->sum("money")*-1,
+ ];
+ }
+
+}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/site/SiteGroupService.php b/niucloud/app/service/admin/site/SiteGroupService.php
index 45912a021..caedec93f 100644
--- a/niucloud/app/service/admin/site/SiteGroupService.php
+++ b/niucloud/app/service/admin/site/SiteGroupService.php
@@ -128,9 +128,6 @@ class SiteGroupService extends BaseAdminService
},
[MenuService::$cache_tag_name,self::$cache_tag_name]
);
-// return Cache::tag([MenuService::$cache_tag_name,self::$cache_tag_name])->remember($cache_name, function () use ($group_id) {
-// return $this->model->findOrEmpty($group_id)?->group_roles ?? [];
-// });
}
/**
diff --git a/niucloud/app/service/admin/site/SiteService.php b/niucloud/app/service/admin/site/SiteService.php
index 624589654..7bd908e0f 100644
--- a/niucloud/app/service/admin/site/SiteService.php
+++ b/niucloud/app/service/admin/site/SiteService.php
@@ -46,7 +46,7 @@ class SiteService extends BaseAdminService
{
$field = 'site_id, site_name, front_end_name, front_end_logo, app_type, keywords, logo, icon, `desc`, status, latitude, longitude, province_id, city_id,
- district_id, address, full_address, phone, business_hours, create_time, expire_time, group_id';
+ district_id, address, full_address, phone, business_hours, create_time, expire_time, group_id, site_code';
$search_model = $this->model->where([ [ 'app_type', '<>', 'admin' ] ])->withSearch([ 'create_time', 'expire_time', 'keywords', 'status', 'group_id' ], $where)->with('groupName')->field($field)->append([ 'status_name' ])->order('create_time desc');
$list = $this->pageQuery($search_model);
return $list;
@@ -60,7 +60,7 @@ class SiteService extends BaseAdminService
public function getInfo(int $site_id)
{
$field = 'site_id, site_name, front_end_name, front_end_logo, app_type, keywords, logo, icon, `desc`, status, latitude, longitude, province_id, city_id,
- district_id, address, full_address, phone, business_hours, create_time, expire_time, group_id';
+ district_id, address, full_address, phone, business_hours, create_time, expire_time, group_id, site_code';
return $this->model->where([ [ 'site_id', '=', $site_id ] ])->with('groupName')->field($field)->append([ 'status_name' ])->findOrEmpty()->toArray();
}
@@ -88,6 +88,7 @@ class SiteService extends BaseAdminService
try {
$site = $this->model->create($data_site);
$site_id = $site->site_id;
+ //$this->model->where([['site_id', '=', $site_id]])->update(['site_code' => $this->createSiteCodeBySiteId($site_id)]);
//添加用户
$data_user = [
'username' => $data[ 'username' ],
@@ -111,6 +112,24 @@ class SiteService extends BaseAdminService
}
}
+ /**
+ * 通过站点id生成站点code
+ * @param int $site_id
+ */
+ public function createSiteCodeBySiteId(int $site_id)
+ {
+ retrun ($site_id + 1000000) *11 + 1;
+ }
+
+ /**
+ * 通过站点code获取站点id
+ * @param $site_code
+ */
+ public function getSiteIdBySiteCode($site_code)
+ {
+ retrun ($site_code-1) /11-1000000;
+ }
+
/**
* 修改站点
* @param int $site_id
@@ -149,24 +168,11 @@ class SiteService extends BaseAdminService
$where = [
[ 'site_id', '=', $site_id ],
];
- $site = $this->model->where($where)->field('app_type,site_name,front_end_name,front_end_logo,logo,icon,group_id, status, expire_time')->findOrEmpty();
- if (!$site->isEmpty()) {
- $site->append([ 'status_name' ]);
- }
+ $site = $this->model->where($where)->field('site_id, app_type,site_name,front_end_name,front_end_logo,logo,icon,group_id, status, expire_time, site_code')->append([ 'status_name' ])->findOrEmpty();
return $site->toArray();
},
self::$cache_tag_name . $site_id
);
-// return Cache::tag(self::$cache_tag_name . $site_id)->remember($cache_name . $site_id, function() use ($site_id) {
-// $where = [
-// [ 'site_id', '=', $site_id ],
-// ];
-// $site = $this->model->where($where)->field('app_type,site_name,logo,group_id, status, expire_time')->findOrEmpty();
-// if (!$site->isEmpty()) {
-// $site->append([ 'status_name' ]);
-// }
-// return $site->toArray();
-// });
}
@@ -203,7 +209,7 @@ class SiteService extends BaseAdminService
* @param $status
* @return array|mixed|string|null
*/
- public function getMenuIdsBySiteId(int $site_id, $is_tree, $status)
+ public function getMenuIdsBySiteId(int $site_id, $status)
{
$site_info = $this->getSiteCache($site_id);
if (empty($site_info))
diff --git a/niucloud/app/service/admin/stat/SiteStatService.php b/niucloud/app/service/admin/stat/SiteStatService.php
index 736fc13fe..f062673db 100644
--- a/niucloud/app/service/admin/stat/SiteStatService.php
+++ b/niucloud/app/service/admin/stat/SiteStatService.php
@@ -99,6 +99,10 @@ class SiteStatService extends BaseAdminService
$woman_count = (new MemberService())->getCount([ ['sex', '=', '2'] ]);
$data['member_stat']['value'] = [$man_count, $woman_count, (int)($member_count - $man_count - $woman_count)];
$data['site_info'] = (new SiteService())->getInfo($this->site_id);
+ $site_create_time = strtotime($data['site_info']['create_time']);
+ $site_expire_time = strtotime($data['site_info']['expire_time']);
+ $data['site_info']['mix'] = (number_format((time() - $site_create_time) / ($site_expire_time - $site_create_time), 2) * 100).'%'; ;
+ $data['site_info']['over_date'] = $site_expire_time - time() > 0 ? number_format(($site_expire_time - time())/ 86400, 2) : 0;
return $data;
}
diff --git a/niucloud/app/service/admin/sys/AreaService.php b/niucloud/app/service/admin/sys/AreaService.php
index f05aca81f..16601a4bc 100644
--- a/niucloud/app/service/admin/sys/AreaService.php
+++ b/niucloud/app/service/admin/sys/AreaService.php
@@ -41,16 +41,10 @@ class AreaService extends BaseAdminService
return cache_remember(
$cache_name,
function() use($pid) {
- $list = $this->model->where([['pid', '=', $pid]])->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->select()->toArray();
- return $list;
+ return $this->model->where([['pid', '=', $pid]])->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->select()->toArray();
},
[self::$cache_tag_name]
);
-// return Cache::tag([self::$cache_tag_name])->remember($cache_name, function() use($pid) {
-// $list = $this->model->where([['pid', '=', $pid]])->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->select()->toArray();
-// return $list;
-// });
-
}
/**
@@ -65,17 +59,80 @@ class AreaService extends BaseAdminService
$cache_name,
function() use($level) {
$list = $this->model->where([['level', '<=', $level]])->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->select()->toArray();
- $tree = list_to_tree($list, 'id', 'pid');
- return $tree;
+ return list_to_tree($list, 'id', 'pid');
},
[self::$cache_tag_name]
);
-// return Cache::tag([self::$cache_tag_name])->remember($cache_name, function() use($level) {
-// $list = $this->model->where([['level', '<=', $level]])->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->select()->toArray();
-// $tree = list_to_tree($list, 'id', 'pid');
-// return $tree;
-// });
}
+ /**
+ * @param string $address
+ * @return int|mixed
+ * 地址解析
+ */
+ public function getAddress(string $address){
+ $map = (new ConfigService())->getMap();
+ $url = "https://apis.map.qq.com/ws/geocoder/v1/?address=".$address."&key=".$map['key'];
+ $curl = curl_init();
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($curl, CURLOPT_HEADER, 0);
+ curl_setopt($curl, CURLOPT_URL, $url);
+ curl_setopt($curl, CURLOPT_TIMEOUT, 1);
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
+
+ $res = curl_exec($curl);
+ $res = json_decode($res, true);
+ if($res){
+ curl_close($curl);
+ return $res;
+ }else {
+ $error = curl_errno($curl);
+ curl_close($curl);
+ return $error;
+ }
+ }
+
+ /**
+ * @param string $location
+ * @return int|mixed
+ * 逆地址解析
+ */
+ public function getAddressInfo(string $location){
+ $map = (new ConfigService())->getMap();
+ $url = "https://apis.map.qq.com/ws/geocoder/v1/?location=".$location."&key=".$map['key'];
+ $curl = curl_init();
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($curl, CURLOPT_HEADER, 0);
+ curl_setopt($curl, CURLOPT_URL, $url);
+ curl_setopt($curl, CURLOPT_TIMEOUT, 1);
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
+
+ $res = curl_exec($curl);
+ $res = json_decode($res, true);
+ if($res){
+ curl_close($curl);
+ return $res;
+ }else {
+ $error = curl_errno($curl);
+ curl_close($curl);
+ return $error;
+ }
+ }
+
+ public function getAreaId($name, $level){
+ $field = 'id';
+ $info = $this->model->field($field)->where([['name', 'like', '%' . $name . '%' ], ['level', '=', $level]])->findOrEmpty()->toArray();
+ return $info;
+ }
+
+ /**
+ * 获取地址名称
+ */
+ public function getAreaName($id){
+ $info = $this->model->field("name")->where([['id', '=', $id ]])->findOrEmpty()->toArray();
+ return $info['name'];
+ }
}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/sys/AttachmentService.php b/niucloud/app/service/admin/sys/AttachmentService.php
index 40d19c0f0..ba9f48cb0 100644
--- a/niucloud/app/service/admin/sys/AttachmentService.php
+++ b/niucloud/app/service/admin/sys/AttachmentService.php
@@ -174,8 +174,7 @@ class AttachmentService extends BaseAdminService
['id', '=', $id]
);
$category_model = new SysAttachmentCategory();
- $res = $category_model->where($where)->update($data);
- return $res;
+ return $category_model->where($where)->update($data);
}
/**
@@ -191,8 +190,7 @@ class AttachmentService extends BaseAdminService
throw new AdminException('ATTACHMENT_GROUP_HAS_IMAGE');
//下级存在图片不能删除
- $res = $category->delete();
- return $res;
+ return $category->delete();
}
diff --git a/niucloud/app/service/admin/sys/ConfigService.php b/niucloud/app/service/admin/sys/ConfigService.php
index 2b30d03d4..0859d18eb 100644
--- a/niucloud/app/service/admin/sys/ConfigService.php
+++ b/niucloud/app/service/admin/sys/ConfigService.php
@@ -15,6 +15,7 @@ use app\service\admin\site\SiteService;
use app\service\core\sys\CoreConfigService;
use app\service\core\sys\CoreSysConfigService;
use core\base\BaseAdminService;
+use core\exception\AdminException;
/**
* 配置服务层
@@ -58,8 +59,7 @@ class ConfigService extends BaseAdminService
'copyright_link' => $value['copyright_link'],
'copyright_desc' => $value['copyright_desc']
];
- $res = $this->core_config_service->setConfig(0,'COPYRIGHT', $data);
- return $res;
+ return $this->core_config_service->setConfig(0,'COPYRIGHT', $data);
}
/**
@@ -120,8 +120,7 @@ class ConfigService extends BaseAdminService
"enterprise_wechat" => $value['enterprise_wechat'],
"tel" => $value['tel']
];
- $res = $this->core_config_service->setConfig(0,'SERVICE_INFO', $data);
- return $res;
+ return $this->core_config_service->setConfig(0,'SERVICE_INFO', $data);
}
/**
@@ -134,8 +133,7 @@ class ConfigService extends BaseAdminService
$data = [
'key' => $value['key'],
];
- $res = $this->core_config_service->setConfig($this->site_id,'MAPKEY', $data);
- return $res;
+ return $this->core_config_service->setConfig($this->site_id,'MAPKEY', $data);
}
/**
@@ -148,9 +146,100 @@ class ConfigService extends BaseAdminService
{
$info = [];
$info['value'] = [
- 'key' => '',
+ 'key' => 'IZQBZ-3UHEU-WTCVD-2464U-I5N4V-ZFFU3',
];
}
return $info['value'];
}
+
+ /**
+ * 获取站点主页配置
+ * @return mixed|string[]
+ */
+ public function getSiteIndexConfig()
+ {
+ $config = (new CoreConfigService())->getConfig($this->site_id, "site_index");
+ if(empty($config))
+ {
+ $config['value'] = [
+ 'view_path' => 'index/site_index'
+ ];
+ }
+ return $config['value']['view_path'];
+ }
+
+ /**
+ * 站点主页配置
+ * @param $data
+ * @return \app\model\sys\SysConfig|bool|\think\Model
+ */
+ public function setSiteIndexConfig($data)
+ {
+ $config = [
+ 'view_path' => $data['view_path'] ,
+ ];
+ //检测是否路劲一个异常
+ $index_list = $this->getSiteIndexList();
+ $check_tag = 0;
+ foreach($index_list as $k => $v)
+ {
+ if($v['view_path'] == $data['view_path'])
+ {
+ $check_tag = 1;
+ }
+ }
+ if($check_tag == 0) throw new AdminException('SITE_INDEX_VIEW_PATH_NOT_EXIST');
+ (new CoreConfigService())->setConfig($this->site_id, "site_index", $config);
+ return true;
+ }
+
+ /**
+ * 获取站点配置的首页列表
+ * @return array
+ */
+ public function getSiteIndexList()
+ {
+ $result = event("SiteIndex");
+ $index_list = [];
+ foreach ($result as $k => $v)
+ {
+ $index_list = empty($index_list) ? $v: array_merge($index_list, $v);
+ }
+ $view_path = $this->getSiteIndexConfig();
+ foreach ($index_list as $k => $v)
+ {
+ $v_view_path = $v['view_path'] ?? '';
+ $index_list[$k]['is_use'] = ($v_view_path == $view_path) ? 1: 0;
+ }
+ return $index_list;
+ }
+
+ /**
+ * 设置站点快捷菜单
+ * @param $data
+ * @return bool
+ */
+ public function setShortcutMenu($data)
+ {
+ (new CoreConfigService())->setConfig($this->site_id, 'shortcut_menu', $data);
+ return true;
+ }
+
+ /**
+ * 获取站点快捷菜单
+ * @return array|mixed
+ */
+ public function getShortcutMenu()
+ {
+ $config = (new CoreConfigService())->getConfig($this->site_id, 'shortcut_menu');
+ $menu = $config['value'] ?? [];
+ if(!empty($menu)){
+ $menu_service = new MenuService();
+ foreach($menu as &$v){
+ $item_router_path = $v['router_path'] ?? '';
+ if(!$item_router_path) $v['router_path'] = $menu_service->getFullRouterPath($v['menu_key']);
+ }
+ }
+ return $menu;
+ }
}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/sys/MenuService.php b/niucloud/app/service/admin/sys/MenuService.php
index 05f866a65..48668f316 100644
--- a/niucloud/app/service/admin/sys/MenuService.php
+++ b/niucloud/app/service/admin/sys/MenuService.php
@@ -142,12 +142,63 @@ class MenuService extends BaseAdminService
{
$menu_list[$k]['menu_name'] = $lang_menu_name;
}
+ //首页加载
+ if($v['menu_key'] == 'overview' && $v['app_type'] == 'site')
+ {
+ $view_path = (new ConfigService())->getSiteIndexConfig();
+ $menu_list[$k]['view_path'] = $view_path;
+ }
+
}
return $is_tree ? $this->menuToTree($menu_list, 'menu_key', 'parent_key', 'children', 'auth', '', 1) : $menu_list;
}
+ /**
+ * 获取所有接口菜单
+ */
+ public function getAllMenuList($app_type = '', $status = 'all', $is_tree = 0, $is_button = 0)
+ {
+ $cache_name = 'menu_api_' .$app_type.'_'. $status . '_' . $is_tree . '_' . $is_button;
+ $menu_list = cache_remember(
+ $cache_name,
+ function () use ($status, $is_tree, $is_button, $app_type) {
+ $where = [
+// ['menu_type', 'in', [0,1]]
+ ['app_type', '=', $app_type],
+ ];
+ if ($status != 'all') {
+ $where[] = ['status', '=', $status];
+ }
+ $menu_list = $this->model->where($where)->order('sort desc')->select()->toArray();
+ return $menu_list;
+ },
+ self::$cache_tag_name
+ );
+ foreach ($menu_list as $k => $v)
+ {
+ $lang_menu_key = "dict_menu_". $v['app_type']. '.'. $v['menu_key'];
+ $lang_menu_name = get_lang("dict_menu_". $v['app_type']. '.'. $v['menu_key']);
+ //语言已定义
+ if($lang_menu_key != $lang_menu_name)
+ {
+ $menu_list[$k]['menu_name'] = $lang_menu_name;
+ }
+ //首页加载
+ if($v['menu_key'] == 'overview' && $v['app_type'] == 'site')
+ {
+ $view_path = (new ConfigService())->getSiteIndexConfig();
+ $menu_list[$k]['view_path'] = $view_path;
+ }
+
+ }
+
+ return $is_tree ? $this->menuToTree($menu_list, 'menu_key', 'parent_key', 'children', 'auth', '', $is_button) : $menu_list;
+
+ }
+
+
/**
* 通过菜单menu_key组获取接口数组
* @param array $menu_keys
@@ -173,19 +224,6 @@ class MenuService extends BaseAdminService
},
self::$cache_tag_name
);
-// return Cache::tag(self::$cache_tag_name)->remember($cache_name, function () use ($menu_keys, $app_type) {
-// $where = [
-// ['menu_key', 'in', $menu_keys]
-// ];
-// if(!empty($app_type)){
-// $where[] = ['app_type', '=', $app_type];
-// }
-// $menu_list = (new SysMenu())->where($where)->order('sort', 'desc')->column('api_url,methods');
-// foreach ($menu_list as $v) {
-// $auth_menu_list[$v['methods']][] = $v['api_url'];
-// }
-// return $auth_menu_list ?? [];
-// });
}
@@ -214,18 +252,6 @@ class MenuService extends BaseAdminService
},
self::$cache_tag_name
);
-// return Cache::tag(self::$cache_tag_name)->remember($cache_name, function () use ($menu_keys, $app_type) {
-// $where = [
-// ['menu_key', 'in', $menu_keys],
-// ['menu_type', '=', MenuTypeDict::BUTTON]
-// ];
-// if(!empty($app_type)){
-// $where[] = ['app_type', '=', $app_type];
-// }
-// $menu_list = $this->model->where($where)->order('sort', 'desc')->column('menu_key');
-// return $menu_list;
-//
-// });
}
/**
@@ -256,21 +282,6 @@ class MenuService extends BaseAdminService
},
self::$cache_tag_name
);
-// return Cache::tag(self::$cache_tag_name)->remember($cache_name, function () use ($status, $app_type) {
-// $where = [
-// ['api_url', '<>', ''],
-// ['app_type', '=', $app_type],
-// ];
-// if ($status != 'all') {
-// $where[] = ['status', '=', $status];
-// }
-// $menu_list = $this->model->where($where)->order('sort', 'desc')->column('methods, api_url');
-// $auth_menu_list = [];
-// foreach ($menu_list as $v) {
-// $auth_menu_list[$v['methods']][] = $v['api_url'];
-// }
-// return $auth_menu_list;
-// });
}
/**
@@ -296,41 +307,6 @@ class MenuService extends BaseAdminService
self::$cache_tag_name
);
}
- /**
- * 获取所有接口菜单
- */
- public function getAllMenuList($app_type = '', $status = 'all', $is_tree = 0, $is_button = 0)
- {
- $cache_name = 'menu_api_' .$app_type.'_'. $status . '_' . $is_tree . '_' . $is_button;
- $menu_list = cache_remember(
- $cache_name,
- function () use ($status, $is_tree, $is_button, $app_type) {
- $where = [
-// ['menu_type', 'in', [0,1]]
- ['app_type', '=', $app_type],
- ];
- if ($status != 'all') {
- $where[] = ['status', '=', $status];
- }
- $menu_list = $this->model->where($where)->order('sort desc')->select()->toArray();
- return $menu_list;
- },
- self::$cache_tag_name
- );
- foreach ($menu_list as $k => $v)
- {
- $lang_menu_key = "dict_menu_". $v['app_type']. '.'. $v['menu_key'];
- $lang_menu_name = get_lang("dict_menu_". $v['app_type']. '.'. $v['menu_key']);
- //语言已定义
- if($lang_menu_key != $lang_menu_name)
- {
- $menu_list[$k]['menu_name'] = $lang_menu_name;
- }
- }
-
- return $is_tree ? $this->menuToTree($menu_list, 'menu_key', 'parent_key', 'children', 'auth', '', $is_button) : $menu_list;;
-
- }
@@ -355,17 +331,6 @@ class MenuService extends BaseAdminService
},
self::$cache_tag_name
);
-// return Cache::tag(self::$cache_tag_name)->remember($cache_name, function () use ($status, $is_tree, $app_type) {
-// $where = [
-// ['menu_type', '=', MenuTypeDict::BUTTON],
-// ['app_type', '=', $app_type],
-// ];
-// if ($status != 'all') {
-// $where[] = ['status', '=', $status];
-// }
-// $menu_list = $this->model->where($where)->order('sort', 'desc')->column('menu_key');
-// return $menu_list;
-// });
}
/**
@@ -409,6 +374,40 @@ class MenuService extends BaseAdminService
}
+ /**
+ * 获取完整的路由地址
+ * @param $menu
+ * @return string
+ */
+ public function getFullRouterPath($menu_key){
+ $menu = $this->find($menu_key);
+ $parents = [];
+ $this->getParentDirectory($menu, $parents);
+ $parents = array_reverse($parents);
+ $router_path = implode('/', $parents);
+ if(!empty($router_path)){
+ $router_path .= '/'.$menu['router_path'];
+ }else{
+ $router_path = $menu['router_path'];
+ }
+ return $router_path;
+ }
+ /**
+ * 递归查询模板集合
+ * @param SysMenu $menu
+ * @param $parents
+ * @return void
+ */
+ public function getParentDirectory(SysMenu $menu, &$parents){
+ if(!$menu->isEmpty() && !empty($menu['parent_key'])){
+ $parent_menu = $this->model->where([['menu_key', '=', $menu['parent_key']]])->findOrEmpty();
+ if(!empty($parent_menu)){
+ if(!empty($parent_menu['router_path'])) $parents[] = $parent_menu['router_path'];
+ $this->getParentDirectory($parent_menu, $parents);
+ }
+ }
+
+ }
}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/sys/RoleService.php b/niucloud/app/service/admin/sys/RoleService.php
index 974b33d8b..9ba8ab04a 100644
--- a/niucloud/app/service/admin/sys/RoleService.php
+++ b/niucloud/app/service/admin/sys/RoleService.php
@@ -55,7 +55,7 @@ class RoleService extends BaseAdminService
* @return mixed
*/
public function getInfo(int $role_id){
- return $this->model->findOrEmpty($role_id)->append(['status_name'])->toArray();
+ return $this->model->append(['status_name'])->findOrEmpty($role_id)->toArray();
}
/**
@@ -148,13 +148,6 @@ class RoleService extends BaseAdminService
},
[MenuService::$cache_tag_name, self::$cache_tag_name.$this->site_id]
);
-// return Cache::tag([MenuService::$cache_tag_name, self::$cache_tag_name.$this->site_id])->remember($cache_name, function() use($site_id) {
-// $where = [
-// ['site_id', '=', $site_id]
-// ];
-// return $this->model->where($where)->column('role_name', 'role_id');
-// });
-
}
/**
@@ -163,20 +156,24 @@ class RoleService extends BaseAdminService
* @return array
*/
public function getMenuIdsByRoleIds(int $site_id, array $role_ids){
- $menu_keys = (new SiteService())->getMenuIdsBySiteId($site_id, true, 1);
- $allow_role_ids = array_intersect($role_ids, $menu_keys);
+ $menu_keys = (new SiteService())->getMenuIdsBySiteId($site_id, 1);
+ $allow_role_ids = array_merge($role_ids, $menu_keys);
sort($allow_role_ids);
$cache_name = 'user_role_'.$site_id.'_'.md5(implode('_', $allow_role_ids));
return cache_remember(
$cache_name,
- function() use($role_ids) {
+ function() use($role_ids, $menu_keys) {
$rules = $this->model::where([['role_id', 'IN', $role_ids], ['status', '=', RoleStatusDict::ON]])->field('rules')->select()->toArray();
if(!empty($rules)){
$temp = [];
foreach($rules as $k => $v){
$temp = array_merge($temp, $v['rules']);
}
- return array_unique($temp);
+ $temp = array_unique($temp);
+ if(empty($menu_keys)) return [];
+ if(empty($temp)) return [];
+ $allow_menu_ids = array_intersect($temp, $menu_keys);
+ return $allow_menu_ids;
}
return [];
},
diff --git a/niucloud/app/service/admin/sys/SystemService.php b/niucloud/app/service/admin/sys/SystemService.php
index 8edce31d6..306dfbf38 100644
--- a/niucloud/app/service/admin/sys/SystemService.php
+++ b/niucloud/app/service/admin/sys/SystemService.php
@@ -12,6 +12,7 @@
namespace app\service\admin\sys;
use app\job\sys\CheckJob;
+use app\model\site\Site;
use core\base\BaseAdminService;
use think\facade\Db;
@@ -47,11 +48,16 @@ class SystemService extends BaseAdminService
*/
public function getUrl()
{
- $site_tag = $this->site_id == 1 ? '' : '/s' . $this->site_id;
+ $site = Site::find($this->site_id);
+ $site_tag = $site[ 'site_code' ];
+
+ $wap_domain = !empty(env("system.wap_domain")) ? preg_replace('#/$#', '', env("system.wap_domain")) : request()->domain();
+ $web_domain = !empty(env("system.web_domain")) ? preg_replace('#/$#', '', env("system.web_domain")) : request()->domain();
+
$data = [
'wap_domain' => env("system.wap_domain"),
- 'wap_url' => ( !empty(env("system.wap_domain")) ? env("system.wap_domain") : request()->domain() ) . "/wap" . $site_tag,
- 'web_url' => ( !empty(env("system.web_domain")) ? env("system.web_domain") : request()->domain() ) . "/web" . $site_tag,
+ 'wap_url' => $wap_domain . "/wap/" . $site_tag,
+ 'web_url' => $web_domain . "/web/" . $site_tag,
];
return $data;
}
diff --git a/niucloud/app/service/admin/user/UserRoleService.php b/niucloud/app/service/admin/user/UserRoleService.php
index 3a25837bf..8a908f657 100644
--- a/niucloud/app/service/admin/user/UserRoleService.php
+++ b/niucloud/app/service/admin/user/UserRoleService.php
@@ -102,14 +102,6 @@ class UserRoleService extends BaseAdminService
},
[self::$role_cache_name, RoleService::$cache_tag_name.$this->site_id]
);
-// return Cache::tag([self::$role_cache_name, RoleService::$cache_tag_name.$this->site_id])->remember($cache_name, function() use($uid, $site_id) {
-// $user_role_model = new SysUserRole();
-// $where = array(
-// ['uid', '=', $uid],
-// ['site_id', '=', $site_id]
-// );
-// return $user_role_model::where($where)->findOrEmpty()->toArray();
-// });
}
/**
@@ -143,32 +135,7 @@ class UserRoleService extends BaseAdminService
},
[self::$role_cache_name, RoleService::$cache_tag_name.$this->site_id]
);
-// return Cache::tag([self::$role_cache_name, RoleService::$cache_tag_name.$this->site_id])->remember($cache_name, function() use($role_ids, $site_id) {
-// $where = array(
-// ['role_id', 'in', $role_ids],
-// ['site_id', '=', $site_id]
-// );
-// return SysRole::where($where)->column('role_name');
-// });
}
-// public function getFirstMenuByUser(int $site_id, int $uid){
-// $role_service = (new RoleService())->getMenuIdsByRoleIds();
-// $userrole = $this->getUserRole($site_id, $uid);
-// $site_info = (new SiteService())->getSiteCache($site_id);
-// if(empty($userrole)) throw new AuthException('SITE_USER_CAN_NOT_LOGIN_IN_ADMIN');
-// if($userrole->is_admin){
-// if($site_info->app_type == AppTypeDict::SITE){
-//
-// }else if($site_info->app_type == AppTypeDict::ADMIN){
-//
-// }
-// }else{
-// $user_role_ids = $userrole->role_ids;
-// $menu_keys = (new RoleService())->getMenuIdsByRoleIds($site_id, $user_role_ids);
-// if(in_array('siteindex', $menu_keys)){
-//
-// }
-// }
-// }
+
}
\ No newline at end of file
diff --git a/niucloud/app/service/admin/user/UserService.php b/niucloud/app/service/admin/user/UserService.php
index c2cea50b4..600eb098e 100644
--- a/niucloud/app/service/admin/user/UserService.php
+++ b/niucloud/app/service/admin/user/UserService.php
@@ -54,11 +54,8 @@ class UserService extends BaseAdminService
['uid', '=', $uid],
);
$field = 'uid, username, head_img, real_name, last_ip, last_time, create_time, login_count, status, delete_time, update_time';
- $user = $this->model->where($where)->field($field)->findOrEmpty();
- if($user->isEmpty()){
- return [];
- }
- return $user->append(['status_name'])->toArray();
+ $user = $this->model->where($where)->field($field)->append(['status_name'])->findOrEmpty();
+ return $user->toArray();
}
/**
@@ -248,7 +245,7 @@ class UserService extends BaseAdminService
* @return SysUser|array|mixed|\think\Model
*/
public function getUserInfoByUsername(string $username){
- return $this->model->withSearch(['username'], ['username' => $username])->findOrEmpty();
+ return $this->model->where([['username', '=',$username]])->findOrEmpty();
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/api/article/ArticleCategoryService.php b/niucloud/app/service/api/article/ArticleCategoryService.php
index ee2531c22..827f30ed0 100644
--- a/niucloud/app/service/api/article/ArticleCategoryService.php
+++ b/niucloud/app/service/api/article/ArticleCategoryService.php
@@ -36,8 +36,7 @@ class ArticleCategoryService extends BaseApiService
$field = 'category_id, site_id, name, sort, is_show, create_time, update_time';
$order = 'create_time desc';
$search_model = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['name'], $where)->field($field)->order($order);
- $list = $this->pageQuery($search_model);
- return $list;
+ return $this->pageQuery($search_model);
}
/**
@@ -47,8 +46,6 @@ class ArticleCategoryService extends BaseApiService
public function getInfo(int $id)
{
$field = 'category_id, site_id, name, sort, is_show, create_time, update_time';
-
- $info = $this->model->field($field)->where([['category_id', '=', $id], ['site_id', '=', $this->site_id]])->findOrEmpty()->toArray();
- return $info;
+ return $this->model->field($field)->where([['category_id', '=', $id], ['site_id', '=', $this->site_id]])->findOrEmpty()->toArray();
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/api/article/ArticleService.php b/niucloud/app/service/api/article/ArticleService.php
index c99438cba..0c7277caf 100644
--- a/niucloud/app/service/api/article/ArticleService.php
+++ b/niucloud/app/service/api/article/ArticleService.php
@@ -39,8 +39,7 @@ class ArticleService extends BaseApiService
$field = 'id, category_id, site_id, title, intro, summary, image, author, content, visit, visit_virtual, is_show, sort, create_time, update_time';
$order = 'create_time desc';
$search_model = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ 'title', 'category_id'], $where)->with('articleCategory')->field($field)->order($order);
- $list = $this->pageQuery($search_model);
- return $list;
+ return $this->pageQuery($search_model);
}
/**
@@ -55,8 +54,7 @@ class ArticleService extends BaseApiService
$where[] = [ 'site_id', '=', $this->site_id ];
$field = 'id, category_id, site_id, title, intro, summary, image, author, content, visit, visit_virtual, is_show, sort, create_time, update_time';
$order = 'create_time desc';
- $list = $this->model->where([ [ 'site_id', '=', $this->site_id ] , ['is_show', '=', 1]])->withSearch([ 'title', 'category_id', 'ids' ], $where)->limit($limit)->with('articleCategory')->field($field)->order($order)->select()->toArray();
- return $list;
+ return $this->model->where([ [ 'site_id', '=', $this->site_id ] , ['is_show', '=', 1]])->withSearch([ 'title', 'category_id', 'ids' ], $where)->limit($limit)->with('articleCategory')->field($field)->order($order)->select()->toArray();
}
/**
@@ -67,8 +65,7 @@ class ArticleService extends BaseApiService
{
$field = 'id, category_id, site_id, title, intro, summary, image, author, content, visit, visit_virtual, is_show, sort, create_time, update_time';
- $info = $this->model->with('articleCategory')->field($field)->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->findOrEmpty()->toArray();
- return $info;
+ return $this->model->with('articleCategory')->field($field)->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->findOrEmpty()->toArray();
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/api/diy/DiyService.php b/niucloud/app/service/api/diy/DiyService.php
index 129e8da53..0d7ac986f 100644
--- a/niucloud/app/service/api/diy/DiyService.php
+++ b/niucloud/app/service/api/diy/DiyService.php
@@ -46,7 +46,7 @@ class DiyService extends BaseApiService
$condition[] = [ 'is_default', '=', 1 ];
}
- $field = 'id,site_id,title,name,type,value,is_default,share,visit_count';
+ $field = 'id,site_id,title,name,type,template, mode,value,is_default,share,visit_count';
$info = $this->model->field($field)->where($condition)->findOrEmpty()->toArray();
if (empty($info)) {
@@ -57,8 +57,10 @@ class DiyService extends BaseApiService
$info = [
'site_id' => $this->site_id,
'title' => $page_data[ 'title' ],
- 'name' => $page_data[ 'template' ],
- 'type' => $page_data[ 'template' ],
+ 'name' => $page_data[ 'type' ],
+ 'type' => $page_data[ 'type' ],
+ 'template' => $page_data[ 'template' ],
+ 'mode' => $page_data[ 'mode' ],
'value' => json_encode($page_data[ 'data' ], JSON_UNESCAPED_UNICODE),
'is_default' => 1,
'share' => '',
@@ -72,15 +74,17 @@ class DiyService extends BaseApiService
/**
* 获取默认页面数据
- * @param $template
+ * @param $type
* @return array|mixed
*/
- public function getFirstPageData($template)
+ public function getFirstPageData($type)
{
- $pages = PagesDict::getPages($template);
+ $pages = PagesDict::getPages([ 'type' => $type ]);
if (!empty($pages)) {
+ $template = array_key_first($pages);
$page = array_shift($pages);
$page[ 'template' ] = $template;
+ $page[ 'type' ] = $type;
return $page;
}
return [];
diff --git a/niucloud/app/service/api/login/AuthService.php b/niucloud/app/service/api/login/AuthService.php
index dfcfb4e78..1e547d531 100644
--- a/niucloud/app/service/api/login/AuthService.php
+++ b/niucloud/app/service/api/login/AuthService.php
@@ -50,13 +50,14 @@ class AuthService extends BaseApiService
* @return true
*/
public function checkSite(Request $request){
- $site_id = $request->apiSiteId();//todo 可以是依赖传值,也可以通过domain域名来获取site_id
- $site_info = (new CoreSiteService())->getSiteCache($site_id);
+ $site_code = $request->apiSiteId();//todo 可以是依赖传值,也可以通过domain域名来获取site_id
+ $site_info = (new CoreSiteService())->getSiteInfoBySiteCode($site_code);
if(empty($site_info)) throw new AuthException('SITE_NOT_EXIST');
if($site_info['status'] == SiteDict::CLOSE){
$rule = trim(strtolower($request->rule()->getRule()));
if($rule != 'site') throw new AuthException('SITE_CLOSE_NOT_ALLOW');
}
+ $site_id = $site_info['site_id'];
$request->siteId($site_id);
return true;
}
diff --git a/niucloud/app/service/api/member/MemberService.php b/niucloud/app/service/api/member/MemberService.php
index 1bc904dda..c28dd2593 100644
--- a/niucloud/app/service/api/member/MemberService.php
+++ b/niucloud/app/service/api/member/MemberService.php
@@ -67,7 +67,7 @@ class MemberService extends BaseApiService
public function getInfo()
{
$field = 'member_id, site_id, username, member_no, mobile, register_channel, nickname, headimg, member_level, member_label, login_ip, login_type, login_time, create_time, last_visit_time, last_consum_time, sex, status, birthday, point, balance, growth, is_member, member_time, is_del, province_id, city_id, district_id, address, location, money, money_get, wx_openid, weapp_openid, commission, commission_get, commission_cash_outing';
- return $this->model->where([['member_id', '=', $this->member_id]])->field($field)->findOrEmpty()->append(['sex_name'])->toArray();
+ return $this->model->where([['member_id', '=', $this->member_id]])->field($field)->append(['sex_name'])->findOrEmpty()->toArray();
}
/**
@@ -76,7 +76,7 @@ class MemberService extends BaseApiService
public function center()
{
$field = 'member_id, site_id, username, member_no, mobile, register_channel, nickname, headimg, member_level, member_label, login_ip, login_type, login_time, create_time, last_visit_time, last_consum_time, sex, status, birthday, point, balance, growth, is_member, member_time, is_del, province_id, city_id, district_id, address, location, money, money_get, commission, commission_get, commission_cash_outing';
- return $this->model->where([['member_id', '=', $this->member_id]])->field($field)->findOrEmpty()->append(['sex_name'])->toArray();
+ return $this->model->where([['member_id', '=', $this->member_id]])->field($field)->append(['sex_name'])->findOrEmpty()->toArray();
}
/**
diff --git a/niucloud/app/service/core/addon/CoreAddonBaseService.php b/niucloud/app/service/core/addon/CoreAddonBaseService.php
index 67c84abec..0dad616b7 100644
--- a/niucloud/app/service/core/addon/CoreAddonBaseService.php
+++ b/niucloud/app/service/core/addon/CoreAddonBaseService.php
@@ -81,8 +81,7 @@ class CoreAddonBaseService extends BaseCoreService
{
if (file_exists($json_file_path)) {
$content_json = @file_get_contents($json_file_path);
- $content_array = json_decode($content_json, true);
- return $content_array;
+ return json_decode($content_json, true);
}else
return [];
}
diff --git a/niucloud/app/service/core/addon/CoreAddonInstallService.php b/niucloud/app/service/core/addon/CoreAddonInstallService.php
index 9bb3d4984..bfbc5730b 100644
--- a/niucloud/app/service/core/addon/CoreAddonInstallService.php
+++ b/niucloud/app/service/core/addon/CoreAddonInstallService.php
@@ -16,6 +16,7 @@ use app\job\sys\AddonInstall;
use app\service\admin\sys\MenuService;
use app\service\admin\sys\SystemService;
use app\service\core\menu\CoreMenuService;
+use app\service\core\schedule\CoreScheduleInstallService;
use core\exception\AddonException;
use core\exception\CommonException;
use core\util\Terminal;
@@ -72,6 +73,7 @@ class CoreAddonInstallService extends CoreAddonBaseService
const SQL_INSTALLED = 'sql_installed';
const MENU_INSTALLED = 'menu_installed';
+ const SCHEDULE_INSTALLED = 'schedule_installed';
const WAIT_DEPEND = 'wait_depend';
@@ -269,6 +271,13 @@ class CoreAddonInstallService extends CoreAddonBaseService
'desc' => '安装插件菜单',
'state' => AddonDict::INSTALL_UNEXECUTED
],
+ 'installSchedule' => [//安装计划任务
+ 'addon' => $this->addon,
+ 'step' => 'installSchedule',
+ 'command' => "php think addon:install {$this->addon} --step installSchedule",
+ 'desc' => '安装插件计划任务',
+ 'state' => AddonDict::INSTALL_UNEXECUTED
+ ],
'installWap' => [
'addon' => $this->addon,
'step' => 'installWap',
@@ -552,7 +561,8 @@ class CoreAddonInstallService extends CoreAddonBaseService
if (!$this->uninstallDir()) throw new AddonException();
// 卸载菜单
$this->uninstallMenu();
-
+ // 卸载计划任务
+ $this->uninstallSchedule();
// 卸载wap
$this->uninstallWap();
@@ -660,6 +670,9 @@ class CoreAddonInstallService extends CoreAddonBaseService
// 编译 diy-group 自定义组件代码文件
$this->compileDiyComponentsCode($this->root_path . "uni-app" . DIRECTORY_SEPARATOR);
+ // 编译 fixed-group 固定模板组件代码文件
+ $this->compileFixedComponentsCode($this->root_path . "uni-app" . DIRECTORY_SEPARATOR);
+
// 编译 pages.json 页面路由代码文件
$this->installPageCode($this->root_path . "uni-app" . DIRECTORY_SEPARATOR);
@@ -674,6 +687,9 @@ class CoreAddonInstallService extends CoreAddonBaseService
// 编译 diy-group 自定义组件代码文件
$this->compileDiyComponentsCode($this->root_path . "uni-app" . DIRECTORY_SEPARATOR);
+ // 编译 fixed-group 固定模板组件代码文件
+ $this->compileFixedComponentsCode($this->root_path . "uni-app" . DIRECTORY_SEPARATOR);
+
// 编译 pages.json 页面路由代码文件
$this->uninstallPageCode($this->root_path . "uni-app" . DIRECTORY_SEPARATOR);
}
@@ -749,4 +765,26 @@ class CoreAddonInstallService extends CoreAddonBaseService
return true;
}
+
+ /**
+ * 安装计划任务
+ * @return true
+ */
+ public function installSchedule()
+ {
+ ( new CoreScheduleInstallService())->installAddonSchedule($this->addon);
+ $this->state = self::SCHEDULE_INSTALLED;
+ return true;
+ }
+
+ /**
+ * 卸载计划任务
+ * @return true
+ */
+ public function uninstallSchedule()
+ {
+ ( new CoreScheduleInstallService())->uninstallAddonSchedule($this->addon);
+ return true;
+ }
+
}
\ No newline at end of file
diff --git a/niucloud/app/service/core/addon/CoreAddonService.php b/niucloud/app/service/core/addon/CoreAddonService.php
index e259280fe..1a1579231 100644
--- a/niucloud/app/service/core/addon/CoreAddonService.php
+++ b/niucloud/app/service/core/addon/CoreAddonService.php
@@ -83,8 +83,7 @@ class CoreAddonService extends CoreAddonBaseService
public function getPage(array $where){
$field = 'id, title, key, desc, version, status, icon, create_time, install_time';
$search_model = $this->model->where([])->withSearch(['title'],$where)->field($field)->order('id desc');
- $data = $this->pageQuery($search_model);
- return $data;
+ return $this->pageQuery($search_model);
}
/**
diff --git a/niucloud/app/service/core/addon/WapTrait.php b/niucloud/app/service/core/addon/WapTrait.php
index 31d825850..b6efe10eb 100644
--- a/niucloud/app/service/core/addon/WapTrait.php
+++ b/niucloud/app/service/core/addon/WapTrait.php
@@ -128,6 +128,66 @@ trait WapTrait
return $res;
}
+ /**
+ * 编译 fixed-group 固定模板组件代码文件
+ * @param $compile_path
+ * @param $addon_name
+ * @return string
+ */
+ public function compileFixedComponentsCode($compile_path)
+ {
+ $content = "\n";
+ $content .= " \n";
+
+ $root_path = $compile_path . str_replace('/', DIRECTORY_SEPARATOR, 'components/fixed'); // 扩展组件根目录
+ $file_arr = getFileMap($root_path);
+
+ if (!empty($file_arr)) {
+ foreach ($file_arr as $ck => $cv) {
+ if (strpos($cv, 'index.vue') !== false) {
+
+ $path = str_replace($root_path . '/', '', $ck);
+ $path = str_replace('/index.vue', '', $path);
+ if ($path == 'group') {
+ continue;
+ }
+
+ // 获取自定义组件 key 关键词
+ $name_arr = explode('-', $path);
+ foreach ($name_arr as $k => $v) {
+ // 首字母大写
+ $name_arr[ $k ] = strtoupper(substr($v, 0, 1)) . substr($v, 1);
+ }
+ $name = implode('', $name_arr);
+ $file_name = 'fixed-' . $path;
+
+ $content .= " \n";
+ $content .= " <$file_name :data=\"data\">$file_name>\n";
+ $content .= " \n";
+ }
+ }
+ }
+
+ $content .= " \n";
+ $content .= "\n";
+
+ $content .= "\n";
+
+ $content .= "\n";
+
+ $res = file_put_contents($compile_path . str_replace('/', DIRECTORY_SEPARATOR, 'components/fixed/group/index.vue'), $content);
+ return $res;
+ }
+
/**
* 编译 pages.json 页面路由代码文件
* @param $compile_path
diff --git a/niucloud/app/service/core/aliapp/CoreAliappConfigService.php b/niucloud/app/service/core/aliapp/CoreAliappConfigService.php
index cd1674cf2..ff4b5c6f4 100644
--- a/niucloud/app/service/core/aliapp/CoreAliappConfigService.php
+++ b/niucloud/app/service/core/aliapp/CoreAliappConfigService.php
@@ -31,7 +31,7 @@ class CoreAliappConfigService extends BaseCoreService
*/
public function getAliappConfig(int $site_id){
$info = (new CoreConfigService())->getConfig($site_id, ConfigKeyDict::ALIAPP)['value'] ?? [];
- $config = [
+ return [
'name' => $info['name'] ?? '',
'app_id' => $info['app_id'] ?? '',
'private_key' => $info['private_key'] ?? '',
@@ -41,8 +41,6 @@ class CoreAliappConfigService extends BaseCoreService
'alipay_with_crt' => $info['alipay_with_crt'] ?? '',
'qrcode' => $info['qrcode'] ?? ''
];
-
- return $config;
}
/**
diff --git a/niucloud/app/service/core/member/CoreMemberAccountService.php b/niucloud/app/service/core/member/CoreMemberAccountService.php
index 8258beed2..78aec8e02 100644
--- a/niucloud/app/service/core/member/CoreMemberAccountService.php
+++ b/niucloud/app/service/core/member/CoreMemberAccountService.php
@@ -34,7 +34,7 @@ class CoreMemberAccountService extends BaseCoreService
[ 'member_id', '=', $member_id ],
[ 'site_id', '=', $site_id ]
])->field($account_type .','.$account_type."_get" .', username, mobile, nickname')->lock(true)->find();
- if(empty($member_info)) throw new CommonException('MEMBER_NOT_EXIST');;
+ if(empty($member_info)) throw new CommonException('MEMBER_NOT_EXIST');
$account_new_data = round((float) $member_info[ $account_type ] + (float) $account_data, 2);
if ($account_new_data < 0) {
diff --git a/niucloud/app/service/core/member/CoreMemberConfigService.php b/niucloud/app/service/core/member/CoreMemberConfigService.php
index 2624808ed..0d0be8215 100644
--- a/niucloud/app/service/core/member/CoreMemberConfigService.php
+++ b/niucloud/app/service/core/member/CoreMemberConfigService.php
@@ -32,14 +32,13 @@ class CoreMemberConfigService extends BaseCoreService
*/
public function getLoginConfig(int $site_id){
$info = (new CoreConfigService())->getConfig($site_id, 'LOGIN')['value'] ?? [];
- $config = [
+ return [
'is_username' => $info['is_username'] ?? 1,//是否用户名密码登录
'is_mobile' => $info['is_mobile'] ?? 0,//是否手机验证码登录
'is_auth_register' => $info['is_auth_register'] ?? 1,//是否第三方自动注册
'is_bind_mobile' => $info['is_bind_mobile'] ?? 0,//是否强制绑定手机
'agreement_show' => $info['agreement_show'] ?? 0 // 政策协议是否展示
];
- return $config;
}
/**
@@ -66,11 +65,10 @@ class CoreMemberConfigService extends BaseCoreService
*/
public function getMemberConfig(int $site_id){
$info = (new CoreConfigService())->getConfig($site_id, 'MEMBER')['value'] ?? [];
- $config = [
+ return [
'prefix' => $info['prefix'] ?? '',// 会员编码前缀
'length' => $info['length'] ?? 4, // 会员编码长度
];
- return $config;
}
/**
diff --git a/niucloud/app/service/core/member/CoreMemberLabelService.php b/niucloud/app/service/core/member/CoreMemberLabelService.php
index e730f2615..ff8674f2e 100644
--- a/niucloud/app/service/core/member/CoreMemberLabelService.php
+++ b/niucloud/app/service/core/member/CoreMemberLabelService.php
@@ -48,9 +48,6 @@ class CoreMemberLabelService extends BaseCoreService
},
self::$cache_tag_name.$site_id
);
-// return Cache::tag(self::$cache_tag_name.$site_id)->remember($cache_name, function () use ($site_id, $label_ids) {
-// return array_keys_search($this->getAll($site_id), $label_ids, 'label_id');
-// });
}
/**
@@ -72,11 +69,6 @@ class CoreMemberLabelService extends BaseCoreService
},
self::$cache_tag_name.$site_id
);
-// return Cache::tag(self::$cache_tag_name.$site_id)->remember($cache_name, function () use ($site_id) {
-// $field = 'label_id, label_name';
-// return $this->model->where([['site_id', '=', $site_id]])->field($field)->select()->toArray();
-//
-// });
}
/**
diff --git a/niucloud/app/service/core/notice/CoreNoticeLogService.php b/niucloud/app/service/core/notice/CoreNoticeLogService.php
index 06cbb98b2..27f03bc85 100644
--- a/niucloud/app/service/core/notice/CoreNoticeLogService.php
+++ b/niucloud/app/service/core/notice/CoreNoticeLogService.php
@@ -49,6 +49,6 @@ class CoreNoticeLogService extends BaseCoreService
public function getInfo(int $site_id, int $id){
$field = 'id, site_id, key, notice_type, uid, member_id, nickname, receiver, is_click, is_visit, visit_time, create_time, params, content';
- return $this->model->where([['site_id', '=', $site_id], ['id', '=', $id]])->field($field)->findOrEmpty()->append(['name', 'notice_type_name'])->toArray();
+ return $this->model->where([['site_id', '=', $site_id], ['id', '=', $id]])->field($field)->append(['name', 'notice_type_name'])->findOrEmpty()->toArray();
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/core/notice/CoreNoticeSmsLogService.php b/niucloud/app/service/core/notice/CoreNoticeSmsLogService.php
index c3a7bc399..f80802a3b 100644
--- a/niucloud/app/service/core/notice/CoreNoticeSmsLogService.php
+++ b/niucloud/app/service/core/notice/CoreNoticeSmsLogService.php
@@ -35,25 +35,21 @@ class CoreNoticeSmsLogService extends BaseCoreService
*/
public function getPage(int $site_id, array $where = [])
{
-
- $field = 'mobile, sms_type, key, content, data, status, result, create_time, send_time, update_time';
+ $field = 'id,mobile,sms_type,key,template_id,content,params,status,result,create_time,send_time,update_time';
$order = 'create_time desc';
- $search_model = $this->model->where([['site_id', '=', $site_id]])->withSearch(['name'], $where)->field($field)->order($order)->append(['name', 'app_type_name', 'status_name']);
- $list = $this->pageQuery($search_model);
- return $list;
+ $search_model = $this->model->where([['site_id', '=', $site_id]])->withSearch(['name', 'key', 'mobile', 'sms_type'], $where)->field($field)->order($order)->append(['name', 'sms_type_name', 'status_name']);
+ return $this->pageQuery($search_model);
}
-
/**
* 获取短信发送记录信息
* @param int $id
*/
public function getInfo(int $site_id, int $id)
{
- $field = 'mobile, sms_type, key, content, data, status, result, create_time, send_time, update_time';
- $info = $this->model->field($field)->where([['id', '=', $id], ['site_id', '=', $site_id]])->findOrEmpty()->append(['name', 'app_type_name', 'status_name'])->toArray();
- return $info;
+ $field = 'id, mobile,sms_type,key,template_id,content,params,status,result,create_time,send_time,update_time';
+ return $this->model->field($field)->where([['id', '=', $id], ['site_id', '=', $site_id]])->append(['name', 'sms_type_name', 'status_name'])->findOrEmpty()->toArray();
}
/**
@@ -88,8 +84,7 @@ class CoreNoticeSmsLogService extends BaseCoreService
*/
public function del(int $site_id, int $id)
{
- $res = $this->model->where([['id', '=', $id], ['site_id', '=', $site_id]])->delete();
- return $res;
+ return $this->model->where([['id', '=', $id], ['site_id', '=', $site_id]])->delete();
}
diff --git a/niucloud/app/service/core/pay/CorePayEventService.php b/niucloud/app/service/core/pay/CorePayEventService.php
index 2f7d8b261..e00ebb9ef 100644
--- a/niucloud/app/service/core/pay/CorePayEventService.php
+++ b/niucloud/app/service/core/pay/CorePayEventService.php
@@ -91,7 +91,8 @@ class CorePayEventService extends BaseCoreService
'refund_url' => $refund_url,
'quit_url' => $quit_url,
'buyer_id' => $buyer_id,
- 'openid' => $openid
+ 'openid' => $openid,
+ 'site_id' => $this->site_id
);
switch ($this->type) {
case PayDict::WECHATPAY:
@@ -116,7 +117,7 @@ class CorePayEventService extends BaseCoreService
$pay_fun = 'app';
break;
}
-
+ if (empty($pay_fun)) throw new PayException('PAYMENT_METHOD_NOT_SCENE');
break;
case PayDict::ALIPAY:
switch ($this->channel) {
@@ -133,8 +134,12 @@ class CorePayEventService extends BaseCoreService
$pay_fun = 'wap';
break;
}
+ if (empty($pay_fun)) throw new PayException('PAYMENT_METHOD_NOT_SCENE');
+ break;
}
- if (empty($pay_fun)) throw new PayException('PAYMENT_METHOD_NOT_SCENE');
+
+ if (empty($pay_fun)) $pay_fun = 'pay';
+
return $this->app('pay')->$pay_fun($params);
}
@@ -158,7 +163,7 @@ class CorePayEventService extends BaseCoreService
$money = $money * 100;
break;
case PayDict::ALIPAY:
-
+ break;
}
return $this->app('transfer')->transfer([
'transfer_no' => $transfer_no,
diff --git a/niucloud/app/service/core/pay/CorePayService.php b/niucloud/app/service/core/pay/CorePayService.php
index 418bb13e0..1f4b72814 100644
--- a/niucloud/app/service/core/pay/CorePayService.php
+++ b/niucloud/app/service/core/pay/CorePayService.php
@@ -45,7 +45,7 @@ class CorePayService extends BaseCoreService
* @return string|null
*/
public function create($site_id, string $main_type, int $main_id, float $money, string $trade_type, string $body){
- $out_trade_no = create_no('pay', $main_id);
+ $out_trade_no = create_no();
$data = array(
'site_id' => $site_id,
'money' => $money,
@@ -262,7 +262,8 @@ class CorePayService extends BaseCoreService
return (new CoreRefundService())->refundNotify($site_id, $out_trade_no, $type, $params);
break;
}
-
+ //找不到对应的业务
+ return true;
} catch (PayException $e) {
return false;
}
@@ -292,9 +293,8 @@ class CorePayService extends BaseCoreService
if(!$money){
$money = $pay->money;
}
- $new_out_trade_no = $this->create($site_id, $pay->main_type, $pay->main_id, $money, $pay->trade_type, $pay->body);
//todo 需要考虑是业务调用重置支付,还是支付重置反馈业务
- return $new_out_trade_no;
+ return $this->create($site_id, $pay->main_type, $pay->main_id, $money, $pay->trade_type, $pay->body);
}
/**
diff --git a/niucloud/app/service/core/pay/CoreRefundService.php b/niucloud/app/service/core/pay/CoreRefundService.php
index ffb54ac08..b93d631c2 100644
--- a/niucloud/app/service/core/pay/CoreRefundService.php
+++ b/niucloud/app/service/core/pay/CoreRefundService.php
@@ -45,7 +45,7 @@ class CoreRefundService extends BaseCoreService
if($pay->isEmpty()) throw new PayException();//单据不存在
//校验当前数据是否存在
//存在就修改,不存在就创建
- $refund_no = create_no('refund', $pay->id);
+ $refund_no = create_no();
$data = array(
'site_id' => $site_id,
'money' => $money,
@@ -217,7 +217,7 @@ class CoreRefundService extends BaseCoreService
['site_id', '=', $site_id],
['refund_no', '=', $refund_no]
])->update([
- 'status' => RefundDict::SUCCESS,
+ 'status' => RefundDict::FAIL,
'fail_reason' => $data['fail_reason']
]);
return true;
diff --git a/niucloud/app/service/core/pay/CoreTransferService.php b/niucloud/app/service/core/pay/CoreTransferService.php
index 4b188ba8e..e52bc8a62 100644
--- a/niucloud/app/service/core/pay/CoreTransferService.php
+++ b/niucloud/app/service/core/pay/CoreTransferService.php
@@ -44,7 +44,7 @@ class CoreTransferService extends BaseCoreService
* @return string|null
*/
public function create(int $site_id, string $main_type, int $main_id, float $money, string $trade_type, string $remark){
- $transfer_no = create_no('pay', $main_id);
+ $transfer_no = create_no();
$transfer_data = array(
'site_id' => $site_id,
'money' => $money,
diff --git a/niucloud/app/service/core/paytype/CoreBalanceService.php b/niucloud/app/service/core/paytype/CoreBalanceService.php
index d5698a384..97c434835 100644
--- a/niucloud/app/service/core/paytype/CoreBalanceService.php
+++ b/niucloud/app/service/core/paytype/CoreBalanceService.php
@@ -42,11 +42,15 @@ class CoreBalanceService extends BaseCoreService
// if(empty($password)){
//
// }
- $site_id = $params['site_id'];
- $main_id = $params['main_id'];
- $main_type = $params['main_type'];
- $money = $params['money'];
$out_trade_no = $params['out_trade_no'];//交易流水号
+ $site_id = $params['site_id'];
+
+ $pay = (new CorePayService())->findPayInfoByOutTradeNo($site_id, $out_trade_no);
+
+ $main_id = $pay['main_id'];
+ $main_type = $pay['main_type'];
+ $money = $params['money'];
+
switch($main_type){
case 'member':
diff --git a/niucloud/app/service/core/schedule/CoreCronService.php b/niucloud/app/service/core/schedule/CoreCronService.php
deleted file mode 100644
index acdf91505..000000000
--- a/niucloud/app/service/core/schedule/CoreCronService.php
+++ /dev/null
@@ -1,203 +0,0 @@
-model = new SysCronTask();
- }
-
- public function add(int $site_id, array $data){
- $data['site_id'] = $site_id;
- return $this->model->create($data);
- }
-
- public function find(int $site_id, int $id){
- $where = array(
- ['site_id', '=', $site_id],
- ['id', '=', $id]
- );
- $cron = $this->model->where($where)->findOrEmpty();
- return $cron;
- }
-
- /**
- * 更新
- * @param $site_id
- * @param $id
- * @param $data
- * @return SysCronTask
- */
- public function edit(int $site_id, int $id, array $data){
- $where = array(
- ['site_id', '=', $site_id],
- ['id', '=', $id]
- );
- return $this->model->where($where)->update($data);
- }
-
- public function del(int $site_id, int $id){
-
- }
-
- /**
- * 发布计划任务
- * @return true
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public static function execute(){
- $now = time();
-// $between = $now + 60;
- //查询未执行的任务
- $where = array(
- ['status', '=', 1],
-// ['next_time', '<', $between]
- );
- $list = self::$model->where($where)->select()->toArray();
- if(!empty($list)){
-// $job_handler_classname = 'app\job\sys\Cronexecute';
- foreach($list as $k => $v){
- $next_time = $v['next_time'];
- if($next_time < $now){
-
-// create_job($job_handler_classname, $v ?? []);
- }else{
-// create_job($job_handler_classname, $v ?? [], $next_time - time());
- }
- }
- }
- return true;
- }
-
- /**
- * 任务后续操作 根据任务的周期来计算下一次的任务
- * @param $data
- * @return void
- */
- public function after(array $data){
- $type = $data['cron'];
- $id = $data['id'];
- $site_id = $data['site_id'];
- $now = time();
- $next_time = $data['next_time'];
- $update_data = array(
- 'last_time' => $next_time,
- 'update_time' => $now
- );
-
- //查询任务
- if($type == 'crond'){
-
- $crond_length = $data['crond_length'];
- //计算下次执行的时间
- switch ( $data[ 'crond_type' ] ) {
- case 'minute'://分
-
- $execute_time = $next_time + $crond_length * 60;
- break;
- case 1://天
-
- $execute_time = strtotime('+' . $crond_length . 'day', $next_time);
- break;
- case 2://周
-
- $execute_time = strtotime('+' . $crond_length . 'week', $next_time);
- break;
- case 3://月
-
- $execute_time = strtotime('+' . $crond_length . 'month', $next_time);
- break;
- }
- $update_data['next_time'] = $execute_time;
- }else{
- $update_data['delete_time'] = $now;
- }
- $this->edit($site_id, $id, $update_data);
- }
-
-
- /**
- * 消息队列
- * @param $data
- * @return false|float|int
- */
- public function getNextTime($data){
- $crond_length = $data['crond_length'];
- $next_time = $data['next_time'];
- $now = time();
- if($now > $next_time){
- $next_time = $now;
- }
- //计算下次执行的时间
- switch ( $data[ 'crond_type' ] ) {
- case 'minute'://分
- $execute_time = $next_time + $crond_length * 60;
- break;
- case 1://天
-
- $execute_time = strtotime('+' . $crond_length . 'day', $next_time);
- break;
- case 2://周
-
- $execute_time = strtotime('+' . $crond_length . 'week', $next_time);
- break;
- case 3://月
-
- $execute_time = strtotime('+' . $crond_length . 'month', $next_time);
- break;
- }
- return $execute_time;
- }
- /**
- * 获取自动任务列表
- * @param array $where
- * @return mixed
- */
- public function getPage(int $site_id, array $where)
- {
- $field = 'id, title, count, type, crond_type, crond_length, data, status_desc, last_time, next_time, create_time, delete_time, update_time, sort';
- $order = 'last_time desc';
- $search_model = $this->model->where('site_id', $site_id)->withSearch(['last_time', 'type', 'title'], $where)->field($field)->order($order)->append(['type_name', 'crond_type_name']);
- $list = $this->pageQuery($search_model);
- return $list;
- }
-
- /**
- * 任务详情
- * @param int $id
- * @return array
- */
- public function getInfo(int $site_id, int $id){
- $where = array(
- ['id', '=', $id],
- ['site_id', '=', $site_id]
- );
- $field = 'title, count, type, crond_type, crond_length, data, status_desc, last_time, next_time, create_time, delete_time, update_time, sort';
- $info = $this->model->where($where)->field($field)->findOrEmpty()->append(['type_name', 'crond_type_name'])->toArray();
- return $info;
- }
-}
\ No newline at end of file
diff --git a/niucloud/app/service/core/schedule/CoreScheduleInstallService.php b/niucloud/app/service/core/schedule/CoreScheduleInstallService.php
new file mode 100644
index 000000000..a4a73dfff
--- /dev/null
+++ b/niucloud/app/service/core/schedule/CoreScheduleInstallService.php
@@ -0,0 +1,85 @@
+model = new SysSchedule();
+
+ }
+
+ /**
+ * 安装系统内置计划任务
+ * @return true
+ */
+ public function installSystemSchedule(){
+ //安装系统计划任务
+ $list = (new CoreScheduleService())->getTemplateList('system');
+ $this->install($list);
+ return true;
+ }
+
+ /**
+ * 安装插件计划任务
+ * @param string $addon
+ * @return true
+ */
+ public function installAddonSchedule(string $addon){
+ //安装系统计划任务
+ $list = (new CoreScheduleService())->getTemplateList($addon);
+ $this->install($list, $addon);
+ return true;
+ }
+
+ /**
+ * 卸载插件的计划任务
+ * @param string $addon
+ * @return true
+ */
+ public function uninstallAddonSchedule(string $addon){
+ //安装系统计划任务
+ $this->model->where([['addon', '=', $addon]])->delete();
+ return true;
+ }
+ /**
+ * 安装计划任务
+ * @param array $data
+ * @param string $addon
+ * @return true
+ */
+ public function install(array $data, string $addon = ''){
+ $schedule_list = [];
+ foreach($data as $v){
+ $schedule_list[] = array(
+ 'key' => $v['key'],
+ 'status' => ScheduleDict::ON,
+ 'time' => $v['time'],
+ 'addon' => $addon
+ );
+ }
+ $this->model->replace()->insertAll($schedule_list);
+ return true;
+ }
+
+
+}
\ No newline at end of file
diff --git a/niucloud/app/service/core/schedule/CoreScheduleService.php b/niucloud/app/service/core/schedule/CoreScheduleService.php
index 7ae3512fc..10fffba50 100644
--- a/niucloud/app/service/core/schedule/CoreScheduleService.php
+++ b/niucloud/app/service/core/schedule/CoreScheduleService.php
@@ -11,23 +11,25 @@
namespace app\service\core\schedule;
-use app\model\sys\SysCronTask;
+use app\dict\sys\DateDict;
+use app\model\sys\SysSchedule;
use core\base\BaseCoreService;
use core\dict\DictLoader;
+use core\exception\CommonException;
+use think\Container;
+use think\facade\Log;
+use think\helper\Str;
/**
* 计划任务服务层
- * Class CoreCronService
- * @package app\service\core\cron
*/
class CoreScheduleService extends BaseCoreService
{
- CONST CROND_LENGTH = 60;
public function __construct()
{
parent::__construct();
- $this->model = new SysCronTask();
+ $this->model = new SysSchedule();
}
@@ -36,12 +38,169 @@ class CoreScheduleService extends BaseCoreService
* @param array $where
* @return mixed
*/
- public function getList()
+ public function getList(array $where = [])
{
- $addon_load = new DictLoader('Schedule');
- $list = $addon_load->load([]);
+ $field = 'id, addon, key, status, time, count, last_time, next_time, create_time, delete_time, update_time';
+ $list = $this->model->withSearch(['key','status'],$where)->field($field)->order('id desc')->append(['status_name'])->select()->toArray();
+ $template_list = array_column($this->getTemplateList(), null, 'key');
+ foreach($list as &$item){
+ $item = array_merge($template_list[$item['key']], $item);
+ }
return $list;
}
+ /**
+ * 任务分页列表
+ * @param array $where
+ * @return mixed
+ */
+ public function getPage(array $where = [])
+ {
+ $field = 'id, addon, key, status, time, count, last_time, next_time, create_time, delete_time, update_time';
+ $search_model = $this->model->withSearch(['key','status'],$where)->field($field)->order('id desc')->append(['status_name']);
+ $template_list = array_column($this->getTemplateList(), null, 'key');
+ return $this->pageQuery($search_model, function ($item, $key) use($template_list){
+ $item['crontab_content'] = $this->getCrontabContent($item['time']);
+ foreach($template_list[$item['key']] as $k => $v){
+ if($k != 'time'){
+ $item->$k = $v;
+ }
+ }
+ });
+ }
+ /**
+ * 获取信息
+ * @param int $id
+ */
+ public function getInfo(int $id)
+ {
+ $field = 'id, addon, key, status, time, count, last_time, next_time, create_time, delete_time, update_time';
+ $info = $this->model->where([['id', '=', $id]])->field($field)->append(['status_name'])->findOrEmpty()->toArray();
+ if(!empty($info)){
+ $template_list = array_column($this->getTemplateList(), null, 'key');
+ $info = array_merge($template_list[$info['key']], $info);
+ }
+ return $info;
+ }
+
+ /**
+ * 计划任务模板
+ * @return array|null
+ */
+ public function getTemplateList(string $addon = ''){
+ $addon_load = new DictLoader('Schedule');
+ return $addon_load->load([
+ 'addon' => $addon
+ ]);
+ }
+ /**
+ * 计划任务的时间间隔
+ * @param $data
+ * @return string
+ */
+ protected function getCrontabContent($data): string
+ {
+ $content = '';
+ switch ($data['type']) {
+ case 'min':// 每隔几分
+ $content = '每隔'.$data['min'].'分钟执行一次';
+ break;
+ case 'hour':// 每隔几时第几分钟执行
+ $content = '每隔'.$data['hour'].'小时的'.$data['min'].'分执行一次';
+ break;
+ case 'day':// 每隔几日几时几分几秒执行
+ $content = '每隔'.$data['day'].'天的'.$data['hour'].'时'.$data['min'].'分执行一次';
+ break;
+ case 'week':// 每周一次,周几具体时间执行
+ $week_day = DateDict::getWeek()[$data['week']] ?? '';
+ $content = '每周的'.$week_day.'的'.$data['hour'].'时'.$data['min'].'分执行一次';
+ break;
+ case 'month':// 每月一次,某日具体时间执行
+ $content = '每月的'.$data['day'].'号的'.$data['hour'].'时'.$data['min'].'分执行一次';
+ break;
+ }
+ return $content;
+ }
+
+ /**
+ * 查询对象实例
+ * @param int $id
+ * @return SysSchedule|array|mixed|\think\Model
+ */
+ public function find(int $id){
+ return $this->model->findOrEmpty($id);
+ }
+
+ /**
+ * 设置状态(启用和关闭)
+ * @param int $id
+ * @param $status
+ * @return true
+ */
+ public function modifyStatus(int $id, $status){
+ $schedule = $this->find($id);
+ if($schedule->isEmpty()) throw new CommonException();
+ $schedule->save([
+ 'status' => $status
+ ]);
+ return true;
+ }
+
+
+ /**
+ * 添加任务
+ * @param array $data
+ */
+ public function add(array $data)
+ {
+ $data[ 'create_time' ] = time();
+ $this->model->create($data);
+ return true;
+
+ }
+
+ /**
+ * 任务编辑
+ * @param int $id
+ * @param array $data
+ */
+ public function edit(int $id, array $data)
+ {
+ $data[ 'update_time' ] = time();
+ $this->model->where([ [ 'id', '=', $id ]])->update($data);
+ return true;
+ }
+
+ /**
+ * 删除任务
+ * @param int $id
+ */
+ public function del(int $id)
+ {
+ return $this->model->where([ [ 'id', '=', $id ]])->delete();
+ }
+
+ /**
+ * 执行任务
+ * @param array $schedule
+ * @return true
+ */
+ public function execute(array $schedule){
+ $class = $schedule['class'] ?: 'app\\job\\schedule\\'.Str::studly($schedule['key']);
+ $function = $schedule['function'] ?: 'doJob';
+ try {
+ $result = Container::getInstance()->invoke([$class, $function ?? 'doJob']);
+ }catch(\Throwable $e){
+ Log::write('计划任务:'.$schedule['name'].'发生错误, 错误原因:'.$e->getMessage());
+ }
+ $schedule = $this->find($schedule['id']);
+ if(!$schedule->isEmpty()){
+ $schedule->save([
+ 'last_time' => time(),
+ 'count' => $schedule['count'] + 1,
+ ]);
+ }
+ return true;
+ }
}
\ No newline at end of file
diff --git a/niucloud/app/service/core/site/CoreSiteAccountService.php b/niucloud/app/service/core/site/CoreSiteAccountService.php
new file mode 100644
index 000000000..aa1b2bb78
--- /dev/null
+++ b/niucloud/app/service/core/site/CoreSiteAccountService.php
@@ -0,0 +1,86 @@
+where([['out_trade_no', '=', $pay_info['out_trade_no']], ['site_id', '=', $pay_info['site_id']]])->findOrEmpty()->toArray();
+ $data = [
+ 'site_id' => $pay_info['site_id'],
+ 'type' => 'pay',
+ 'money' => $pay_info['money'],
+ 'trade_no' => $pay_info['out_trade_no'],
+ ];
+ $res = (new SiteAccountLog())->create($data);
+ return $res->id;
+ }
+
+ /**
+ * 添加退款账单记录
+ * @param string $refund_no
+ * @return mixed
+ */
+ public function addRefundLog(int $site_id, string $refund_no)
+ {
+ $refund_info = (new Refund())->where([['refund_no', '=', $refund_no], ['site_id', '=', $site_id]])->findOrEmpty()->toArray();
+ $data = [
+ 'site_id' => $refund_info['site_id'],
+ 'type' => 'refund',
+ 'money' => $refund_info['money'] *(-1),
+ 'trade_no' => $refund_info['refund_no'],
+ ];
+ $res = (new SiteAccountLog())->create($data);
+ return $res->id;
+ }
+
+ /**
+ * 添加转账账单记录
+ * @param string $refund_no
+ * @return mixed
+ */
+ public function addTransferLog(int $site_id, string $transfer_no)
+ {
+ $transfer_info = (new Transfer())->where([['transfer_no', '=', $transfer_no], ['site_id', '=', $site_id]])->findOrEmpty()->toArray();
+ $data = [
+ 'site_id' => $transfer_info['site_id'],
+ 'type' => 'transfer',
+ 'money' => $transfer_info['money'] *(-1),
+ 'trade_no' => $transfer_info['transfer_no'],
+ ];
+ $res = (new SiteAccountLog())->create($data);
+ return $res->id;
+ }
+
+}
\ No newline at end of file
diff --git a/niucloud/app/service/core/site/CoreSiteService.php b/niucloud/app/service/core/site/CoreSiteService.php
index 3f09e4ec3..c0d88a185 100644
--- a/niucloud/app/service/core/site/CoreSiteService.php
+++ b/niucloud/app/service/core/site/CoreSiteService.php
@@ -24,66 +24,69 @@ use core\exception\CommonException;
class CoreSiteService extends BaseCoreService
{
public static $cache_tag_name = 'site_cash';
+
public function __construct()
{
parent::__construct();
$this->model = new Site();
}
-
-
/**
* 获取授权当前站点信息(用做缓存)
- * @return mixed
+ * @param $site_id
+ * @return mixed|string
*/
- public function getSiteCache(int $site_id){
+ public function getSiteCache($site_id)
+ {
$cache_name = 'site_info_cache';
return cache_remember(
- $cache_name.$site_id,
- function () use ($site_id) {
+ $cache_name . $site_id,
+ function() use ($site_id) {
$where = [
- ['site_id', '=', $site_id],
+ [ 'site_id', '=', $site_id ],
];
- $site = $this->model->where($where)->field('app_type,site_name,logo,front_end_name,front_end_logo,group_id, status, expire_time')->findOrEmpty();
- if(!$site->isEmpty()){
- $site->append(['status_name']);
- }
+ $site = $this->model->where($where)->field('site_id, app_type,site_name,logo,front_end_name,front_end_logo,group_id, status, expire_time, site_code')->append([ 'status_name' ])->findOrEmpty();
return $site->toArray();
},
- self::$cache_tag_name.$site_id
+ self::$cache_tag_name . $site_id
);
}
/**
* 模型实例
- * @param int $site_id
+ * @param $site_id
* @return Site|array|mixed|\think\Model
*/
- public function find(int $site_id){
+ public function find($site_id)
+ {
return $this->model->findOrEmpty($site_id);
}
+
/**
* 获取过期的站点
* @return void
*/
- public function getExpireSiteList(){
+ public function getExpireSiteList()
+ {
return $this->model->where([
- ['status', '<>', SiteDict::EXPIRE],
- ['expire_time', 'between', [1,time()]],
+ [ 'status', '<>', SiteDict::EXPIRE ],
+ [ 'expire_time', 'between', [ 1, time() ] ],
])->field('site_id,status,site_name')->select()->toArray();
}
+
/**
* 站点到期(计划任务专用,切勿调用)
- * @param int $site_id
- * @return void
+ * @param $site_id
+ * @return bool
*/
- public function expire(int $site_id){
+ public function expire(int $site_id)
+ {
$site = $this->find($site_id);
- if($site->isEmpty())throw new CommonException('SITE_NOT_EXIST');
- if($site->status == SiteDict::EXPIRE) throw new CommonException('SITE_EXPIRE');
- $this->model->where([[
+ if ($site->isEmpty()) throw new CommonException('SITE_NOT_EXIST');
+ if ($site->status == SiteDict::EXPIRE) throw new CommonException('SITE_EXPIRE');
+ $this->model->where([ [
'site_id', '=', $site_id
- ]])->update(
+ ] ])->update(
[
'status' => SiteDict::EXPIRE,
]
@@ -91,4 +94,26 @@ class CoreSiteService extends BaseCoreService
return true;
}
+ /**
+ * 通过站点编号获取站点信息
+ * @param $site_code
+ * @return mixed|string
+ */
+ public function getSiteInfoBySiteCode($site_code){
+ $cache_name = 'site_id_cache';
+ return cache_remember(
+ $cache_name . $site_code,
+ function() use ($site_code) {
+ $site_info = $this->model->where([[
+ 'site_code', '=', $site_code
+ ]])->findOrEmpty();
+ if(!$site_info->isEmpty()){
+ return $site_info->toArray();
+ }
+ return [];
+ }
+ );
+
+ }
+
}
\ No newline at end of file
diff --git a/niucloud/app/service/core/sys/CoreAgreementService.php b/niucloud/app/service/core/sys/CoreAgreementService.php
index 7a440fbd2..64ed16c21 100644
--- a/niucloud/app/service/core/sys/CoreAgreementService.php
+++ b/niucloud/app/service/core/sys/CoreAgreementService.php
@@ -65,8 +65,7 @@ class CoreAgreementService extends BaseCoreService
['agreement_key', '=', $key],
['site_id', '=', $site_id]
);
- $agreement = $this->model->where($where)->findOrEmpty();
- return $agreement;
+ return $this->model->where($where)->findOrEmpty();
}
/**
* 设置协议
diff --git a/niucloud/app/service/core/sys/CoreAreaService.php b/niucloud/app/service/core/sys/CoreAreaService.php
index 4dc5f75da..b08b73833 100644
--- a/niucloud/app/service/core/sys/CoreAreaService.php
+++ b/niucloud/app/service/core/sys/CoreAreaService.php
@@ -41,8 +41,7 @@ class CoreAreaService extends BaseCoreService
*/
public function getInfo($id)
{
- $info = $this->model->where('id', $id)->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->find()->toArray();
- return $info;
+ return $this->model->where('id', $id)->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->find()->toArray();
}
/**
@@ -55,8 +54,7 @@ class CoreAreaService extends BaseCoreService
*/
public function getListByPid(int $pid)
{
- $list = $this->model->where('pid', $pid)->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->select()->toArray();
- return $list;
+ return $this->model->where('pid', $pid)->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->select()->toArray();
}
/**
@@ -70,7 +68,21 @@ class CoreAreaService extends BaseCoreService
public function getTree(int $level = 3)
{
$list = $this->model->where('level', '<=', $level)->field('id, pid, name, shortname, longitude, latitude, level, sort, status')->select()->toArray();
- $tree = list_to_tree($list, 'id', 'pid', 'child', 0);
- return $tree;
+ return list_to_tree($list, 'id', 'pid', 'child', 0);
+ }
+ /**
+ * 通过对应省市区县,地址,返回完整地址
+ * @param $province_id
+ * @param $city_id
+ * @param $district_id
+ * @param $address
+ * @param string $tag 分隔符
+ */
+ public function getFullAddress($province_id, $city_id, $district_id, $address, $tag = ' ')
+ {
+ $province_name = ($this->model->where([['id', '=', $province_id]])->field("name")->findOrEmpty()->toArray())['name'] ?? '';
+ $city_name = ($this->model->where([['id', '=', $city_id]])->field("name")->findOrEmpty()->toArray())['name'] ?? '';
+ $district_name = ($this->model->where([['id', '=', $district_id]])->field("name")->findOrEmpty()->toArray())['name'] ?? '';
+ return $province_name.$tag.$city_name.$tag. $district_name. $tag. $address;
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/core/sys/CoreAttachmentService.php b/niucloud/app/service/core/sys/CoreAttachmentService.php
index 47279aee8..f7fc2e69b 100644
--- a/niucloud/app/service/core/sys/CoreAttachmentService.php
+++ b/niucloud/app/service/core/sys/CoreAttachmentService.php
@@ -90,8 +90,7 @@ class CoreAttachmentService extends BaseCoreService
['site_id', '=', $site_id],
['att_id', '=', $att_id]
);
- $res = $this->model->update($data, $where);
- return $res;
+ return $this->model->update($data, $where);
}
/**
@@ -102,8 +101,7 @@ class CoreAttachmentService extends BaseCoreService
public function del(int $site_id, int $att_id){
//查询是否有下级菜单或按钮
$menu = $this->find($site_id, $att_id);
- $res = $menu->delete();
- return $res;
+ return $menu->delete();
}
diff --git a/niucloud/app/service/core/sys/CoreConfigService.php b/niucloud/app/service/core/sys/CoreConfigService.php
index 8d27ebbc9..c831b37bb 100644
--- a/niucloud/app/service/core/sys/CoreConfigService.php
+++ b/niucloud/app/service/core/sys/CoreConfigService.php
@@ -38,8 +38,7 @@ class CoreConfigService extends BaseCoreService
['config_key', '=', $key],
['site_id', '=', $site_id]
);
- $info = $this->model->where($where)->field('id,site_id,config_key,value,status,create_time,update_time')->findOrEmpty()->toArray();
- return $info;
+ return $this->model->where($where)->field('id,site_id,config_key,value,status,create_time,update_time')->findOrEmpty()->toArray();
}
/**
@@ -86,7 +85,6 @@ class CoreConfigService extends BaseCoreService
$data = array(
'status' => $status,
);
- $res = $this->model->where($where)->save($data);
- return $res;
+ return $this->model->where($where)->save($data);
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/core/sys/CoreSysConfigService.php b/niucloud/app/service/core/sys/CoreSysConfigService.php
index e1c2dc93e..220fcc9d5 100644
--- a/niucloud/app/service/core/sys/CoreSysConfigService.php
+++ b/niucloud/app/service/core/sys/CoreSysConfigService.php
@@ -11,6 +11,7 @@
namespace app\service\core\sys;
+use app\model\site\Site;
use core\base\BaseCoreService;
/**
@@ -32,17 +33,15 @@ class CoreSysConfigService extends BaseCoreService
* @return array
*/
public function getSceneDomain(int $site_id){
- //todo 如果是默认站点
- $domain = env('system.wap_domain') ?: $this->request->domain();
- $wap_domain = $domain.'/wap';
- $web_domain = $domain.'/web';
- if($site_id != $this->request->defaultSiteId()){
- $wap_domain = $wap_domain.'/'.$site_id.'/' ;
- $web_domain = $web_domain.'/'.$site_id.'/' ;
- }
- return [
- 'wap_domain' => $wap_domain,
- 'web_domain' => $web_domain,
+ $site = Site::find($site_id);
+ $site_tag = $site[ 'site_code' ];
+
+ $wap_domain = !empty(env("system.wap_domain")) ? preg_replace('#/$#', '', env("system.wap_domain")) : request()->domain();
+ $web_domain = !empty(env("system.web_domain")) ? preg_replace('#/$#', '', env("system.web_domain")) : request()->domain();
+
+ return [
+ 'wap_url' => $wap_domain . "/wap/" . $site_tag . "/",
+ 'web_url' => $web_domain . "/web/" . $site_tag . "/"
];
}
diff --git a/niucloud/app/service/core/upload/CoreImageService.php b/niucloud/app/service/core/upload/CoreImageService.php
index 35e8c0ef2..fb618eab4 100644
--- a/niucloud/app/service/core/upload/CoreImageService.php
+++ b/niucloud/app/service/core/upload/CoreImageService.php
@@ -51,8 +51,7 @@ class CoreImageService extends CoreFileService
}
//如果是网络图片,可以将网络图片拉取到本地
try {
- $thumb_list = $this->upload_driver->thumb($file_path, $thumb_type);
- return $thumb_list;
+ return $this->upload_driver->thumb($file_path, $thumb_type);
} catch (\Throwable $e) {
throw new UploadFileException($e->getMessage());
}
diff --git a/niucloud/app/service/core/weapp/CoreWeappConfigService.php b/niucloud/app/service/core/weapp/CoreWeappConfigService.php
index c7b47d05a..4c4c63d6f 100644
--- a/niucloud/app/service/core/weapp/CoreWeappConfigService.php
+++ b/niucloud/app/service/core/weapp/CoreWeappConfigService.php
@@ -31,7 +31,7 @@ class CoreWeappConfigService extends BaseCoreService
*/
public function getWeappConfig(int $site_id){
$info = (new CoreConfigService())->getConfig($site_id, ConfigKeyDict::WEAPP)['value'] ?? [];
- $config = [
+ return [
'weapp_name' => $info['weapp_name'] ?? '',//小程序名称
'weapp_original' => $info['weapp_original'] ?? '',//原始ID
'app_id' => $info['app_id'] ?? '',//AppID
@@ -41,7 +41,6 @@ class CoreWeappConfigService extends BaseCoreService
'encoding_aes_key' => $info['encoding_aes_key'] ?? '',
'encryption_type' => $info['encryption_type'] ?? 'not_encrypt',//加解密模式 not_encrypt 明文 compatible 兼容 safe 安全
];
- return $config;
}
/**
diff --git a/niucloud/app/service/core/weapp/CoreWeappService.php b/niucloud/app/service/core/weapp/CoreWeappService.php
index 0a3ef3796..cfc890135 100644
--- a/niucloud/app/service/core/weapp/CoreWeappService.php
+++ b/niucloud/app/service/core/weapp/CoreWeappService.php
@@ -79,8 +79,7 @@ class CoreWeappService extends BaseCoreService
// 'base_uri' => 'https://api.weixin.qq.com/', // 如果你在国外想要覆盖默认的 url 的时候才使用,根据不同的模块配置不同的 uri
],
);
- $app = Factory::miniProgram($config);
- return $app;
+ return Factory::miniProgram($config);
}
}
\ No newline at end of file
diff --git a/niucloud/app/service/core/wechat/CoreWechatConfigService.php b/niucloud/app/service/core/wechat/CoreWechatConfigService.php
index 1acb41b97..fa2f7b6b9 100644
--- a/niucloud/app/service/core/wechat/CoreWechatConfigService.php
+++ b/niucloud/app/service/core/wechat/CoreWechatConfigService.php
@@ -32,7 +32,7 @@ class CoreWechatConfigService extends BaseCoreService
*/
public function getWechatConfig(int $site_id){
$info = (new CoreConfigService())->getConfig($site_id, ConfigKeyDict::WECHAT)['value'] ?? [];
- $config = [
+ return [
'wechat_name' => $info['wechat_name'] ?? '',//公众号名称
'wechat_original' => $info['wechat_original'] ?? '',//原始ID
'app_id' => $info['app_id'] ?? '',//AppID
@@ -42,7 +42,6 @@ class CoreWechatConfigService extends BaseCoreService
'encoding_aes_key' => $info['encoding_aes_key'] ?? '',
'encryption_type' => $info['encryption_type'] ?? 'not_encrypt',//加解密模式 not_encrypt 明文 compatible 兼容 safe 安全
];
- return $config;
}
/**
diff --git a/niucloud/app/service/core/wechat/CoreWechatServeService.php b/niucloud/app/service/core/wechat/CoreWechatServeService.php
index 5132a2e49..19ffe8dea 100644
--- a/niucloud/app/service/core/wechat/CoreWechatServeService.php
+++ b/niucloud/app/service/core/wechat/CoreWechatServeService.php
@@ -92,7 +92,7 @@ class CoreWechatServeService extends BaseCoreService
// ...
});
$response = $app->server->serve();
- $response->send();
+ return $response->send();
}
public function jssdkConfig(int $site_id, string $url = '')
diff --git a/niucloud/app/validate/diy/Diy.php b/niucloud/app/validate/diy/Diy.php
index 6a61eacab..2f5411f27 100644
--- a/niucloud/app/validate/diy/Diy.php
+++ b/niucloud/app/validate/diy/Diy.php
@@ -24,7 +24,7 @@ class Diy extends \think\Validate
protected $rule = [
'title' => 'require',
'name' => 'require',
- 'type' => 'checkType',
+ 'type' => 'require',
'value' => 'require',
'is_default' => 'number|between:0,1',
];
@@ -36,16 +36,4 @@ class Diy extends \think\Validate
"edit" => [ 'title', 'name', 'value', 'is_default' ],
];
- /**
- * 自定义验证 性别
- * @param $value
- * @param $rule
- * @param array $data
- * @return bool|string
- */
- protected function checkType($value, $rule, $data = [])
- {
- return isset(TemplateDict::getTemplate()[ $value ]) ? true : get_lang("validate_diy.type_not_exist");
- }
-
}
\ No newline at end of file
diff --git a/niucloud/app/validate/message/AliSms.php b/niucloud/app/validate/message/AliSms.php
deleted file mode 100644
index 4e8400bb4..000000000
--- a/niucloud/app/validate/message/AliSms.php
+++ /dev/null
@@ -1,42 +0,0 @@
- 'require',
- 'menu_key' => 'unique:sys_menu',//防止key值重复
- 'menu_type' => 'require|checkMenuType',
- 'methods' => 'requireWith:api_url|checkMethodType',
- 'router_path' => 'requireIf:menu_type,0|requireIf:menu_type,1',
- 'view_path' => 'requireIf:menu_type,1'
-
- ];
-
- protected $message = [
- 'menu_name.require' => 'validate_menu.menu_name_require',
- 'router_path.requireIf' => 'validate_menu.router_path_requireif',
- 'view_path.requireIf' => 'validate_menu.view_path_requireif',
-
- 'methods.requireWith' => 'validate_menu.methods_requirewith',
- ];
-
-}
\ No newline at end of file
diff --git a/niucloud/composer.json b/niucloud/composer.json
index 826f68d2b..23a88fa9c 100644
--- a/niucloud/composer.json
+++ b/niucloud/composer.json
@@ -49,7 +49,8 @@
"yansongda/pay": "v3.2.14",
"symfony/psr-http-message-bridge": "v2.2.0",
"fastknife/ajcaptcha": "v1.2.1",
- "yzh52521/schedule": "^1.0"
+ "kosinix/grafika": "dev-master",
+ "yunwuxin/think-cron": "v3.0.5"
},
"require-dev": {
"symfony/var-dumper": "v4.4.47",
diff --git a/niucloud/composer.lock b/niucloud/composer.lock
index d8ca58f4e..f75149476 100644
--- a/niucloud/composer.lock
+++ b/niucloud/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": "c28d105402847e957afdd94104f190aa",
+ "content-hash": "f7b6e94eac121eb357defdcb7669d03e",
"packages": [
{
"name": "adbario/php-dot-notation",
@@ -1296,6 +1296,58 @@
],
"time": "2022-05-21T17:30:32+00:00"
},
+ {
+ "name": "kosinix/grafika",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/kosinix/grafika.git",
+ "reference": "211f61fc334b8b36616b23e8af7c5727971d96ee"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/kosinix/grafika/zipball/211f61fc334b8b36616b23e8af7c5727971d96ee",
+ "reference": "211f61fc334b8b36616b23e8af7c5727971d96ee",
+ "shasum": "",
+ "mirrors": [
+ {
+ "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+ "preferred": true
+ }
+ ]
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "default-branch": true,
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Grafika\\": "src/Grafika"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT",
+ "GPL-2.0+"
+ ],
+ "authors": [
+ {
+ "name": "Nico Amarilla",
+ "homepage": "https://www.kosinix.com"
+ }
+ ],
+ "description": "An image manipulation library for PHP.",
+ "homepage": "http://kosinix.github.io/grafika",
+ "keywords": [
+ "grafika"
+ ],
+ "support": {
+ "issues": "https://github.com/kosinix/grafika/issues",
+ "source": "https://github.com/kosinix/grafika/tree/2.0.8"
+ },
+ "time": "2017-06-20T03:13:49+00:00"
+ },
{
"name": "laravel/serializable-closure",
"version": "v1.2.2",
@@ -5258,17 +5310,17 @@
"time": "2022-03-28T10:25:04+00:00"
},
{
- "name": "yzh52521/schedule",
- "version": "v1.0.0",
+ "name": "yunwuxin/think-cron",
+ "version": "v3.0.5",
"source": {
"type": "git",
- "url": "https://github.com/yzh52521/schedule.git",
- "reference": "4c8f537f0c08417e785f84b8b91bf16b083cb163"
+ "url": "https://github.com/yunwuxin/think-cron.git",
+ "reference": "a5e5c679b7f5daedab9fb4bb00b641b6c4a054ca"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/yzh52521/schedule/zipball/4c8f537f0c08417e785f84b8b91bf16b083cb163",
- "reference": "4c8f537f0c08417e785f84b8b91bf16b083cb163",
+ "url": "https://api.github.com/repos/yunwuxin/think-cron/zipball/a5e5c679b7f5daedab9fb4bb00b641b6c4a054ca",
+ "reference": "a5e5c679b7f5daedab9fb4bb00b641b6c4a054ca",
"shasum": "",
"mirrors": [
{
@@ -5278,33 +5330,46 @@
]
},
"require": {
- "nesbot/carbon": "^2.0",
- "php": ">=7.1"
+ "dragonmantank/cron-expression": "^3.0",
+ "nesbot/carbon": "^2.28",
+ "symfony/process": "^4.4|^5.0",
+ "topthink/framework": "^6.0"
+ },
+ "require-dev": {
+ "topthink/think-swoole": "^4.0"
},
"type": "library",
+ "extra": {
+ "think": {
+ "config": {
+ "cron": "src/config.php"
+ },
+ "services": [
+ "yunwuxin\\cron\\Service"
+ ]
+ }
+ },
"autoload": {
"psr-4": {
- "schedule\\": "src/"
+ "yunwuxin\\cron\\": "src/cron"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "Apache-2.0"
],
- "description": "task schedule,schedule,thinkphp schedule,任务调度",
- "keywords": [
- "schedule",
- "task schedule",
- "think-schedule",
- "thinkphp",
- "thinkphp5.1",
- "thinkphp6"
+ "authors": [
+ {
+ "name": "yunwuxin",
+ "email": "448901948@qq.com"
+ }
],
+ "description": "计划任务",
"support": {
- "issues": "https://github.com/yzh52521/schedule/issues",
- "source": "https://github.com/yzh52521/schedule/tree/v1.0.0"
+ "issues": "https://github.com/yunwuxin/think-cron/issues",
+ "source": "https://github.com/yunwuxin/think-cron/tree/v3.0.5"
},
- "time": "2020-07-02T01:34:32+00:00"
+ "time": "2021-12-22T09:25:54+00:00"
}
],
"packages-dev": [
@@ -5545,7 +5610,9 @@
],
"aliases": [],
"minimum-stability": "stable",
- "stability-flags": [],
+ "stability-flags": {
+ "kosinix/grafika": 20
+ },
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
diff --git a/niucloud/config/console.php b/niucloud/config/console.php
index a2794549e..b408a7c17 100644
--- a/niucloud/config/console.php
+++ b/niucloud/config/console.php
@@ -11,6 +11,5 @@ return [
'queue:listen' => 'think\queue\command\Listen',
'addon:install' => 'app\command\Addon\Install',
'addon:uninstall' => 'app\command\Addon\Uninstall',
- 'schedule:run'=> 'app\command\Schedule',
],
];
diff --git a/niucloud/config/cron.php b/niucloud/config/cron.php
deleted file mode 100644
index bb6c59b8a..000000000
--- a/niucloud/config/cron.php
+++ /dev/null
@@ -1,9 +0,0 @@
- [
- CronTask::class, //任务的完整类名
- ]
-];
\ No newline at end of file
diff --git a/niucloud/config/pay.php b/niucloud/config/pay.php
index c3aba6c7c..8b76e26e1 100644
--- a/niucloud/config/pay.php
+++ b/niucloud/config/pay.php
@@ -19,8 +19,8 @@ return [
//支付宝
'alipay' => [],
//余额
-// 'balance' => [
-// 'driver' => 'app\service\core\paytype\CoreBalanceService', //反射类的名字
-// ],
+ 'balancepay' => [
+ 'driver' => 'app\service\core\paytype\CoreBalanceService', //反射类的名字
+ ],
]
];
diff --git a/niucloud/core/dict/BaseDict.php b/niucloud/core/dict/BaseDict.php
index 7d2eb02e0..2c14d9ec3 100644
--- a/niucloud/core/dict/BaseDict.php
+++ b/niucloud/core/dict/BaseDict.php
@@ -93,7 +93,7 @@ abstract class BaseDict extends Storage
*/
protected function getDictPath()
{
- return root_path(). "app". DIRECTORY_SEPARATOR. "dict". DIRECTORY_SEPARATOR;;
+ return root_path(). 'app'. DIRECTORY_SEPARATOR. 'dict'. DIRECTORY_SEPARATOR;
}
/**
@@ -102,7 +102,7 @@ abstract class BaseDict extends Storage
*/
protected function getAddonDictPath(string $addon)
{
- return $this->getAddonPath($addon). "app". DIRECTORY_SEPARATOR. "dict". DIRECTORY_SEPARATOR;
+ return $this->getAddonPath($addon). 'app'. DIRECTORY_SEPARATOR. 'dict'. DIRECTORY_SEPARATOR;
}
/**
@@ -111,7 +111,7 @@ abstract class BaseDict extends Storage
*/
protected function getAddonConfigPath(string $addon)
{
- return $this->getAddonPath($addon). "config". DIRECTORY_SEPARATOR;
+ return $this->getAddonPath($addon). 'config'. DIRECTORY_SEPARATOR;
}
/**
diff --git a/niucloud/core/dict/Schedule.php b/niucloud/core/dict/Schedule.php
index 76c896ada..0d03849fb 100644
--- a/niucloud/core/dict/Schedule.php
+++ b/niucloud/core/dict/Schedule.php
@@ -20,28 +20,49 @@ class Schedule extends BaseDict
*/
public function load(array $data = [])
{
+ $addon = $data['addon'] ?? '';
$schedule_files = [];
- $system_path = $this->getDictPath(). "schedule". DIRECTORY_SEPARATOR. "schedule.php";
- if(is_file($system_path))
+ if(empty($addon))
{
- $schedule_files[] = $system_path;
- }
- $addons = $this->getLocalAddons();
- foreach ($addons as $k => $v)
- {
- $addon_path = $this->getAddonDictPath($v). "schedule". DIRECTORY_SEPARATOR. "schedule.php";
- if(is_file($addon_path))
+ $system_path = $this->getDictPath(). 'schedule'. DIRECTORY_SEPARATOR. 'schedule.php';
+ if(is_file($system_path))
{
- $schedule_files[] = $addon_path;
+ $schedule_files[] = $system_path;
}
+ $addons = $this->getLocalAddons();
+ foreach ($addons as $k => $v)
+ {
+ $addon_path = $this->getAddonDictPath($v). 'schedule'. DIRECTORY_SEPARATOR. 'schedule.php';
+ if(is_file($addon_path))
+ {
+ $schedule_files[] = $addon_path;
+ }
+ }
+ }else{
+ $schedule_files = [];
+ if($addon == 'system'){
+ $schedule_files = [];
+ $system_path = $this->getDictPath(). 'schedule'. DIRECTORY_SEPARATOR. 'schedule.php';
+ if(is_file($system_path))
+ {
+ $schedule_files[] = $system_path;
+ }
+ }else{
+ $addon_path = $this->getAddonDictPath($addon). 'schedule'. DIRECTORY_SEPARATOR. 'schedule.php';
+ if(is_file($addon_path))
+ {
+ $schedule_files[] = $addon_path;
+ }
+ }
+
}
$schedule_files_data = $this->loadFiles($schedule_files);
-
$schedule_data_array = [];
foreach ($schedule_files_data as $file_data)
{
$schedule_data_array = empty($schedule_data_array) ? $file_data : array_merge($schedule_data_array, $file_data);
}
return $schedule_data_array;
+
}
}
\ No newline at end of file
diff --git a/niucloud/core/upload/Aliyun.php b/niucloud/core/upload/Aliyun.php
index e094fe93f..e46d04a41 100644
--- a/niucloud/core/upload/Aliyun.php
+++ b/niucloud/core/upload/Aliyun.php
@@ -24,8 +24,7 @@ class Aliyun extends BaseUpload
$access_key_secret = $this->config['secret_key'];
$endpoint = $this->config['endpoint'];// yourEndpoint填写Bucket所在地域对应的Endpoint。以华东1(杭州)为例,Endpoint填写为https://oss-cn-hangzhou.aliyuncs.com。
- $oss_client = new OssClient($access_key_id, $access_key_secret, $endpoint);
- return $oss_client;
+ return new OssClient($access_key_id, $access_key_secret, $endpoint);
}
/**
diff --git a/niucloud/core/util/Snowflake.php b/niucloud/core/util/Snowflake.php
new file mode 100644
index 000000000..c5f4cbe58
--- /dev/null
+++ b/niucloud/core/util/Snowflake.php
@@ -0,0 +1,86 @@
+ self::MAX_DATA_CENTER_ID || $data_center_id < 0) {
+// throw new Exception('Data center ID can not be greater than ' . self::MAX_DATA_CENTER_ID . ' or less than 0');
+// }
+//
+// if ($machine_id > self::MAX_MACHINE_ID || $machine_id < 0) {
+// throw new Exception('Machine ID can not be greater than ' . self::MAX_MACHINE_ID . ' or less than 0');
+// }
+
+ $this->data_center_id = $data_center_id;
+ $this->machine_id = $machine_id;
+ $this->last_timestamp = 0;
+ $this->sequence = 0;
+ }
+
+ public function generateId()
+ {
+ $timestamp = $this->getTimestamp();
+
+ // 当前时间小于上一次生成时间,发生时钟回拨
+ if ($timestamp < $this->last_timestamp) {
+ throw new Exception('Clock moved backwards.');
+ }
+
+ // 当前时间与上一次生成时间相同
+ if ($timestamp == $this->last_timestamp) {
+ $this->sequence = ($this->sequence + 1) & self::MAX_SEQUENCE;
+
+ // 当前毫秒的序列已经达到最大值,等待下一毫秒
+ if ($this->sequence == 0) {
+ $timestamp = $this->nextMillis($this->last_timestamp);
+ }
+ } else {
+ // 新的一毫秒,序列从0开始
+ $this->sequence = 0;
+ }
+
+ $this->last_timestamp = $timestamp;
+
+ $id = (($timestamp - self::START_EPOCH) << (self::SEQUENCE_BITS + self::MACHINE_ID_BITS + self::DATA_CENTER_ID_BITS))
+ | ($this->data_center_id << (self::SEQUENCE_BITS + self::MACHINE_ID_BITS))
+ | ($this->machine_id << self::SEQUENCE_BITS)
+ | $this->sequence;
+
+ return $id;
+ }
+
+ private function getTimestamp()
+ {
+ return floor(microtime(true) * 1000);
+ }
+
+ private function nextMillis($last_timestamp)
+ {
+ $timestamp = $this->getTimestamp();
+
+ while ($timestamp <= $last_timestamp) {
+ $timestamp = $this->getTimestamp();
+ }
+
+ return $timestamp;
+ }
+}
\ No newline at end of file
diff --git a/niucloud/public/.gitignore b/niucloud/public/.gitignore
index 8b0144799..f6301082f 100644
--- a/niucloud/public/.gitignore
+++ b/niucloud/public/.gitignore
@@ -1,4 +1,6 @@
/.htaccess
upload
nginx.htaccess
-.htaccess
\ No newline at end of file
+.htaccess
+admin
+wap
\ No newline at end of file
diff --git a/niucloud/public/static/resource/images/diy/template/default_index_cover.png b/niucloud/public/static/resource/images/diy/template/default_index_cover.png
new file mode 100644
index 0000000000000000000000000000000000000000..f7cb41093bb6ca74bb6ff687e19a79938efb13c2
GIT binary patch
literal 101486
zcmV(?K-a&CP)
z_V^JLeGwIa5f+0;NJs$;VLWdB0}W;d4r&e(dj}705g3OF5OE9qd
z`VkeP4iTLpA|t7C|1&Z%1PY7)c3lt^90CV~6dsCEP*4~eAMEY$FD)$^AuSXcoG2(N
z7aoNc9Vn!uqvq!37b2lOPqFdw^$!z)%gV|;wWxV_bq){|)YR17-Q6!CB?1R|rfvVO
zuCGVAt-->>Wn^V2FF!LmNFXOPIw~zfKS5Ewv2bv37%ZtHEvF9L{hDK{{#w}mX?+jURF^tFEm6@UJ@L17$uPXjsPVZ99qD&FEl@Xett+yRy#kF$I|5gtZ-UP
zM@m&{CVDWjqs7VLc5!Uo-|kdeWT9pM|7l75h5#EaiPhKZ
zJBg4ue~&y%TfV^FZ)ap2IAG1sKJMfm&(4
zPhfCBqmf{V|8<1Ul&}A_;@+jMxP_3N`=n+fRIzY;iieNQYjMDrp}@P3|7m;3xy%3m
z%e7c(d6ApgcA5YEVML#%*ZsbUf05cSVYhyTvig=O9vsK^-#00D_9Nklv(9N=}o=^`)lmZRPh->wYeODk8=)=5i?IP%>}T
zrHJR@mfNL2@}S-fmeYoTFg&xnlW9zAW_sqR_k&yCf!=fE&h!O%yv8euU($Lbg9A-}
zYB@3i1Nr>(Yo#(J4N2p)MQyc-`jNHyu_^VMHDP!K^5t9P^!3l%?>k}t`St?VE7*a%
z(w=zVPB&E|e}sk+tPd3)L|5Q5?NcKz>`*!^{|SrA7dsX$S8W?ysA9+zY+^yo>f)tL4zCa}e=7o<6a>GZ``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