From ad6298a9a9b88c40dc2a3689ba8fb44ec6880d67 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: Fri, 22 Nov 2024 15:08:42 +0800 Subject: [PATCH] up --- .../controller/addon/AddonDevelop.php | 72 +++--- .../app/adminapi/controller/addon/Upgrade.php | 30 ++- .../adminapi/controller/member/Account.php | 126 +++++----- .../app/adminapi/controller/member/Config.php | 1 + .../controller/member/MemberLevel.php | 12 - .../adminapi/controller/sys/ScheduleLog.php | 28 ++- .../app/adminapi/controller/wechat/Reply.php | 33 ++- .../adminapi/controller/wechat/Template.php | 5 +- niucloud/app/adminapi/route/member.php | 2 - niucloud/app/adminapi/route/sys.php | 4 + niucloud/app/api/controller/login/Config.php | 7 +- niucloud/app/api/controller/sys/Config.php | 10 +- niucloud/app/common.php | 15 ++ niucloud/app/dict/diy/ComponentDict.php | 186 ++++++++++++-- niucloud/app/dict/diy/PagesDict.php | 37 ++- niucloud/app/dict/pay/PayDict.php | 2 +- niucloud/app/install/source/database.sql | 4 +- niucloud/app/install/view/index/step-5.html | 4 +- niucloud/app/lang/en/validate.php | 2 + niucloud/app/lang/zh-cn/api.php | 1 + niucloud/app/lang/zh-cn/validate.php | 2 + .../listener/member/MemberLoginListener.php | 8 +- .../member/MemberRegisterListener.php | 8 +- .../MemberExportTypeListener.php | 2 +- .../system/BottomNavigationListener.php | 1 + niucloud/app/model/wechat/WechatReply.php | 1 - .../admin/generator/GenerateService.php | 4 +- .../admin/generator/core/BaseGenerator.php | 2 +- .../admin/generator/core/ServiceGenerator.php | 4 +- .../service/admin/pay/PayChannelService.php | 2 + .../admin/schedule/ScheduleLogService.php | 20 ++ .../service/admin/sys/AttachmentService.php | 20 +- .../admin/sys/PrinterTemplateService.php | 2 +- .../service/admin/upgrade/BackupService.php | 49 ++-- .../service/admin/upgrade/RestoreService.php | 6 +- .../service/admin/upgrade/UpgradeService.php | 2 +- .../api/member/MemberConfigService.php | 21 +- .../app/service/api/member/MemberService.php | 9 + .../service/api/member/MemberSignService.php | 51 ++-- niucloud/app/service/api/sys/AreaService.php | 48 +++- .../service/api/weapp/WeappAuthService.php | 2 +- .../service/api/wechat/WechatAuthService.php | 7 +- .../core/member/CoreMemberConfigService.php | 10 +- .../service/core/member/CoreMemberService.php | 18 +- .../core/paytype/CoreOfflineService.php | 1 + .../service/core/poster/CorePosterService.php | 15 +- .../core/schedule/CoreScheduleLogService.php | 30 +++ .../core/wechat/CoreWechatServeService.php | 11 +- niucloud/app/upgrade/v142/Upgrade.php | 230 ++++++++++++++++++ niucloud/app/validate/member/LoginConfig.php | 7 +- niucloud/config/version.php | 4 +- niucloud/core/base/BaseModel.php | 2 +- niucloud/core/pay/Wechatpay.php | 8 + 53 files changed, 914 insertions(+), 274 deletions(-) create mode 100644 niucloud/app/upgrade/v142/Upgrade.php diff --git a/niucloud/app/adminapi/controller/addon/AddonDevelop.php b/niucloud/app/adminapi/controller/addon/AddonDevelop.php index c10734b9f..135828738 100644 --- a/niucloud/app/adminapi/controller/addon/AddonDevelop.php +++ b/niucloud/app/adminapi/controller/addon/AddonDevelop.php @@ -25,16 +25,16 @@ class AddonDevelop extends BaseAdminController public function lists() { $data = $this->request->params([ - ['search', ''] + [ 'search', '' ] ]); - return success((new AddonDevelopService())->getList($data['search'])); + return success(( new AddonDevelopService() )->getList($data[ 'search' ])); } - public function info($key) { - return success((new AddonDevelopService())->getInfo($key)); + return success(( new AddonDevelopService() )->getInfo($key)); } + /** * 开发插件新增 * @return Response @@ -42,19 +42,19 @@ class AddonDevelop extends BaseAdminController public function add(string $key) { $data = $this->request->params([ - ['title', ''], - ['desc', ''], - ['icon', ''], - ['cover', ''], - ['key', ''], - ['author', ''], - ['version', ''], - ['type', ''], - ['support_app', ''], + [ 'title', '' ], + [ 'desc', '' ], + [ 'icon', '' ], + [ 'cover', '' ], + [ 'key', '' ], + [ 'author', '' ], + [ 'version', '' ], + [ 'type', '' ], + [ 'support_app', '' ], ], false); - $data['key'] = $key; + $data[ 'key' ] = $key; $this->validate($data, 'app\validate\addon\AddonDevelop.add'); - (new AddonDevelopService())->add($key, $data); + ( new AddonDevelopService() )->add($key, $data); return success('ADD_SUCCESS'); } @@ -66,19 +66,19 @@ class AddonDevelop extends BaseAdminController public function edit(string $key) { $data = $this->request->params([ - ['title', ''], - ['desc', ''], - ['icon', ''], - ['cover', ''], - ['key', ''], - ['author', ''], - ['version', ''], - ['type', ''], - ['support_app', ''], + [ 'title', '' ], + [ 'desc', '' ], + [ 'icon', '' ], + [ 'cover', '' ], + [ 'key', '' ], + [ 'author', '' ], + [ 'version', '' ], + [ 'type', '' ], + [ 'support_app', '' ], ], false); - $data['key'] = $key; + $data[ 'key' ] = $key; $this->validate($data, 'app\validate\addon\AddonDevelop.edit'); - (new AddonDevelopService())->edit($key, $data); + ( new AddonDevelopService() )->edit($key, $data); return success('EDIT_SUCCESS'); } @@ -90,7 +90,7 @@ class AddonDevelop extends BaseAdminController */ public function del(string $key) { - (new AddonDevelopService())->del($key); + ( new AddonDevelopService() )->del($key); return success('DELETE_SUCCESS'); } @@ -99,8 +99,9 @@ class AddonDevelop extends BaseAdminController * @param $key * @return void */ - public function checkKey($key){ - return success(data:(new AddonDevelopService())->checkKey($key)); + public function checkKey($key) + { + return success(data:( new AddonDevelopService() )->checkKey($key)); } /** @@ -108,8 +109,9 @@ class AddonDevelop extends BaseAdminController * @param $key * @return Response */ - public function build($key){ - (new AddonDevelopService())->build($key); + public function build($key) + { + ( new AddonDevelopService() )->build($key); return success(); } @@ -118,16 +120,18 @@ class AddonDevelop extends BaseAdminController * @param $key * @return Response */ - public function download($key){ + public function download($key) + { - return success(data:(new AddonDevelopService())->download($key)); + return success(data:( new AddonDevelopService() )->download($key)); } /** * * @return Response */ - public function keyBlackList() { + public function keyBlackList() + { return success(AddonDict::ADDON_KEY_BLACK_LIST); } } diff --git a/niucloud/app/adminapi/controller/addon/Upgrade.php b/niucloud/app/adminapi/controller/addon/Upgrade.php index 306e2c1e8..cadf62f55 100644 --- a/niucloud/app/adminapi/controller/addon/Upgrade.php +++ b/niucloud/app/adminapi/controller/addon/Upgrade.php @@ -22,8 +22,9 @@ class Upgrade extends BaseAdminController * @param $app_key * @return Response */ - public function upgrade($addon = ''){ - return success(data:(new UpgradeService())->upgrade($addon)); + public function upgrade($addon = '') + { + return success(data:( new UpgradeService() )->upgrade($addon)); } /** @@ -31,8 +32,9 @@ class Upgrade extends BaseAdminController * @param $app_key * @return Response */ - public function execute($addon = ''){ - return success(data:(new UpgradeService())->execute()); + public function execute($addon = '') + { + return success(data:( new UpgradeService() )->execute()); } /** @@ -40,16 +42,18 @@ class Upgrade extends BaseAdminController * @param $addon * @return Response */ - public function getUpgradeContent($addon = '') { - return success(data:(new UpgradeService())->getUpgradeContent($addon)); + public function getUpgradeContent($addon = '') + { + return success(data:( new UpgradeService() )->getUpgradeContent($addon)); } /** * 获取正在进行的升级任务 * @return Response */ - public function getUpgradeTask() { - return success(data:(new UpgradeService())->getUpgradeTask()); + public function getUpgradeTask() + { + return success(data:( new UpgradeService() )->getUpgradeTask()); } /** @@ -57,15 +61,17 @@ class Upgrade extends BaseAdminController * @param $addon * @return Response */ - public function upgradePreCheck($addon = '') { - return success(data:(new UpgradeService())->upgradePreCheck($addon)); + public function upgradePreCheck($addon = '') + { + return success(data:( new UpgradeService() )->upgradePreCheck($addon)); } /** * 清除 * @return Response */ - public function clearUpgradeTask() { - return success(data:(new UpgradeService())->clearUpgradeTask()); + public function clearUpgradeTask() + { + return success(data:( new UpgradeService() )->clearUpgradeTask()); } } diff --git a/niucloud/app/adminapi/controller/member/Account.php b/niucloud/app/adminapi/controller/member/Account.php index 306ce222d..6826e0fb4 100644 --- a/niucloud/app/adminapi/controller/member/Account.php +++ b/niucloud/app/adminapi/controller/member/Account.php @@ -26,13 +26,13 @@ class Account extends BaseAdminController public function point() { $data = $this->request->params([ - ['member_id', ''], - ['from_type', ''], - ['create_time', []], - ['keywords', ''], + [ 'member_id', '' ], + [ 'from_type', '' ], + [ 'create_time', [] ], + [ 'keywords', '' ], ]); - $data['account_type'] = 'point'; - return success((new MemberAccountService())->getPage($data)); + $data[ 'account_type' ] = 'point'; + return success(( new MemberAccountService() )->getPage($data)); } /** @@ -41,22 +41,22 @@ class Account extends BaseAdminController public function sumPoint() { $data = $this->request->params([ - ['member_id', ''], + [ 'member_id', '' ], ]); $member_account_service = new MemberAccountService(); $member_service = new MemberService(); - if (empty($data['member_id'])) { + if (empty($data[ 'member_id' ])) { $commission_data = [ 'point_get' => $member_service->getSum('point_get'),//累计 'point_use' => abs($member_account_service->getExpensesSumAccount(MemberAccountTypeDict::POINT)), ]; return success($commission_data); } else { - $info = $member_account_service->getMemberAccountInfo($data['member_id']); + $info = $member_account_service->getMemberAccountInfo($data[ 'member_id' ]); $commission_data = [ - 'point_get' => $info['point_get'], - 'point_use' => abs($member_account_service->getExpensesSumAccount(MemberAccountTypeDict::POINT, $data['member_id'])), + 'point_get' => $info[ 'point_get' ], + 'point_use' => abs($member_account_service->getExpensesSumAccount(MemberAccountTypeDict::POINT, $data[ 'member_id' ])), ]; return success($commission_data); } @@ -69,13 +69,13 @@ class Account extends BaseAdminController public function balance() { $data = $this->request->params([ - ['member_id', ''], - ['from_type', ''], - ['create_time', []], - ['keywords', ''], + [ 'member_id', '' ], + [ 'from_type', '' ], + [ 'create_time', [] ], + [ 'keywords', '' ], ]); - $data['account_type'] = 'balance'; - return success((new MemberAccountService())->getPage($data)); + $data[ 'account_type' ] = 'balance'; + return success(( new MemberAccountService() )->getPage($data)); } /** @@ -85,28 +85,29 @@ class Account extends BaseAdminController public function money() { $data = $this->request->params([ - ['member_id', ''], - ['from_type', ''], - ['create_time', []], - ['keywords', ''], + [ 'member_id', '' ], + [ 'from_type', '' ], + [ 'create_time', [] ], + [ 'keywords', '' ], ]); - $data['account_type'] = 'money'; - return success((new MemberAccountService())->getPage($data)); + $data[ 'account_type' ] = 'money'; + return success(( new MemberAccountService() )->getPage($data)); } /** * 查询成长值 * @return Response */ - public function growth() { + public function growth() + { $data = $this->request->params([ - ['member_id', ''], - ['from_type', ''], - ['create_time', []], - ['keywords', ''], + [ 'member_id', '' ], + [ 'from_type', '' ], + [ 'create_time', [] ], + [ 'keywords', '' ], ]); - $data['account_type'] = 'growth'; - return success((new MemberAccountService())->getPage($data)); + $data[ 'account_type' ] = 'growth'; + return success(( new MemberAccountService() )->getPage($data)); } /** @@ -115,12 +116,12 @@ class Account extends BaseAdminController public function adjustPoint() { $data = $this->request->params([ - ['member_id', ''], - ['account_data', 0], - ['memo', ''], + [ 'member_id', '' ], + [ 'account_data', 0 ], + [ 'memo', '' ], ]); - $res = (new MemberAccountService())->adjustPoint($data); - return success('SUCCESS', ['id' => $res]); + $res = ( new MemberAccountService() )->adjustPoint($data); + return success('SUCCESS', [ 'id' => $res ]); } /** @@ -129,12 +130,12 @@ class Account extends BaseAdminController public function adjustBalance() { $data = $this->request->params([ - ['member_id', ''], - ['account_data', 0], - ['memo', ''], + [ 'member_id', '' ], + [ 'account_data', 0 ], + [ 'memo', '' ], ]); - $res = (new MemberAccountService())->adjustBalance($data); - return success('SUCCESS', ['id' => $res]); + $res = ( new MemberAccountService() )->adjustBalance($data); + return success('SUCCESS', [ 'id' => $res ]); } /** @@ -144,12 +145,12 @@ class Account extends BaseAdminController public function adjustMoney() { $data = $this->request->params([ - ['member_id', ''], - ['account_data', 0], - ['memo', ''], + [ 'member_id', '' ], + [ 'account_data', 0 ], + [ 'memo', '' ], ]); - $res = (new MemberAccountService())->adjustMoney($data); - return success('SUCCESS', ['id' => $res]); + $res = ( new MemberAccountService() )->adjustMoney($data); + return success('SUCCESS', [ 'id' => $res ]); } /** @@ -159,13 +160,13 @@ class Account extends BaseAdminController public function commission() { $data = $this->request->params([ - ['member_id', ''], - ['from_type', ''], - ['create_time', []], - ['keywords', ''], + [ 'member_id', '' ], + [ 'from_type', '' ], + [ 'create_time', [] ], + [ 'keywords', '' ], ]); - $data['account_type'] = 'commission'; - return success((new MemberAccountService())->getPage($data)); + $data[ 'account_type' ] = 'commission'; + return success(( new MemberAccountService() )->getPage($data)); } /** @@ -174,12 +175,12 @@ class Account extends BaseAdminController public function sumCommission() { $data = $this->request->params([ - ['member_id', ''], + [ 'member_id', '' ], ]); $member_account_service = new MemberAccountService(); $member_service = new MemberService(); - if (empty($data['member_id'])) { + if (empty($data[ 'member_id' ])) { $commission_data = [ 'total_commission' => $member_service->getSum('commission_get'),//累计 'commission' => $member_service->getSum('commission'),//未提现 @@ -188,12 +189,12 @@ class Account extends BaseAdminController ]; return success($commission_data); } else { - $info = $member_account_service->getMemberAccountInfo($data['member_id']); + $info = $member_account_service->getMemberAccountInfo($data[ 'member_id' ]); $commission_data = [ - 'commission' => $info['commission'], - 'commission_cash_outing' => $info['commission_cash_outing'], - 'withdrawn_commission' => $member_account_service->getWithdrawnCommission($data['member_id']),//已提现 - 'total_commission' => $info['commission_get'], + 'commission' => $info[ 'commission' ], + 'commission_cash_outing' => $info[ 'commission_cash_outing' ], + 'withdrawn_commission' => $member_account_service->getWithdrawnCommission($data[ 'member_id' ]),//已提现 + 'total_commission' => $info[ 'commission_get' ], ]; return success($commission_data); } @@ -205,10 +206,10 @@ class Account extends BaseAdminController public function sumBalance() { $data = $this->request->params([ - ['member_id', ''], + [ 'member_id', '' ], ]); $member_account_service = new MemberAccountService(); - if (empty($data['member_id'])) { + if (empty($data[ 'member_id' ])) { $balance_data = [ MemberAccountTypeDict::BALANCE => number_format($member_account_service->getSumAccount(MemberAccountTypeDict::BALANCE), 2, '.', ''), @@ -216,7 +217,7 @@ class Account extends BaseAdminController ]; return success($balance_data); } else { - return success($member_account_service->getMemberAccountInfo($data['member_id'])); + return success($member_account_service->getMemberAccountInfo($data[ 'member_id' ])); } } @@ -227,7 +228,7 @@ class Account extends BaseAdminController */ public function changeType(string $account_type) { - $res = (new MemberAccountService())->getFromType($account_type); + $res = ( new MemberAccountService() )->getFromType($account_type); return success($res); } @@ -239,5 +240,4 @@ class Account extends BaseAdminController return success(MemberAccountTypeDict::getType()); } - } diff --git a/niucloud/app/adminapi/controller/member/Config.php b/niucloud/app/adminapi/controller/member/Config.php index f1cda97b0..fdd691a34 100644 --- a/niucloud/app/adminapi/controller/member/Config.php +++ b/niucloud/app/adminapi/controller/member/Config.php @@ -37,6 +37,7 @@ class Config extends BaseAdminController [ 'is_username', 1 ], [ 'is_mobile', 0 ], [ 'is_auth_register', 1 ], + [ 'is_force_access_user_info', 0 ], [ 'is_bind_mobile', 0 ], [ 'agreement_show', 0 ], [ 'bg_url', '' ], diff --git a/niucloud/app/adminapi/controller/member/MemberLevel.php b/niucloud/app/adminapi/controller/member/MemberLevel.php index 5113cd28a..0cf0edbf7 100644 --- a/niucloud/app/adminapi/controller/member/MemberLevel.php +++ b/niucloud/app/adminapi/controller/member/MemberLevel.php @@ -32,18 +32,6 @@ class MemberLevel extends BaseAdminController return success(( new MemberLevelService() )->getPage($data)); } - /** - * 会员等级列表 - * @return Response - */ - public function lists() - { - $data = $this->request->params([ - [ 'level_name', '' ], - ]); - return success(( new MemberLevelService() )->getList($data)); - } - /** * 会员等级详情 * @param int $id diff --git a/niucloud/app/adminapi/controller/sys/ScheduleLog.php b/niucloud/app/adminapi/controller/sys/ScheduleLog.php index 8d04bff11..7eee9c31b 100644 --- a/niucloud/app/adminapi/controller/sys/ScheduleLog.php +++ b/niucloud/app/adminapi/controller/sys/ScheduleLog.php @@ -1,6 +1,6 @@ request->params([ + [ 'ids', '' ], + ]); + (new ScheduleLogService())->del($data[ 'ids' ]); + return success('DELETE_SUCCESS'); + } + + /** + * 清空计划任务执行记录 + * @return Response + */ + public function clear() + { + $data = $this->request->params([ + [ 'schedule_id', '' ], + ]); + (new ScheduleLogService())->clear($data); + return success('SUCCESS'); + } + } diff --git a/niucloud/app/adminapi/controller/wechat/Reply.php b/niucloud/app/adminapi/controller/wechat/Reply.php index 97994fce1..08767c7f7 100644 --- a/niucloud/app/adminapi/controller/wechat/Reply.php +++ b/niucloud/app/adminapi/controller/wechat/Reply.php @@ -34,8 +34,8 @@ class Reply extends BaseAdminController public function getKeywordLists() { $data = $this->request->params([ - ['keyword', ''], - ['name', ''] + [ 'keyword', '' ], + [ 'name', '' ] ]); $wechat_reply_service = new WechatReplyService(); return success($wechat_reply_service->getKeywordPage($data)); @@ -49,12 +49,12 @@ class Reply extends BaseAdminController { $wechat_reply_service = new WechatReplyService(); $data = $this->request->params([ - ['name', ''], - ['keyword', ''], - ['matching_type', '', false], - ['reply_method', ''], - ['content', ''], - ['sort', ''], + [ 'name', '' ], + [ 'keyword', '' ], + [ 'matching_type', '', false ], + [ 'reply_method', '' ], + [ 'content', '' ], + [ 'sort', '' ], ]); $wechat_reply_service->addKeyword($data); return success('ADD_SUCCESS'); @@ -68,12 +68,12 @@ class Reply extends BaseAdminController { $wechat_reply_service = new WechatReplyService(); $data = $this->request->params([ - ['name', ''], - ['keyword', ''], - ['matching_type', '', false], - ['reply_method', ''], - ['content', ''], - ['sort', ''], + [ 'name', '' ], + [ 'keyword', '' ], + [ 'matching_type', '', false ], + [ 'reply_method', '' ], + [ 'content', '' ], + [ 'sort', '' ], ]); $wechat_reply_service->editKeyword($id, $data); return success('EDIT_SUCCESS'); @@ -107,7 +107,7 @@ class Reply extends BaseAdminController public function editDefault() { $data = $this->request->params([ - ['content', ''], + [ 'content', '' ], ]); $wechat_reply_service = new WechatReplyService(); $wechat_reply_service->editDefault($data); @@ -131,12 +131,11 @@ class Reply extends BaseAdminController public function editSubscribe() { $data = $this->request->params([ - ['content', ''], + [ 'content', '' ], ]); $wechat_reply_service = new WechatReplyService(); $wechat_reply_service->editSubscribe($data); return success('SET_SUCCESS'); } - } diff --git a/niucloud/app/adminapi/controller/wechat/Template.php b/niucloud/app/adminapi/controller/wechat/Template.php index d5345530f..76519ea0b 100644 --- a/niucloud/app/adminapi/controller/wechat/Template.php +++ b/niucloud/app/adminapi/controller/wechat/Template.php @@ -28,10 +28,10 @@ class Template extends BaseAdminController public function sync() { $data = $this->request->params([ - ['keys', []] + [ 'keys', [] ] ]); $wechat_template_service = new WechatTemplateService(); - return success(data:$wechat_template_service->syncAll($data['keys'])); + return success(data:$wechat_template_service->syncAll($data[ 'keys' ])); } /** @@ -44,5 +44,4 @@ class Template extends BaseAdminController return success($wechat_template_service->getList()); } - } diff --git a/niucloud/app/adminapi/route/member.php b/niucloud/app/adminapi/route/member.php index 722ab6999..7f64d1c2e 100644 --- a/niucloud/app/adminapi/route/member.php +++ b/niucloud/app/adminapi/route/member.php @@ -131,8 +131,6 @@ Route::group('member', function() { /***************************************************** 会员等级 ****************************************************/ //会员等级分页列表 Route::get('level', 'member.MemberLevel/pages'); - //会员等级列表 - Route::get('level/list', 'member.MemberLevel/lists'); //会员等级详情 Route::get('level/:id', 'member.MemberLevel/info'); //会员等级添加 diff --git a/niucloud/app/adminapi/route/sys.php b/niucloud/app/adminapi/route/sys.php index a401c1f1e..c0795dbca 100644 --- a/niucloud/app/adminapi/route/sys.php +++ b/niucloud/app/adminapi/route/sys.php @@ -191,6 +191,10 @@ Route::group('sys', function() { //任务执行记录列表 Route::get('schedule/log/list', 'sys.ScheduleLog/lists'); + //删除执行记录 + Route::put('schedule/log/delete', 'sys.ScheduleLog/del'); + //清空执行记录 + Route::put('schedule/log/clear', 'sys.ScheduleLog/clear'); /***************************************************** 应用管理 ****************************************************/ Route::get('applist', 'sys.App/getAppList'); diff --git a/niucloud/app/api/controller/login/Config.php b/niucloud/app/api/controller/login/Config.php index 594c58727..eb1ce74b3 100644 --- a/niucloud/app/api/controller/login/Config.php +++ b/niucloud/app/api/controller/login/Config.php @@ -23,9 +23,10 @@ class Config extends BaseController */ public function getLoginConfig() { - - return success((new MemberConfigService())->getLoginConfig()); + $data = $this->request->params([ + [ 'url', '' ], + ]); + return success(( new MemberConfigService() )->getLoginConfig($data[ 'url' ])); } - } diff --git a/niucloud/app/api/controller/sys/Config.php b/niucloud/app/api/controller/sys/Config.php index 8a39cb793..f3118c628 100644 --- a/niucloud/app/api/controller/sys/Config.php +++ b/niucloud/app/api/controller/sys/Config.php @@ -14,7 +14,10 @@ namespace app\api\controller\sys; use app\service\api\diy\DiyConfigService; use app\service\api\member\MemberConfigService; use app\service\api\member\MemberLevelService; +use app\service\api\member\MemberService; +use app\service\api\site\SiteService; use app\service\api\sys\ConfigService; +use app\service\api\wechat\WechatAuthService; use core\base\BaseApiController; use think\Response; @@ -75,13 +78,18 @@ class Config extends BaseApiController */ public function init() { + $data = $this->request->params([ + [ 'url', '' ], + ]); + $res = []; $res[ 'tabbar_list' ] = ( new DiyConfigService() )->getBottomList(); $res[ 'map_config' ] = ( new ConfigService() )->getMap(); $res[ 'site_info' ] = ( new ConfigService() )->getWebSite(); $res[ 'member_level' ] = ( new MemberLevelService() )->getList(); - $res[ 'login_config' ] = ( new MemberConfigService() )->getLoginConfig(); + $res[ 'login_config' ] = ( new MemberConfigService() )->getLoginConfig($data[ 'url' ]); + ( new MemberService() )->initMemberData(); return success($res); } } diff --git a/niucloud/app/common.php b/niucloud/app/common.php index cca78c02c..d01ec07ed 100644 --- a/niucloud/app/common.php +++ b/niucloud/app/common.php @@ -224,6 +224,21 @@ function get_start_and_end_time_by_day($day = '') return [ $day_start_time, $day_end_time ]; } +/** + * 获取本周的 开始、结束时间 + * @param data 日期 + */ +function get_weekinfo_by_time($date) +{ + $idx = strftime("%u", strtotime($date)); + $mon_idx = $idx - 1; + $sun_idx = $idx - 7; + return array( + 'week_start_day' => strftime('%Y-%m-%d', strtotime($date) - $mon_idx * 86400), + 'week_end_day' => strftime('%Y-%m-%d', strtotime($date) - $sun_idx * 86400), + ); +} + /** * 路径转链接 * @param $path diff --git a/niucloud/app/dict/diy/ComponentDict.php b/niucloud/app/dict/diy/ComponentDict.php index abd3706c6..2f4d431b2 100644 --- a/niucloud/app/dict/diy/ComponentDict.php +++ b/niucloud/app/dict/diy/ComponentDict.php @@ -190,6 +190,20 @@ class ComponentDict ] ] ], + // 轮播图设置 + 'swiper' => [ + 'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色 + "indicatorActiveColor" => '#FF0E0E', + 'indicatorStyle' => 'style-1', + 'indicatorAlign' => 'center' + ], + 'template' => [ + "margin" => [ + "top" => 10, // 上边距 + "bottom" => 10, // 下边距 + "both" => 0 // 左右边距 + ], + ], ] ], 'RubikCube' => [ @@ -261,7 +275,28 @@ class ComponentDict 'value' => [ "style" => "style-1", "styleName" => "风格1" - ], + ],// 组件属性 + 'template' => [ + "textColor" => "#303133", // 文字颜色 + 'pageStartBgColor' => '', // 底部背景颜色(开始) + 'pageEndBgColor' => '', // 底部背景颜色(结束) + 'pageGradientAngle' => 'to bottom', // 渐变角度,从上到下(to bottom)、从左到右(to right) + 'componentBgUrl' => '', // 组件背景图片 + 'componentBgAlpha' => 2, // 组件背景图片的透明度,0~10 + "componentStartBgColor" => '', // 组件背景颜色(开始) + "componentEndBgColor" => '', // 组件背景颜色(结束) + "componentGradientAngle" => 'to bottom', // 渐变角度,上下(to bottom)、左右(to right) + "topRounded" => 12, // 组件上圆角 + "bottomRounded" => 0, // 组件下圆角 + "elementBgColor" => '', // 元素背景颜色 + "topElementRounded" => 0,// 元素上圆角 + "bottomElementRounded" => 0, // 元素下圆角 + "margin" => [ + "top" => 0, // 上边距 + "bottom" => 0, // 下边距 + "both" => 10 // 左右边距 + ] + ] ], 'Notice' => [ 'title' => '公告', @@ -314,6 +349,7 @@ class ComponentDict 'value' => 'style-1' ], 'text' => '超值爆款', + 'textImg' => 'static/resource/images/diy/active_cube/active_cube_text1.png', "textLink" => [ "name" => "" ], @@ -330,7 +366,8 @@ class ComponentDict "blockStyle" => [ 'title' => '风格1', 'value' => 'style-1', - 'fontWeight' => 'normal' + 'fontWeight' => 'normal', + 'btnText' => 'normal' ], 'list' => [ [ @@ -350,8 +387,8 @@ class ComponentDict "endColor" => "#FE1E00", ], "listFrame" => [ - "startColor" => "#FEA715", - "endColor" => "#FE1E00", + "startColor" => "#FFFAF5", + "endColor" => "#FFFFFF" ], "link" => [ "name" => "" @@ -375,8 +412,8 @@ class ComponentDict "endColor" => "#FF9E03", ], "listFrame" => [ - "startColor" => "#FFBF50", - "endColor" => "#FF9E03", + "startColor" => "#FFFAF5", + "endColor" => "#FFFFFF" ], "link" => [ "name" => "" @@ -400,8 +437,8 @@ class ComponentDict "endColor" => "#49CD2D", ], "listFrame" => [ - "startColor" => "#A2E792", - "endColor" => "#49CD2D", + "startColor" => "#FFFAF5", + "endColor" => "#FFFFFF" ], "link" => [ "name" => "" @@ -425,8 +462,8 @@ class ComponentDict "endColor" => "#1D7CFF", ], "listFrame" => [ - "startColor" => "#4AC1FF", - "endColor" => "#1D7CFF", + "startColor" => "#FFFAF5", + "endColor" => "#FFFFFF" ], "link" => [ "name" => "" @@ -474,13 +511,26 @@ class ComponentDict 'search' => [ 'logo' => '', 'text' => '请输入搜索关键词', - "link" => [ - "name" => "" + 'link' => [ + 'name' => '' ], + 'style' => 'style-1', + 'styleName' => '风格一', + "subTitle" => [ + "text" => "本地好价·优选生活", + "textColor" => "#000000", + "startColor" => "rgba(255,255,255,0.7)", + "endColor" => "", + ], + 'positionColor' => '#ffffff', 'hotWord' => [ "interval" => 3, 'list' => [] - ] + ], + 'color' => '#999999', + 'btnColor' => '#ffffff', + 'bgColor' => '#ffffff', + 'btnBgColor' => '#ff3434' ], // 选项卡设置 'tab' => [ @@ -590,7 +640,115 @@ class ComponentDict 'borderStyle' => 'solid' ], ], - + 'PictureShow' => [ + 'title' => '图片展播', + 'icon' => 'iconfont icona-tupianzhanbopc302', + 'path' => 'edit-picture-show', + 'support_page' => [], + 'uses' => 0, + 'sort' => 10017, + 'value' => [ + 'moduleOne' => [ + 'head' => [ + "textImg" => "static/resource/images/diy/picture_show/picture_show_head_text3.png", + "subText" => "最高补1200元", + "subTextColor" => "#666666" + ], + 'list' => [ + [ + "btnTitle" => [ + "text" => "全网低价", + "color" => "#ffffff", + "startColor" => "#F5443E", + "endColor" => "#F5443E" + ], + "link" => [ + "name" => "" + ], + "imageUrl" => "static/resource/images/diy/picture_show/picture_05.png" + ], + [ + "btnTitle" => [ + "text" => "大牌特惠", + "color" => "#ffffff", + "startColor" => "#F5443E", + "endColor" => "#F5443E" + ], + "link" => [ + "name" => "" + ], + "imageUrl" => "static/resource/images/diy/picture_show/picture_06.png" + ] + ], + "listFrame" => [ + "startColor" => "#D4EFFF", + "endColor" => "#EBF4FA" + ] + ], + 'moduleTwo' => [ + 'head' => [ + "textImg" => "static/resource/images/diy/picture_show/picture_show_head_text4.png", + "subText" => "每日上新", + "subTextColor" => "#666666" + ], + 'list' => [ + [ + "btnTitle" => [ + "text" => "人气爆款", + "color" => "#ffffff", + "startColor" => "#F5443E", + "endColor" => "#F5443E" + ], + "link" => [ + "name" => "" + ], + "imageUrl" => "static/resource/images/diy/picture_show/picture_07.png" + ], + [ + "btnTitle" => [ + "text" => "官方正品", + "color" => "#ffffff", + "startColor" => "#F5443E", + "endColor" => "#F5443E" + ], + "link" => [ + "name" => "" + ], + "imageUrl" => "static/resource/images/diy/picture_show/picture_08.png" + ] + ], + "listFrame" => [ + "startColor" => "#FFF1D4", + "endColor" => "#F9F2E5" + ] + ], + "moduleRounded" => [ + "topRounded" => 10, + "bottomRounded" => 10 + ], + ],// 组件属性 + 'template' => [ + "textColor" => "#303133", // 文字颜色 + 'pageStartBgColor' => '', // 底部背景颜色(开始) + 'pageEndBgColor' => '', // 底部背景颜色(结束) + 'pageGradientAngle' => 'to bottom', // 渐变角度,从上到下(to bottom)、从左到右(to right) + 'componentBgUrl' => '', // 组件背景图片 + 'componentBgAlpha' => 2, // 组件背景图片的透明度,0~10 + "componentStartBgColor" => '', // 组件背景颜色(开始) + "componentEndBgColor" => '', // 组件背景颜色(结束) + "componentGradientAngle" => 'to bottom', // 渐变角度,上下(to bottom)、左右(to right) + "topRounded" => 0, // 组件上圆角 + "bottomRounded" => 0, // 组件下圆角 + "elementBgColor" => '', // 元素背景颜色 + "topElementRounded" => 0,// 元素上圆角 + "bottomElementRounded" => 0, // 元素下圆角 + "margin" => [ + "top" => 0, // 上边距 + "bottom" => 0, // 下边距 + "both" => 10 // 左右边距 + ], + ] + ] ], ], ]; diff --git a/niucloud/app/dict/diy/PagesDict.php b/niucloud/app/dict/diy/PagesDict.php index 31a896502..4fe9f0cdb 100644 --- a/niucloud/app/dict/diy/PagesDict.php +++ b/niucloud/app/dict/diy/PagesDict.php @@ -65,7 +65,14 @@ class PagesDict "both" => 10 ], "ignore" => [], - "list" => [] + "list" => [], + // 轮播图设置 + 'swiper' => [ + 'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色 + "indicatorActiveColor" => '#FF0E0E', + 'indicatorStyle' => 'style-1', + 'indicatorAlign' => 'center' + ] ]; $wap_index_list = ( new ConfigService() )->getWapIndexList(); @@ -487,6 +494,13 @@ class PagesDict "imgWidth" => 100, "imgHeight" => 100 ] + ], + // 轮播图设置 + 'swiper' => [ + 'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色 + "indicatorActiveColor" => '#FF0E0E', + 'indicatorStyle' => 'style-1', + 'indicatorAlign' => 'center' ] ], [ @@ -612,6 +626,13 @@ class PagesDict ] ] ], + // 轮播图设置 + 'swiper' => [ + 'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色 + "indicatorActiveColor" => '#FF0E0E', + 'indicatorStyle' => 'style-1', + 'indicatorAlign' => 'center' + ], 'pageStartBgColor' => '', 'pageEndBgColor' => '', 'pageGradientAngle' => 'to bottom', @@ -938,6 +959,13 @@ class PagesDict "imgWidth" => 100, "imgHeight" => 100 ] + ], + // 轮播图设置 + 'swiper' => [ + 'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色 + "indicatorActiveColor" => '#FF0E0E', + 'indicatorStyle' => 'style-1', + 'indicatorAlign' => 'center' ] ], [ @@ -1063,6 +1091,13 @@ class PagesDict ] ] ], + // 轮播图设置 + 'swiper' => [ + 'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色 + "indicatorActiveColor" => '#FF0E0E', + 'indicatorStyle' => 'style-1', + 'indicatorAlign' => 'center' + ], 'pageStartBgColor' => '', 'pageEndBgColor' => '', 'pageGradientAngle' => 'to bottom', diff --git a/niucloud/app/dict/pay/PayDict.php b/niucloud/app/dict/pay/PayDict.php index 8cf7ee643..a1ced926d 100644 --- a/niucloud/app/dict/pay/PayDict.php +++ b/niucloud/app/dict/pay/PayDict.php @@ -58,7 +58,7 @@ class PayDict 'key' => self::WECHATPAY, 'icon' => self::WECHATPAY_ICON, 'setting_component' => '/src/app/views/setting/components/pay-wechatpay.vue', - 'encrypt_params' => ['mch_public_cert_path', 'mch_secret_cert', 'mch_secret_key'], + 'encrypt_params' => ['mch_public_cert_path', 'mch_secret_cert', 'mch_secret_key', 'wechat_public_cert_path'], ],//微信支付 self::ALIPAY => [ 'name' => get_lang('dict_pay.type_alipay'), diff --git a/niucloud/app/install/source/database.sql b/niucloud/app/install/source/database.sql index 9035f29b1..02a550258 100644 --- a/niucloud/app/install/source/database.sql +++ b/niucloud/app/install/source/database.sql @@ -422,7 +422,7 @@ CREATE TABLE `pay_refund` ( `main_id` int NOT NULL DEFAULT 0 COMMENT '操作人', `pay_refund_no` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '外部支付方式的退款单号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '退款记录表' ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '支付退款记录表' ROW_FORMAT = Dynamic; DROP TABLE IF EXISTS `pay_transfer`; @@ -827,7 +827,7 @@ CREATE TABLE `sys_user` ( `create_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', `login_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '登录次数', `is_del` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, - `delete_time` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', `status` tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '后台管理员状态 1有效0无效', `role_ids` varchar(255) NOT NULL DEFAULT '' COMMENT '权限组', diff --git a/niucloud/app/install/view/index/step-5.html b/niucloud/app/install/view/index/step-5.html index 7a6916954..55c0cb248 100644 --- a/niucloud/app/install/view/index/step-5.html +++ b/niucloud/app/install/view/index/step-5.html @@ -114,7 +114,7 @@ content: `