diff --git a/niucloud/app/adminapi/config/config.php b/niucloud/app/adminapi/config/config.php index 9c7de888a..cc0415fdc 100644 --- a/niucloud/app/adminapi/config/config.php +++ b/niucloud/app/adminapi/config/config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/config/route.php b/niucloud/app/adminapi/config/route.php index 28a8a0ff1..63458a432 100644 --- a/niucloud/app/adminapi/config/route.php +++ b/niucloud/app/adminapi/config/route.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/addon/Addon.php b/niucloud/app/adminapi/controller/addon/Addon.php index 80a669b90..a017c3df4 100644 --- a/niucloud/app/adminapi/controller/addon/Addon.php +++ b/niucloud/app/adminapi/controller/addon/Addon.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/addon/AddonDevelop.php b/niucloud/app/adminapi/controller/addon/AddonDevelop.php index a79ad5b50..bf5e0896b 100644 --- a/niucloud/app/adminapi/controller/addon/AddonDevelop.php +++ b/niucloud/app/adminapi/controller/addon/AddonDevelop.php @@ -11,6 +11,7 @@ namespace app\adminapi\controller\addon; +use app\dict\addon\AddonDict; use app\service\admin\addon\AddonDevelopService; use app\service\admin\niucloud\AppService; use core\base\BaseAdminController; @@ -123,4 +124,11 @@ class AddonDevelop extends BaseAdminController return success(data:(new AddonDevelopService())->download($key)); } + /** + * + * @return Response + */ + public function keyBlackList() { + return success(AddonDict::ADDON_KEY_BLACK_LIST); + } } diff --git a/niucloud/app/adminapi/controller/addon/App.php b/niucloud/app/adminapi/controller/addon/App.php index f8e42c914..f6cf6c253 100644 --- a/niucloud/app/adminapi/controller/addon/App.php +++ b/niucloud/app/adminapi/controller/addon/App.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/addon/Upgrade.php b/niucloud/app/adminapi/controller/addon/Upgrade.php index 26b17cf46..af6e860c9 100644 --- a/niucloud/app/adminapi/controller/addon/Upgrade.php +++ b/niucloud/app/adminapi/controller/addon/Upgrade.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/aliapp/Config.php b/niucloud/app/adminapi/controller/aliapp/Config.php index 561b38632..6cd1cd217 100644 --- a/niucloud/app/adminapi/controller/aliapp/Config.php +++ b/niucloud/app/adminapi/controller/aliapp/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/applet/SiteVersion.php b/niucloud/app/adminapi/controller/applet/SiteVersion.php index 01488e9d0..6eab700a2 100644 --- a/niucloud/app/adminapi/controller/applet/SiteVersion.php +++ b/niucloud/app/adminapi/controller/applet/SiteVersion.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/applet/Version.php b/niucloud/app/adminapi/controller/applet/Version.php index 5fd69e473..e0b06a8ae 100644 --- a/niucloud/app/adminapi/controller/applet/Version.php +++ b/niucloud/app/adminapi/controller/applet/Version.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/applet/VersionDownload.php b/niucloud/app/adminapi/controller/applet/VersionDownload.php index ee1a5226f..68133e70f 100644 --- a/niucloud/app/adminapi/controller/applet/VersionDownload.php +++ b/niucloud/app/adminapi/controller/applet/VersionDownload.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/auth/Auth.php b/niucloud/app/adminapi/controller/auth/Auth.php index 420af37c5..66a4c5324 100644 --- a/niucloud/app/adminapi/controller/auth/Auth.php +++ b/niucloud/app/adminapi/controller/auth/Auth.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/channel/H5.php b/niucloud/app/adminapi/controller/channel/H5.php index 95b84347b..428649e07 100644 --- a/niucloud/app/adminapi/controller/channel/H5.php +++ b/niucloud/app/adminapi/controller/channel/H5.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/channel/Pc.php b/niucloud/app/adminapi/controller/channel/Pc.php index 914ae4b14..51beedbc0 100644 --- a/niucloud/app/adminapi/controller/channel/Pc.php +++ b/niucloud/app/adminapi/controller/channel/Pc.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/diy/Config.php b/niucloud/app/adminapi/controller/diy/Config.php index 83d231faf..744ae7a20 100644 --- a/niucloud/app/adminapi/controller/diy/Config.php +++ b/niucloud/app/adminapi/controller/diy/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/diy/Diy.php b/niucloud/app/adminapi/controller/diy/Diy.php index 6a88921fb..b525d7c78 100644 --- a/niucloud/app/adminapi/controller/diy/Diy.php +++ b/niucloud/app/adminapi/controller/diy/Diy.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -49,8 +49,7 @@ class Diy extends BaseAdminController */ public function getPageByCarouselSearch() { - $data = $this->request->params([ - ]); + $data = $this->request->params([]); return success(( new DiyService() )->getPageByCarouselSearch($data)); } @@ -88,6 +87,7 @@ class Diy extends BaseAdminController public function add() { $data = $this->request->params([ + [ "page_title", "" ], [ "title", "" ], [ "name", "" ], [ "type", "" ], @@ -111,6 +111,7 @@ class Diy extends BaseAdminController public function edit($id) { $data = $this->request->params([ + [ "page_title", "" ], [ "title", "" ], [ "name", "" ], [ "value", "", false ], diff --git a/niucloud/app/adminapi/controller/diy/DiyRoute.php b/niucloud/app/adminapi/controller/diy/DiyRoute.php index 6183bfd88..773ef03ec 100644 --- a/niucloud/app/adminapi/controller/diy/DiyRoute.php +++ b/niucloud/app/adminapi/controller/diy/DiyRoute.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/home/Site.php b/niucloud/app/adminapi/controller/home/Site.php index c6737ee69..167ae6c20 100644 --- a/niucloud/app/adminapi/controller/home/Site.php +++ b/niucloud/app/adminapi/controller/home/Site.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/login/Captcha.php b/niucloud/app/adminapi/controller/login/Captcha.php index 5deb56d18..1455e0c38 100644 --- a/niucloud/app/adminapi/controller/login/Captcha.php +++ b/niucloud/app/adminapi/controller/login/Captcha.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/login/Config.php b/niucloud/app/adminapi/controller/login/Config.php index 308f0a6ab..1391d8007 100644 --- a/niucloud/app/adminapi/controller/login/Config.php +++ b/niucloud/app/adminapi/controller/login/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/login/Login.php b/niucloud/app/adminapi/controller/login/Login.php index cf1231c94..6a3153148 100644 --- a/niucloud/app/adminapi/controller/login/Login.php +++ b/niucloud/app/adminapi/controller/login/Login.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -12,8 +12,10 @@ namespace app\adminapi\controller\login; use addon\vipcard\app\service\core\CoreOrderRefundService; +use app\dict\member\MemberAccountTypeDict; use app\service\admin\auth\ConfigService; use app\service\admin\auth\LoginService; +use app\service\admin\member\MemberService; use app\service\admin\upgrade\UpgradeService; use app\service\core\addon\CoreAddonDevelopBuildService; use app\service\core\addon\WapTrait; @@ -70,8 +72,9 @@ class Login extends BaseAdminController } public function test(){ - $this->addon = 'shop'; - $this->uninstallPageCode(project_path(). 'uni-app/src/'); + $res = event("MemberAccount", ['account_type' => MemberAccountTypeDict::GROWTH, 'site_id' => 166, + 'member_id' => 10143]); + dd($res); } public function geAddonPackagePath(string $addon) diff --git a/niucloud/app/adminapi/controller/member/Account.php b/niucloud/app/adminapi/controller/member/Account.php index 7b59b434b..8bcbb5bd8 100644 --- a/niucloud/app/adminapi/controller/member/Account.php +++ b/niucloud/app/adminapi/controller/member/Account.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -94,6 +94,21 @@ class Account extends BaseAdminController return success((new MemberAccountService())->getPage($data)); } + /** + * 查询成长值 + * @return Response + */ + public function growth() { + $data = $this->request->params([ + ['member_id', ''], + ['from_type', ''], + ['create_time', []], + ['keywords', ''], + ]); + $data['account_type'] = 'growth'; + return success((new MemberAccountService())->getPage($data)); + } + /** * 积分账户调整 */ diff --git a/niucloud/app/adminapi/controller/member/CashOut.php b/niucloud/app/adminapi/controller/member/CashOut.php index bc9f3cb1d..eccb0700a 100644 --- a/niucloud/app/adminapi/controller/member/CashOut.php +++ b/niucloud/app/adminapi/controller/member/CashOut.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/member/Config.php b/niucloud/app/adminapi/controller/member/Config.php index 648f27bb3..7b6394ce0 100644 --- a/niucloud/app/adminapi/controller/member/Config.php +++ b/niucloud/app/adminapi/controller/member/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -12,6 +12,7 @@ namespace app\adminapi\controller\member; use app\service\admin\member\MemberConfigService; +use app\service\admin\member\MemberService; use core\base\BaseAdminController; use think\Response; @@ -95,4 +96,54 @@ class Config extends BaseAdminController (new MemberConfigService())->setMemberConfig($data); return success('MODIFY_SUCCESS'); } + + /** + * 获取成长值规则配置 + * @return Response + */ + public function getGrowthRuleConfig() + { + return success((new MemberConfigService())->getGrowthRuleConfig()); + } + + /** + * 配置成长值规则 + * @return Response + */ + public function setGrowthRuleConfig() + { + $param = []; + $rules = (new MemberService())->getGrowthRuleDict(); + foreach ($rules as $key => $item) { + $param[] = [$key, []]; + } + $data = $this->request->params($param); + (new MemberConfigService())->setGrowthRuleConfig($data); + return success('MODIFY_SUCCESS'); + } + + /** + * 获取积分规则配置 + * @return Response + */ + public function getPointRuleConfig() + { + return success((new MemberConfigService())->getPointRuleConfig()); + } + + /** + * 配置积分规则 + * @return Response + */ + public function setPointRuleConfig() + { + $param = []; + $rules = (new MemberService())->getPointRuleDict(); + foreach ($rules as $key => $item) { + $param[] = [$key, []]; + } + $data = $this->request->params($param); + (new MemberConfigService())->setPointRuleConfig($data); + return success('MODIFY_SUCCESS'); + } } diff --git a/niucloud/app/adminapi/controller/member/Member.php b/niucloud/app/adminapi/controller/member/Member.php index 45d50c420..00d6461ff 100644 --- a/niucloud/app/adminapi/controller/member/Member.php +++ b/niucloud/app/adminapi/controller/member/Member.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -15,6 +15,7 @@ use app\dict\member\MemberDict; use app\dict\member\MemberRegisterChannelDict; use app\dict\member\MemberRegisterTypeDict; use app\service\admin\member\MemberService; +use app\service\core\sys\CoreExportService; use core\base\BaseAdminController; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; @@ -35,6 +36,7 @@ class Member extends BaseAdminController ['register_channel', ''], ['create_time', []], ['member_label', 0], + ['member_level', 0], ]); return success((new MemberService())->getPage($data)); } @@ -114,6 +116,23 @@ class Member extends BaseAdminController return success('DELETE_SUCCESS'); } + /** + * 导出会员列表 + * @return Response + */ + public function export() + { + $data = $this->request->params([ + ['keyword', ''], + ['register_type', ''], + ['register_channel', ''], + ['create_time', []], + ['member_label', 0], + ]); + (new MemberService())->exportMember($data); + return success('SUCCESS'); + } + /** * 会员使用场景 * @return Response @@ -182,5 +201,57 @@ class Member extends BaseAdminController return success('SUCCESS', $member_no); } + /** + * 获取会员权益字典 + * @return mixed + */ + public function getMemberBenefitsDict() { + return success((new MemberService())->getMemberBenefitsDict()); + } + /** + * 获取会员礼包字典 + * @return array|null + */ + public function getMemberGiftDict() { + return success((new MemberService())->getMemberGiftDict()); + } + + /** + * 获取成长值规则字典 + * @return array|null + */ + public function getGrowthRuleDict() { + return success((new MemberService())->getGrowthRuleDict()); + } + + /** + * 获取积分规则字典 + * @return array|null + */ + public function getPointRuleDict() { + return success((new MemberService())->getPointRuleDict()); + } + + /** + * 获取会员权益内容 + * @return Response + */ + public function getMemberBenefitsContent() { + $data = $this->request->params([ + [ 'benefits', [] ], + ]); + return success((new MemberService())->getMemberBenefitsContent($data['benefits'])); + } + + /** + * 获取会员礼包内容 + * @return Response + */ + public function getMemberGiftsContent() { + $data = $this->request->params([ + [ 'gifts', [] ], + ]); + return success((new MemberService())->getMemberGiftsContent($data['gifts'])); + } } diff --git a/niucloud/app/adminapi/controller/member/MemberLabel.php b/niucloud/app/adminapi/controller/member/MemberLabel.php index a9237f29c..16ea28512 100644 --- a/niucloud/app/adminapi/controller/member/MemberLabel.php +++ b/niucloud/app/adminapi/controller/member/MemberLabel.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/member/MemberLevel.php b/niucloud/app/adminapi/controller/member/MemberLevel.php new file mode 100644 index 000000000..7846918ef --- /dev/null +++ b/niucloud/app/adminapi/controller/member/MemberLevel.php @@ -0,0 +1,115 @@ +request->params([ + [ 'level_name', '' ], + ]); + 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 + * @return Response + */ + public function info(int $id) + { + return success(( new MemberLevelService() )->getInfo($id)); + } + + /** + * 添加会员等级 + * @return Response + */ + public function add() + { + $data = $this->request->params([ + [ 'level_name', '' ], + [ 'growth', 0 ], + [ 'remark', '' ], + [ 'level_benefits', [] ], + [ 'level_gifts', [] ] + ]); + $this->validate($data, 'app\validate\member\MemberLevel.add'); + $id = ( new MemberLevelService() )->add($data); + return success('ADD_SUCCESS', [ 'label_id' => $id ]); + } + + /** + * 编辑会员等级 + */ + public function edit($id) + { + $data = $this->request->params([ + [ 'level_name', '' ], + [ 'growth', 0 ], + [ 'remark', '' ], + [ 'level_benefits', [] ], + [ 'level_gifts', [] ] + ]); + $this->validate($data, 'app\validate\member\MemberLevel.edit'); + ( new MemberLevelService() )->edit($id, $data); + return success('EDIT_SUCCESS'); + } + + /** + * 会员等级删除 + * @param int $id + * @return Response + */ + public function del(int $id) + { + ( new MemberLevelService() )->del($id); + return success('DELETE_SUCCESS'); + } + + /** + * 获取标签 + * @return Response + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + */ + public function getAll() + { + return success(( new MemberLevelService() )->getAll()); + } + +} diff --git a/niucloud/app/adminapi/controller/member/MemberSign.php b/niucloud/app/adminapi/controller/member/MemberSign.php new file mode 100644 index 000000000..1debda6a2 --- /dev/null +++ b/niucloud/app/adminapi/controller/member/MemberSign.php @@ -0,0 +1,68 @@ +request->params([ + ['create_time', []], + ['keywords', ''] + ]); + return success(( new MemberSignService() )->getPage($data)); + } + + /** + * 会员签到详情 + * @param int $sign_id + * @return Response + */ + public function info(int $sign_id) + { + return success(( new MemberSignService() )->getInfo($sign_id)); + } + + /**设置签到设置 + * @return Response + */ + public function setSign() + { + $data = $this->request->params([ + [ 'is_use', 0 ], + [ 'sign_period', 0 ], + [ 'day_award', '' ], + [ 'continue_award', '' ], + [ 'rule_explain', '' ] + ]); + ( new MemberSignService() )->setSign($data); + return success(); + } + + /** + * 获取签到设置 + * @return Response + */ + public function getSign() + { + return success(( new MemberSignService() )->getSign()); + } + +} diff --git a/niucloud/app/adminapi/controller/niucloud/Cloud.php b/niucloud/app/adminapi/controller/niucloud/Cloud.php index b356b727e..a968152f9 100644 --- a/niucloud/app/adminapi/controller/niucloud/Cloud.php +++ b/niucloud/app/adminapi/controller/niucloud/Cloud.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/niucloud/Module.php b/niucloud/app/adminapi/controller/niucloud/Module.php index 60dcb39b3..d2394df9e 100644 --- a/niucloud/app/adminapi/controller/niucloud/Module.php +++ b/niucloud/app/adminapi/controller/niucloud/Module.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/notice/Notice.php b/niucloud/app/adminapi/controller/notice/Notice.php index fc72e269b..43ba97c04 100644 --- a/niucloud/app/adminapi/controller/notice/Notice.php +++ b/niucloud/app/adminapi/controller/notice/Notice.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/notice/NoticeLog.php b/niucloud/app/adminapi/controller/notice/NoticeLog.php index 49d834ca4..5a4f5c63d 100644 --- a/niucloud/app/adminapi/controller/notice/NoticeLog.php +++ b/niucloud/app/adminapi/controller/notice/NoticeLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/notice/SmsLog.php b/niucloud/app/adminapi/controller/notice/SmsLog.php index 3085e8714..639caaa89 100644 --- a/niucloud/app/adminapi/controller/notice/SmsLog.php +++ b/niucloud/app/adminapi/controller/notice/SmsLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/pay/Pay.php b/niucloud/app/adminapi/controller/pay/Pay.php index 63d7c0c0c..84beda237 100644 --- a/niucloud/app/adminapi/controller/pay/Pay.php +++ b/niucloud/app/adminapi/controller/pay/Pay.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/pay/PayChannel.php b/niucloud/app/adminapi/controller/pay/PayChannel.php index d9e32084b..67412734f 100644 --- a/niucloud/app/adminapi/controller/pay/PayChannel.php +++ b/niucloud/app/adminapi/controller/pay/PayChannel.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/site/Site.php b/niucloud/app/adminapi/controller/site/Site.php index c6841f2bc..cccae845d 100644 --- a/niucloud/app/adminapi/controller/site/Site.php +++ b/niucloud/app/adminapi/controller/site/Site.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/site/SiteAccount.php b/niucloud/app/adminapi/controller/site/SiteAccount.php index e97b52afc..6a98f9b5d 100644 --- a/niucloud/app/adminapi/controller/site/SiteAccount.php +++ b/niucloud/app/adminapi/controller/site/SiteAccount.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/site/SiteGroup.php b/niucloud/app/adminapi/controller/site/SiteGroup.php index 110ea2ab7..2891bcbe2 100644 --- a/niucloud/app/adminapi/controller/site/SiteGroup.php +++ b/niucloud/app/adminapi/controller/site/SiteGroup.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/site/User.php b/niucloud/app/adminapi/controller/site/User.php index 6489d1247..73d0c919c 100644 --- a/niucloud/app/adminapi/controller/site/User.php +++ b/niucloud/app/adminapi/controller/site/User.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/site/UserLog.php b/niucloud/app/adminapi/controller/site/UserLog.php index 5031844ae..31a9387e0 100644 --- a/niucloud/app/adminapi/controller/site/UserLog.php +++ b/niucloud/app/adminapi/controller/site/UserLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/stat/SiteStat.php b/niucloud/app/adminapi/controller/stat/SiteStat.php index e4d6f098d..485aee987 100644 --- a/niucloud/app/adminapi/controller/stat/SiteStat.php +++ b/niucloud/app/adminapi/controller/stat/SiteStat.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/stat/Stat.php b/niucloud/app/adminapi/controller/stat/Stat.php index 381b616b8..fed923ff8 100644 --- a/niucloud/app/adminapi/controller/stat/Stat.php +++ b/niucloud/app/adminapi/controller/stat/Stat.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/Agreement.php b/niucloud/app/adminapi/controller/sys/Agreement.php index 43d7d64c6..722847510 100644 --- a/niucloud/app/adminapi/controller/sys/Agreement.php +++ b/niucloud/app/adminapi/controller/sys/Agreement.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/App.php b/niucloud/app/adminapi/controller/sys/App.php index 12018ca55..8dc6fadeb 100644 --- a/niucloud/app/adminapi/controller/sys/App.php +++ b/niucloud/app/adminapi/controller/sys/App.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/Area.php b/niucloud/app/adminapi/controller/sys/Area.php index dd3734f44..0f055e14e 100644 --- a/niucloud/app/adminapi/controller/sys/Area.php +++ b/niucloud/app/adminapi/controller/sys/Area.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/Attachment.php b/niucloud/app/adminapi/controller/sys/Attachment.php index 12c8bd4c9..fd4b5494b 100644 --- a/niucloud/app/adminapi/controller/sys/Attachment.php +++ b/niucloud/app/adminapi/controller/sys/Attachment.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/Channel.php b/niucloud/app/adminapi/controller/sys/Channel.php index a532b95fe..f67cc8122 100644 --- a/niucloud/app/adminapi/controller/sys/Channel.php +++ b/niucloud/app/adminapi/controller/sys/Channel.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/Common.php b/niucloud/app/adminapi/controller/sys/Common.php index fe2c5173d..c14f08f77 100644 --- a/niucloud/app/adminapi/controller/sys/Common.php +++ b/niucloud/app/adminapi/controller/sys/Common.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/Config.php b/niucloud/app/adminapi/controller/sys/Config.php index c11b9ecea..444b81477 100644 --- a/niucloud/app/adminapi/controller/sys/Config.php +++ b/niucloud/app/adminapi/controller/sys/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -23,7 +23,7 @@ class Config extends BaseAdminController */ public function getWebsite() { - return success((new ConfigService())->getWebSite()); + return success(( new ConfigService() )->getWebSite()); } /** @@ -33,34 +33,35 @@ class Config extends BaseAdminController public function setWebsite() { $data = $this->request->params([ - ["site_name", ""], - ["logo", ""], - ["keywords", ""], - ["desc", ""], - ["latitude", ""], - ["longitude", ""], - ["province_id", 0], - ["city_id", 0], - ["district_id", 0], - ["address", ""], - ["full_address", ""], - ["phone", ""], - ["business_hours", ""], - ["site_name", ""], - ["logo", ""], - ["front_end_name", ""], - ["front_end_logo", ""], - ["icon", ""] + [ "site_name", "" ], + [ "logo", "" ], + [ "keywords", "" ], + [ "desc", "" ], + [ "latitude", "" ], + [ "longitude", "" ], + [ "province_id", 0 ], + [ "city_id", 0 ], + [ "district_id", 0 ], + [ "address", "" ], + [ "full_address", "" ], + [ "phone", "" ], + [ "business_hours", "" ], + [ "site_name", "" ], + [ "logo", "" ], + [ "front_end_name", "" ], + [ "front_end_logo", "" ], + [ "front_end_icon", "" ], + [ "icon", "" ] ]); $this->validate($data, 'app\validate\site\Site.edit'); - (new ConfigService())->setWebSite($data); + ( new ConfigService() )->setWebSite($data); $service_data = $this->request->params([ - ["wechat_code", ""], - ["enterprise_wechat", ""], - ["tel", ""], + [ "wechat_code", "" ], + [ "enterprise_wechat", "" ], + [ "tel", "" ], ]); - (new ConfigService())->setService($service_data); + ( new ConfigService() )->setService($service_data); return success(); } @@ -71,7 +72,7 @@ class Config extends BaseAdminController */ public function getCopyright() { - return success((new ConfigService())->getCopyright()); + return success(( new ConfigService() )->getCopyright()); } /**设置版权信息 @@ -80,16 +81,16 @@ class Config extends BaseAdminController public function setCopyright() { $data = $this->request->params([ - ['icp', ''], - ['gov_record', ''], - ['gov_url', ''], - ['market_supervision_url', ''], - ['logo', ''], - ['company_name', ''], - ['copyright_link', ''], - ['copyright_desc', ''], + [ 'icp', '' ], + [ 'gov_record', '' ], + [ 'gov_url', '' ], + [ 'market_supervision_url', '' ], + [ 'logo', '' ], + [ 'company_name', '' ], + [ 'copyright_link', '' ], + [ 'copyright_desc', '' ], ]); - (new ConfigService())->setCopyright($data); + ( new ConfigService() )->setCopyright($data); return success(); } @@ -99,7 +100,7 @@ class Config extends BaseAdminController */ public function getSceneDomain() { - return success((new ConfigService())->getSceneDomain()); + return success(( new ConfigService() )->getSceneDomain()); } /** @@ -108,7 +109,7 @@ class Config extends BaseAdminController */ public function getServiceInfo() { - return success((new ConfigService())->getService()); + return success(( new ConfigService() )->getService()); } /**设置版权信息 @@ -117,9 +118,11 @@ class Config extends BaseAdminController public function setMap() { $data = $this->request->params([ - ['key', ''], + [ 'key', '' ], + [ 'is_open', 0 ], // 是否开启定位 + [ 'valid_time', 0 ] // 定位有效期/分钟,过期后将重新获取定位信息,0为不过期 ]); - (new ConfigService())->setMap($data); + ( new ConfigService() )->setMap($data); return success(); } @@ -129,59 +132,7 @@ 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(); - } - - /** - * 获取站点首页列表(如果正在使用is_use = 1) - */ - public function getAdminIndexList() - { - return success((new ConfigService())->getAdminIndexList()); - } - - /** - * 首页配置 - */ - public function setAdminIndex() - { - $data = $this->request->params([ - ['view_path', ''], - ]); - (new ConfigService())->setAdminIndexConfig($data); - return success(); - } - - /** - * 获取手机端首页列表 - */ - public function getWapIndexList() - { - $data = $this->request->params([ - [ 'title', '' ], - [ 'key', '' ] // 多个查询,逗号隔开 - ]); - return success(( new ConfigService() )->getWapIndexList($data)); + return success(( new ConfigService() )->getMap()); } /** @@ -190,9 +141,9 @@ class Config extends BaseAdminController public function setShortcutMenu() { $data = $this->request->params([ - ['menu', []], + [ 'menu', [] ], ]); - (new ConfigService())->setShortcutMenu($data['menu']); + ( new ConfigService() )->setShortcutMenu($data[ 'menu' ]); return success(); } @@ -201,26 +152,52 @@ class Config extends BaseAdminController */ public function getShortcutMenu() { - return success(data: (new ConfigService())->getShortcutMenu()); + return success(data: ( new ConfigService() )->getShortcutMenu()); } /** * 获取开发者key * @return Response */ - public function getDeveloperToken() { - return success(data: (new ConfigService())->getDeveloperToken()); + public function getDeveloperToken() + { + return success(data: ( new ConfigService() )->getDeveloperToken()); } /** * 设置开发者key * @return Response */ - public function setDeveloperToken() { + public function setDeveloperToken() + { $data = $this->request->params([ - ['token', ''], + [ 'token', '' ], ]); - (new ConfigService())->setDeveloperToken($data); + ( new ConfigService() )->setDeveloperToken($data); return success(); } + + /** + * 设置布局设置 + * @return Response + */ + public function setLayout() + { + $data = $this->request->params([ + [ 'key', '' ], + [ 'value', '' ], + ]); + ( new ConfigService() )->setLayout($data); + return success(); + } + + /** + * 获取布局设置 + * @return Response + */ + public function getLayout() + { + return success(data: ( new ConfigService() )->getLayout()); + } + } diff --git a/niucloud/app/adminapi/controller/sys/Export.php b/niucloud/app/adminapi/controller/sys/Export.php new file mode 100644 index 000000000..293b24a8f --- /dev/null +++ b/niucloud/app/adminapi/controller/sys/Export.php @@ -0,0 +1,85 @@ +request->params([ + ['export_key', ''], + ['export_status', ''], + ['create_time', []], + ]); + $res = (new ExportService())->getPage($data); + return success($res); + } + + /** + * 报表导出 + * @param string $type + * @return Response + */ + public function export(string $type){ + $where = $this->request->param(); + return success(data: (new ExportService())->exportData($type, $where)); + } + + /** + * 检查导出数据源是否为空 + * @param string $type + * @return Response + */ + public function check(string $type){ + $where = $this->request->param(); + $check = (new ExportService())->checkExportData($type, $where); + return success($check ? 'SUCCESS' : 'EXPORT_NO_DATA', $check); + } + + /** + * 报表删除 + * @param $id + * @return Response + */ + public function del($id) + { + $res = (new ExportService())->deleteExport($id); + return success('DELETE_SUCCESS'); + } + + /** + * 获取导出状态列表 + * @param string $type + */ + public function getExportStatus() + { + return success((new ExportDict())->getStatus()); + } + + /** + * 获取导出数据类型列表 + * @return Response + */ + public function getExportDataType(){ + return success((new ExportService())->getExportDataType()); + } +} diff --git a/niucloud/app/adminapi/controller/sys/Menu.php b/niucloud/app/adminapi/controller/sys/Menu.php index 71b746fb1..1171de334 100644 --- a/niucloud/app/adminapi/controller/sys/Menu.php +++ b/niucloud/app/adminapi/controller/sys/Menu.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/Poster.php b/niucloud/app/adminapi/controller/sys/Poster.php new file mode 100644 index 000000000..e490bf65c --- /dev/null +++ b/niucloud/app/adminapi/controller/sys/Poster.php @@ -0,0 +1,196 @@ +request->params([ + [ "name", "" ], + [ 'type', '' ] + ]); + return success(( new PosterService() )->getPage($data)); + } + + /** + * 获取自定义海报分页列表 + * @return \think\Response + */ + public function lists() + { + $data = $this->request->params([ + [ "name", "" ], + [ 'type', '' ] + ]); + return success(( new PosterService() )->getList($data)); + } + + /** + * 自定义海报详情 + * @param int $id + * @return \think\Response + */ + public function info(int $id) + { + return success(( new PosterService() )->getInfo($id)); + } + + /** + * 添加自定义海报 + * @return \think\Response + */ + public function add() + { + $data = $this->request->params([ + [ "name", "" ], + [ "type", "" ], + [ "channel", '' ], + [ "value", '' ], + [ "status", '' ], + [ "addon", '' ], + [ 'is_default', 0 ] + ]); + $id = ( new PosterService() )->add($data); + return success('ADD_SUCCESS', [ 'id' => $id ]); + } + + /** + * 自定义海报编辑 + * @param int $id 自定义海报id + * @return \think\Response + */ + public function edit(int $id) + { + $data = $this->request->params([ + [ "name", "" ], + [ "type", "" ], + [ "channel", '' ], + [ "value", '' ], + [ "status", '' ], + [ "addon", '' ], + [ 'is_default', 0 ] + ]); + ( new PosterService() )->edit($id, $data); + return success('EDIT_SUCCESS'); + } + + /** + * 自定义海报删除 + * @param int $id 自定义海报id + * @return \think\Response + */ + public function del(int $id) + { + ( new PosterService() )->del($id); + return success('DELETE_SUCCESS'); + } + + /** + * 修改自定义海报状态 + * @return \think\Response + */ + public function modifyStatus() + { + $data = $this->request->params([ + [ 'id', '' ], + [ 'status', '' ], + ]); + ( new PosterService() )->modifyStatus($data); + return success('SUCCESS'); + } + + /** + * 将自定义海报修改为默认海报 + * @return \think\Response + */ + public function modifyDefault() + { + $data = $this->request->params([ + [ 'id', '' ] + ]); + ( new PosterService() )->modifyDefault($data); + return success('SUCCESS'); + } + + /** + * 获取自定义海报类型 + * @return \think\Response + */ + public function type() + { + $data = $this->request->params([ + [ 'type', '' ] + ]); + return success(( new PosterService() )->getType($data[ 'type' ])); + } + + /** + * 获取自定义海报模版 + * @return \think\Response + */ + public function template() + { + $data = $this->request->params([ + [ 'addon', '' ], + [ 'type', '' ] + ]); + return success(( new PosterService() )->getTemplateList($data[ 'addon' ], $data[ 'type' ])); + } + + /** + * 获取自定义海报初始化数据 + * @return \think\Response + * @throws \think\db\exception\DbException + */ + public function init() + { + $params = $this->request->params([ + [ 'id', "" ], + [ "type", "" ], + [ "name", "" ], + ]); + return success(( new PosterService() )->getInit($params)); + } + + /** + * 获取自定义海报预览 + * @return array|\think\Response + */ + public function preview() + { + $data = $this->request->params([ + [ 'id', 0 ], // 海报id + [ 'type', '' ], // 海报类型 + [ 'param', [ + 'mode' => 'preview', + ] ], // 数据参数 + [ 'channel', 'h5' ] + ]); + return success(data: poster($this->request->siteId(), ...$data)); + } + +} diff --git a/niucloud/app/adminapi/controller/sys/Role.php b/niucloud/app/adminapi/controller/sys/Role.php index 9c1d2edb5..5ba76acff 100644 --- a/niucloud/app/adminapi/controller/sys/Role.php +++ b/niucloud/app/adminapi/controller/sys/Role.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/Schedule.php b/niucloud/app/adminapi/controller/sys/Schedule.php index 1ffd6a43a..a278b0527 100644 --- a/niucloud/app/adminapi/controller/sys/Schedule.php +++ b/niucloud/app/adminapi/controller/sys/Schedule.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/System.php b/niucloud/app/adminapi/controller/sys/System.php index 7ee9ecec7..01f5c71f9 100644 --- a/niucloud/app/adminapi/controller/sys/System.php +++ b/niucloud/app/adminapi/controller/sys/System.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/sys/Ueditor.php b/niucloud/app/adminapi/controller/sys/Ueditor.php new file mode 100644 index 000000000..b00f7953a --- /dev/null +++ b/niucloud/app/adminapi/controller/sys/Ueditor.php @@ -0,0 +1,142 @@ + "SUCCESS", + "imageActionName" => "image", + // 提交的图片表单名称,默认值:upfile + "imageFieldName" => "file", + // 上传大小限制,单位B,默认值:2048000 + "imageMaxSize" => 10485760, + // 上传图片格式显示,默认值:[".png", ".jpg", ".jpeg", ".gif", ".bmp"] + "imageAllowFiles" => [".jpg", ".png", ".jpeg"], + // 是否压缩图片,默认是true + "imageCompressEnable" => true, + // 图片压缩最长边限制,默认值:1600 + "imageCompressBorder" => 5000, + // 插入的图片浮动方式,默认值:none + "imageInsertAlign" => "none", + // 图片访问路径前缀,默认值:空 + "imageUrlPrefix" => url('/', domain: true)->buildUrl(), + // 执行上传涂鸦的action名称,默认值:uploadscrawl + "scrawlActionName" => "crawl", + // 提交的图片表单名称,默认值:upfile + "scrawlFieldName" => "file", + // 上传大小限制,单位B,默认值:2048000 + "scrawlMaxSize" => 10485760, + // 图片访问路径前缀,默认值:空 + "scrawlUrlPrefix" => "", + // 插入的图片浮动方式,默认值:none + "scrawlInsertAlign" => "none", + // 执行上传截图的action名称,默认值:uploadimage + "snapscreenActionName" => "snap", + // 图片访问路径前缀 + "snapscreenUrlPrefix" => "", + // 插入的图片浮动方式,默认值:none + "snapscreenInsertAlign" => "none", + // 例外的图片抓取域名 + "catcherLocalDomain" => array("127.0.0.1", "localhost"), + // 执行抓取远程图片的action名称,默认值:catchimage + "catcherActionName" => "catch", + // 提交的图片列表表单名称,默认值:source + "catcherFieldName" => "source", + // 图片访问路径前缀,默认值:空 + "catcherUrlPrefix" => "", + // 上传保存路径,可以自定义保存路径和文件名格式,默认值:{filename}{rand:6} + "catcherMaxSize" => 10485760, + // 抓取图片格式显示,默认值:[".png", ".jpg", ".jpeg", ".gif", ".bmp"] + "catcherAllowFiles" => [".jpg", ".png", ".jpeg"], + // 执行上传视频的action名称,默认值:uploadvideo + "videoActionName" => "video", + // 提交的视频表单名称,默认值:upfile + "videoFieldName" => "file", + // 视频访问路径前缀 + "videoUrlPrefix" => url('/', domain: true)->buildUrl(), + // 上传大小限制,单位B,默认值:102400000 + "videoMaxSize" => 104857600, + // 上传视频格式显示 + "videoAllowFiles" => [".mp4"], + // 执行上传文件的action名称,默认值:uploadfile + "fileActionName" => "file", + // 提交的文件表单名称,默认值:upfile + "fileFieldName" => "file", + // 文件访问路径前缀 + "fileUrlPrefix" => "", + // 上传保存路径,可以自定义保存路径和文件名格式,默认值:{filename}{rand:6} + "fileMaxSize" => 104857600, + // 上传文件格式显示 + "fileAllowFiles" => [".zip", ".pdf", ".doc"], + // 执行图片管理的action名称,默认值:listimage + "imageManagerActionName" => "listImage", + // 每次列出文件数量 + "imageManagerListSize" => 20, + // 图片访问路径前缀 + "imageManagerUrlPrefix" => "", + // 插入的图片浮动方式,默认值:none + "imageManagerInsertAlign" => "none", + // 列出的文件类型 + "imageManagerAllowFiles" => [".jpg", ".png", ".jpeg"], + // 执行文件管理的action名称,默认值:listfile + "fileManagerActionName" => "listFile", + // 指定要列出文件的目录 + "fileManagerUrlPrefix" => "", + // 每次列出文件数量 + "fileManagerListSize" => 20, + // 列出的文件类型 + "fileManagerAllowFiles" => [".zip", ".pdf", ".doc"], + // 公式配置 + "formulaConfig" => [ + // 公式渲染的路径 + "imageUrlTemplate" => url('/', domain: true)->buildUrl() . "{}" + ] + ], 'json', 200); + } + + public function upload() { + $data = $this->request->params([ + ['action', ''], + ['file', 'file'], + ]); + $upload_service = new UploadService(); + + switch ($data['action']) { + case 'image': + $upload_res = $upload_service->image($data['file']); + return Response::create([ + 'state' => 'SUCCESS', + 'url' => $upload_res['url'], + 'title' => $upload_res['url'], + 'original' => $upload_res['url'], + ], 'json', 200); + break; + case 'video': + $upload_res = $upload_service->video($data['file']); + return Response::create([ + 'state' => 'SUCCESS', + 'url' => $upload_res['url'], + 'title' => $upload_res['url'], + 'original' => $upload_res['url'], + ], 'json', 200); + break; + } + } +} diff --git a/niucloud/app/adminapi/controller/upload/Storage.php b/niucloud/app/adminapi/controller/upload/Storage.php index 6a486e396..9e38c3cfd 100644 --- a/niucloud/app/adminapi/controller/upload/Storage.php +++ b/niucloud/app/adminapi/controller/upload/Storage.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/upload/Upload.php b/niucloud/app/adminapi/controller/upload/Upload.php index 79efca276..5eeb118ff 100644 --- a/niucloud/app/adminapi/controller/upload/Upload.php +++ b/niucloud/app/adminapi/controller/upload/Upload.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/user/User.php b/niucloud/app/adminapi/controller/user/User.php index 924b868ff..be141db89 100644 --- a/niucloud/app/adminapi/controller/user/User.php +++ b/niucloud/app/adminapi/controller/user/User.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/verify/Verifier.php b/niucloud/app/adminapi/controller/verify/Verifier.php new file mode 100644 index 000000000..a84f891d1 --- /dev/null +++ b/niucloud/app/adminapi/controller/verify/Verifier.php @@ -0,0 +1,60 @@ +getPage()); + } + + /** + * 添加核销员 + * @param int $order_id + * @return Response + */ + public function add() + { + $data = $this->request->params([ + ['member_id', 0], + ['verify_type', ''], + ]); + return success(data:(new VerifierService())->add($data)); + } + + /** + * 删除核销员 + */ + public function del(int $id) + { + return success('DELETE_SUCCESS', (new VerifierService())->del($id)); + } + + /** + * 获取核销类型 + * @return Response + */ + public function getVerifyType() + { + return success(VerifyDict::getType()); + } +} diff --git a/niucloud/app/adminapi/controller/verify/Verify.php b/niucloud/app/adminapi/controller/verify/Verify.php new file mode 100644 index 000000000..7585122da --- /dev/null +++ b/niucloud/app/adminapi/controller/verify/Verify.php @@ -0,0 +1,44 @@ +request->params([ + ['relate_tag', 0], + ['type', ''], + ['code', ''], + ['create_time', []] + ]); + return success((new VerifyService())->getPage($data)); + } + + /** + * 核销信息 + * @param int $order_id + * @return Response + */ + public function detail(string $verify_code) + { + return success((new VerifyService())->getDetail($verify_code)); + } +} diff --git a/niucloud/app/adminapi/controller/weapp/Config.php b/niucloud/app/adminapi/controller/weapp/Config.php index 31a229c70..58fb4ae7e 100644 --- a/niucloud/app/adminapi/controller/weapp/Config.php +++ b/niucloud/app/adminapi/controller/weapp/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/weapp/Delivery.php b/niucloud/app/adminapi/controller/weapp/Delivery.php new file mode 100644 index 000000000..51eee4a90 --- /dev/null +++ b/niucloud/app/adminapi/controller/weapp/Delivery.php @@ -0,0 +1,43 @@ +getIsTradeManaged(); + if ($result) { + return success([ 'is_trade_managed' => true ]); + } + + } catch (\Exception $e) { + } + return success([ 'is_trade_managed' => false ]); + } + +} diff --git a/niucloud/app/adminapi/controller/weapp/Package.php b/niucloud/app/adminapi/controller/weapp/Package.php index c9a0831b4..f27b59ac1 100644 --- a/niucloud/app/adminapi/controller/weapp/Package.php +++ b/niucloud/app/adminapi/controller/weapp/Package.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/weapp/Template.php b/niucloud/app/adminapi/controller/weapp/Template.php index 954b1c312..216c2342d 100644 --- a/niucloud/app/adminapi/controller/weapp/Template.php +++ b/niucloud/app/adminapi/controller/weapp/Template.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -42,7 +42,8 @@ class Template extends BaseAdminController ['keys', []] ]); $weapp_template_service = new WeappTemplateService(); - return success($weapp_template_service->syncAll($data['keys'])); + $weapp_template_service->syncAll($data['keys']); + return success('SUCCESS'); } } diff --git a/niucloud/app/adminapi/controller/wechat/Config.php b/niucloud/app/adminapi/controller/wechat/Config.php index 4b98a5633..b78efa397 100644 --- a/niucloud/app/adminapi/controller/wechat/Config.php +++ b/niucloud/app/adminapi/controller/wechat/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/wechat/Media.php b/niucloud/app/adminapi/controller/wechat/Media.php index 5dcfda0e3..8330f32f7 100644 --- a/niucloud/app/adminapi/controller/wechat/Media.php +++ b/niucloud/app/adminapi/controller/wechat/Media.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/wechat/Menu.php b/niucloud/app/adminapi/controller/wechat/Menu.php index 881ce5f06..7f863d4be 100644 --- a/niucloud/app/adminapi/controller/wechat/Menu.php +++ b/niucloud/app/adminapi/controller/wechat/Menu.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/wechat/Reply.php b/niucloud/app/adminapi/controller/wechat/Reply.php index ccb50e6f7..676bbe0db 100644 --- a/niucloud/app/adminapi/controller/wechat/Reply.php +++ b/niucloud/app/adminapi/controller/wechat/Reply.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/controller/wechat/Template.php b/niucloud/app/adminapi/controller/wechat/Template.php index b95dc4696..d450591b3 100644 --- a/niucloud/app/adminapi/controller/wechat/Template.php +++ b/niucloud/app/adminapi/controller/wechat/Template.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/middleware/AdminCheckRole.php b/niucloud/app/adminapi/middleware/AdminCheckRole.php index ae3c57d6b..6b4b62a12 100644 --- a/niucloud/app/adminapi/middleware/AdminCheckRole.php +++ b/niucloud/app/adminapi/middleware/AdminCheckRole.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/middleware/AdminCheckToken.php b/niucloud/app/adminapi/middleware/AdminCheckToken.php index 6eb9f58d5..ed9b40628 100644 --- a/niucloud/app/adminapi/middleware/AdminCheckToken.php +++ b/niucloud/app/adminapi/middleware/AdminCheckToken.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/middleware/AdminLog.php b/niucloud/app/adminapi/middleware/AdminLog.php index 46ce90c21..361b22d2d 100644 --- a/niucloud/app/adminapi/middleware/AdminLog.php +++ b/niucloud/app/adminapi/middleware/AdminLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/middleware/AllowCrossDomain.php b/niucloud/app/adminapi/middleware/AllowCrossDomain.php index d6baf409e..c30d3e27c 100644 --- a/niucloud/app/adminapi/middleware/AllowCrossDomain.php +++ b/niucloud/app/adminapi/middleware/AllowCrossDomain.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/addon.php b/niucloud/app/adminapi/route/addon.php index e6a70e1fd..61c12a4a7 100644 --- a/niucloud/app/adminapi/route/addon.php +++ b/niucloud/app/adminapi/route/addon.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -70,7 +70,8 @@ Route::group(function () { Route::post('addon_develop/build/:key', 'addon.AddonDevelop/build'); //下载插件 Route::post('addon_develop/download/:key', 'addon.AddonDevelop/download'); - + //插件标识黑名单 + Route::get('addon_develop/key/blacklist', 'addon.AddonDevelop/keyBlackList'); })->middleware([ AdminCheckToken::class, AdminCheckRole::class, diff --git a/niucloud/app/adminapi/route/aliapp.php b/niucloud/app/adminapi/route/aliapp.php index c5c25da75..0f718ed30 100644 --- a/niucloud/app/adminapi/route/aliapp.php +++ b/niucloud/app/adminapi/route/aliapp.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/app.php b/niucloud/app/adminapi/route/app.php index 4aa83b79e..ff86d520f 100644 --- a/niucloud/app/adminapi/route/app.php +++ b/niucloud/app/adminapi/route/app.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/applet.php b/niucloud/app/adminapi/route/applet.php index b07c14a9a..56ab1c55d 100644 --- a/niucloud/app/adminapi/route/applet.php +++ b/niucloud/app/adminapi/route/applet.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/auth.php b/niucloud/app/adminapi/route/auth.php index 45fe90d8f..0c65b23f8 100644 --- a/niucloud/app/adminapi/route/auth.php +++ b/niucloud/app/adminapi/route/auth.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/channel.php b/niucloud/app/adminapi/route/channel.php index ac9736184..2b0660e5a 100644 --- a/niucloud/app/adminapi/route/channel.php +++ b/niucloud/app/adminapi/route/channel.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/home.php b/niucloud/app/adminapi/route/home.php index 12a096359..134c67da2 100644 --- a/niucloud/app/adminapi/route/home.php +++ b/niucloud/app/adminapi/route/home.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/member.php b/niucloud/app/adminapi/route/member.php index 6538683c9..a2259be9d 100644 --- a/niucloud/app/adminapi/route/member.php +++ b/niucloud/app/adminapi/route/member.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -32,6 +32,8 @@ Route::group('member', function () { Route::get('memberno', 'member.Member/getMemberNo'); //会员添加 Route::put('member/:member_id', 'member.Member/edit');//会员添加 + //会员导出 + Route::get('member/export', 'member.Member/export'); Route::put('member/modify/:member_id/:field', 'member.Member/modify'); //会员注册方式 @@ -66,6 +68,8 @@ Route::group('member', function () { Route::get('account/balance', 'member.Account/balance'); //会员可提现余额流水 Route::get('account/money', 'member.Account/money'); + //会员成长值流水 + Route::get('account/growth', 'member.Account/growth'); //会员佣金流水 Route::get('account/commission', 'member.Account/commission'); //会员佣金统计 @@ -76,8 +80,6 @@ Route::group('member', function () { Route::post('account/point', 'member.Account/adjustPoint'); //会员余额调整 Route::post('account/balance', 'member.Account/adjustBalance'); - //会员零钱调整 - Route::post('account/money', 'member.Account/adjustMoney'); //会员账户类型变动方式 Route::get('account/change_type/:account_type', 'member.Account/changeType'); //会员账户类型变动方式 @@ -91,6 +93,14 @@ Route::group('member', function () { Route::get('config/cash_out', 'member.Config/getCashOutConfig'); //更新提现设置 Route::post('config/cash_out', 'member.Config/setCashOutConfig'); + //获取成长值规则设置 + Route::get('config/growth_rule', 'member.Config/getGrowthRuleConfig'); + //设置成长值规则 + Route::post('config/growth_rule', 'member.Config/setGrowthRuleConfig'); + //获取积分规则设置 + Route::get('config/point_rule', 'member.Config/getPointRuleConfig'); + //设置积分规则 + Route::post('config/point_rule', 'member.Config/setPointRuleConfig'); /***************************************************** 会员体现**************************************************/ //会员提现列表 Route::get('cash_out', 'member.CashOut/lists'); @@ -110,8 +120,42 @@ Route::group('member', function () { Route::get('config/member', 'member.Config/getMemberConfig'); //更新注册与登录设置 Route::post('config/member', 'member.Config/setMemberConfig'); + // 获取会员权益字典 + Route::get('dict/benefits', 'member.Member/getMemberBenefitsDict'); + // 获取会员礼包字典 + Route::get('dict/gift', 'member.Member/getMemberGiftDict'); + // 获取成长值规则字典 + Route::get('dict/growth_rule', 'member.Member/getGrowthRuleDict'); + // 获取积分规则字典 + Route::get('dict/point_rule', 'member.Member/getPointRuleDict'); + /***************************************************** 会员等级 ****************************************************/ + //会员等级分页列表 + Route::get('level', 'member.MemberLevel/pages'); + //会员等级列表 + Route::get('level/list', 'member.MemberLevel/lists'); + //会员等级详情 + Route::get('level/:id', 'member.MemberLevel/info'); + //会员等级添加 + Route::post('level', 'member.MemberLevel/add'); + //会员等级编辑 + Route::put('level/:id', 'member.MemberLevel/edit'); + //会员等级删除 + Route::delete('level/:id', 'member.MemberLevel/del'); + //全部会员等级 + Route::get('level/all', 'member.MemberLevel/getAll'); + // 获取会员权益内容 + Route::get('benefits/content', 'member.Member/getMemberBenefitsContent'); + // 获取会员礼包内容 + Route::get('gifts/content', 'member.Member/getMemberGiftsContent'); + /***************************************************** 会员签到 ****************************************************/ + //签到设置 + Route::put('sign/config', 'member.MemberSign/setSign'); + //签到设置 + Route::get('sign/config', 'member.MemberSign/getSign'); + //签到记录 + Route::get('sign', 'member.MemberSign/lists'); })->middleware([ AdminCheckToken::class, AdminCheckRole::class, AdminLog::class -]); \ No newline at end of file +]); diff --git a/niucloud/app/adminapi/route/niucloud.php b/niucloud/app/adminapi/route/niucloud.php index d1a399e37..d7fda56cd 100644 --- a/niucloud/app/adminapi/route/niucloud.php +++ b/niucloud/app/adminapi/route/niucloud.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/notice.php b/niucloud/app/adminapi/route/notice.php index 5002c482e..6365c4feb 100644 --- a/niucloud/app/adminapi/route/notice.php +++ b/niucloud/app/adminapi/route/notice.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/pay.php b/niucloud/app/adminapi/route/pay.php index e140588f0..413aa3d74 100644 --- a/niucloud/app/adminapi/route/pay.php +++ b/niucloud/app/adminapi/route/pay.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/route.php b/niucloud/app/adminapi/route/route.php index 46f2e0aab..a1d9ad5ad 100644 --- a/niucloud/app/adminapi/route/route.php +++ b/niucloud/app/adminapi/route/route.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/site.php b/niucloud/app/adminapi/route/site.php index ca13a605b..486734801 100644 --- a/niucloud/app/adminapi/route/site.php +++ b/niucloud/app/adminapi/route/site.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/stat.php b/niucloud/app/adminapi/route/stat.php index 60ee2039d..ea3144374 100644 --- a/niucloud/app/adminapi/route/stat.php +++ b/niucloud/app/adminapi/route/stat.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/sys.php b/niucloud/app/adminapi/route/sys.php index 8addde494..2390f72bc 100644 --- a/niucloud/app/adminapi/route/sys.php +++ b/niucloud/app/adminapi/route/sys.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -18,7 +18,7 @@ use think\facade\Route; /** * 路由 */ -Route::group('sys', function () { +Route::group('sys', function() { /***************************************************** 系统整体信息 *************************************************/ //系统信息 Route::get('info', 'sys.System/info'); @@ -106,6 +106,11 @@ Route::group('sys', function () { // 开发者key Route::get('config/developer_token', 'sys.Config/getDeveloperToken'); + // 布局设置 + Route::get('config/layout', 'sys.Config/getLayout'); + // 布局设置 + Route::put('config/layout', 'sys.Config/setLayout'); + /***************************************************** 图片上传 ****************************************************/ //附件图片上传 Route::post('image', 'upload.Upload/image'); @@ -209,6 +214,64 @@ Route::group('sys', function () { /***************************************************** 获取布局 ****************************************************/ Route::get('layout', 'sys.System/layout'); Route::put('layout', 'sys.System/setLayout'); + /***************************************************** 获取导出数据 ****************************************************/ + //报表导出列表 + Route::get('export', 'sys.Export/lists'); + //报表导出状态列表 + Route::get('export/status', 'sys.Export/getExportStatus'); + //报表导出类型 + Route::get('export/type', 'sys.Export/getExportDataType'); + //报表导出数据检查 + Route::get('export/check/:type', 'sys.Export/check'); + //报表导出 + Route::get('export/:type', 'sys.Export/export'); + //报表删除 + Route::delete('export/:id', 'sys.Export/del'); + + /***************************************************** 自定义海报管理 ****************************************************/ + + // 自定义海报分页列表 + Route::get('poster', 'sys.Poster/pages'); + + // 自定义海报列表 + Route::get('poster/list', 'sys.Poster/lists'); + + // 自定义海报信息 + Route::get('poster/:id', 'sys.Poster/info'); + + // 添加自定义海报 + Route::post('poster', 'sys.Poster/add'); + + // 编辑自定义海报 + Route::put('poster/:id', 'sys.Poster/edit'); + + // 删除自定义海报 + Route::delete('poster/:id', 'sys.Poster/del'); + + // 修改自定义海报状态 + Route::put('poster/status', 'sys.Poster/modifyStatus'); + + // 将自定义海报修改为默认海报 + Route::put('poster/default', 'sys.Poster/modifyDefault'); + + // 自定义海报类型 + Route::get('poster/type', 'sys.Poster/type'); + + // 自定义海报模板 + Route::get('poster/template', 'sys.Poster/template'); + + // 自定义海报初始化数据 + Route::get('poster/init', 'sys.Poster/init'); + + // 自定义海报预览 + Route::get('poster/preview', 'sys.Poster/preview'); + + /***************************************************** 百度编辑器 ****************************************************/ + // 获取百度编辑器配置 + Route::get('ueditor', 'sys.Ueditor/getConfig'); + // 百度编辑器文件上传 + Route::post('ueditor', 'sys.Ueditor/upload'); + })->middleware([ AdminCheckToken::class, AdminCheckRole::class, @@ -216,8 +279,10 @@ Route::group('sys', function () { ]); //系统环境(不效验登录状态) -Route::group('sys', function () { +Route::group('sys', function() { Route::get('web/website', 'sys.Config/getWebsite'); // 获取版权信息 Route::get('web/copyright', 'sys.Config/getCopyright'); + // 查询布局设置 + Route::get('web/layout', 'sys.Config/getLayout'); }); diff --git a/niucloud/app/adminapi/route/upgrade.php b/niucloud/app/adminapi/route/upgrade.php index b15077da9..8f4f65f99 100644 --- a/niucloud/app/adminapi/route/upgrade.php +++ b/niucloud/app/adminapi/route/upgrade.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/upload.php b/niucloud/app/adminapi/route/upload.php index 030f6eab9..a05fd61a7 100644 --- a/niucloud/app/adminapi/route/upload.php +++ b/niucloud/app/adminapi/route/upload.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/user.php b/niucloud/app/adminapi/route/user.php index 6fba29fa5..629c2dfc1 100644 --- a/niucloud/app/adminapi/route/user.php +++ b/niucloud/app/adminapi/route/user.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/adminapi/route/verify.php b/niucloud/app/adminapi/route/verify.php new file mode 100644 index 000000000..fa0a67394 --- /dev/null +++ b/niucloud/app/adminapi/route/verify.php @@ -0,0 +1,42 @@ +middleware([ + AdminCheckToken::class, + AdminCheckRole::class, + AdminLog::class +]); diff --git a/niucloud/app/adminapi/route/weapp.php b/niucloud/app/adminapi/route/weapp.php index 8d98310f1..2a9a8b68b 100644 --- a/niucloud/app/adminapi/route/weapp.php +++ b/niucloud/app/adminapi/route/weapp.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -18,7 +18,7 @@ use think\facade\Route; /** * 路由 */ -Route::group('weapp', function () { +Route::group('weapp', function() { /***************************************************** 微信配置 ****************************************************/ Route::get('config', 'weapp.Config/get'); @@ -39,6 +39,13 @@ Route::group('weapp', function () { Route::get('preview', 'weapp.Version/preview'); //获取小程序上传日志 Route::get('upload/:key', 'weapp.Version/uploadLog'); + + + /***************************************************** 小程序发货信息管理服务 ****************************************************/ + + // 查询小程序是否已开通发货信息管理服务 + Route::get('delivery/getIsTradeManaged', 'weapp.Delivery/getIsTradeManaged'); + })->middleware([ AdminCheckToken::class, AdminCheckRole::class, diff --git a/niucloud/app/adminapi/route/wechat.php b/niucloud/app/adminapi/route/wechat.php index 054af7ce2..8344b337d 100644 --- a/niucloud/app/adminapi/route/wechat.php +++ b/niucloud/app/adminapi/route/wechat.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/config/config.php b/niucloud/app/api/config/config.php index 9e9d39970..c8e10c50e 100644 --- a/niucloud/app/api/config/config.php +++ b/niucloud/app/api/config/config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/config/route.php b/niucloud/app/api/config/route.php index 030366974..207dac3a8 100644 --- a/niucloud/app/api/config/route.php +++ b/niucloud/app/api/config/route.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/addon/Addon.php b/niucloud/app/api/controller/addon/Addon.php new file mode 100644 index 000000000..0842a1fff --- /dev/null +++ b/niucloud/app/api/controller/addon/Addon.php @@ -0,0 +1,28 @@ +getInstallList()); + } +} diff --git a/niucloud/app/api/controller/agreement/Agreement.php b/niucloud/app/api/controller/agreement/Agreement.php index 3810a8f47..f3407c427 100644 --- a/niucloud/app/api/controller/agreement/Agreement.php +++ b/niucloud/app/api/controller/agreement/Agreement.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/article/Article.php b/niucloud/app/api/controller/article/Article.php index 0744b6dd4..7631382d8 100644 --- a/niucloud/app/api/controller/article/Article.php +++ b/niucloud/app/api/controller/article/Article.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/article/ArticleCategory.php b/niucloud/app/api/controller/article/ArticleCategory.php index bef562201..2e550f9b9 100644 --- a/niucloud/app/api/controller/article/ArticleCategory.php +++ b/niucloud/app/api/controller/article/ArticleCategory.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/diy/Diy.php b/niucloud/app/api/controller/diy/Diy.php index 78b8d026a..744945a0f 100644 --- a/niucloud/app/api/controller/diy/Diy.php +++ b/niucloud/app/api/controller/diy/Diy.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/login/Config.php b/niucloud/app/api/controller/login/Config.php index f917652fa..182ddcf44 100644 --- a/niucloud/app/api/controller/login/Config.php +++ b/niucloud/app/api/controller/login/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/login/Login.php b/niucloud/app/api/controller/login/Login.php index 11d97d7f8..3f4dd3734 100644 --- a/niucloud/app/api/controller/login/Login.php +++ b/niucloud/app/api/controller/login/Login.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/login/Register.php b/niucloud/app/api/controller/login/Register.php index d56fb8fbf..f8681ef47 100644 --- a/niucloud/app/api/controller/login/Register.php +++ b/niucloud/app/api/controller/login/Register.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/member/Account.php b/niucloud/app/api/controller/member/Account.php index db65679bb..5c5d1ed92 100644 --- a/niucloud/app/api/controller/member/Account.php +++ b/niucloud/app/api/controller/member/Account.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/member/CashOutAccount.php b/niucloud/app/api/controller/member/CashOutAccount.php index f65b291b1..f2b510c6d 100644 --- a/niucloud/app/api/controller/member/CashOutAccount.php +++ b/niucloud/app/api/controller/member/CashOutAccount.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/member/Level.php b/niucloud/app/api/controller/member/Level.php new file mode 100644 index 000000000..8811738e9 --- /dev/null +++ b/niucloud/app/api/controller/member/Level.php @@ -0,0 +1,22 @@ +getList()); + } +} diff --git a/niucloud/app/api/controller/member/Member.php b/niucloud/app/api/controller/member/Member.php index 00ae9a3f0..aab444afb 100644 --- a/niucloud/app/api/controller/member/Member.php +++ b/niucloud/app/api/controller/member/Member.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/member/MemberCashOut.php b/niucloud/app/api/controller/member/MemberCashOut.php index 545fdfb56..07feb211e 100644 --- a/niucloud/app/api/controller/member/MemberCashOut.php +++ b/niucloud/app/api/controller/member/MemberCashOut.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -75,7 +75,7 @@ class MemberCashOut extends BaseApiController [ 'account_id', 0 ] ]); $this->validate($data, 'app\validate\member\CashOut.apply'); - return success(( new MemberCashOutService() )->apply($data)); + return success(data:( new MemberCashOutService() )->apply($data)); } /** @@ -85,7 +85,7 @@ class MemberCashOut extends BaseApiController */ public function cancel($id) { - return success(( new MemberCashOutService() )->cancel($id)); + return success(data:( new MemberCashOutService() )->cancel($id)); } } diff --git a/niucloud/app/api/controller/member/MemberSign.php b/niucloud/app/api/controller/member/MemberSign.php new file mode 100644 index 000000000..acf46f18d --- /dev/null +++ b/niucloud/app/api/controller/member/MemberSign.php @@ -0,0 +1,80 @@ +getPage()); + } + + /** + * 签到详情 + * @return Response + */ + public function info($sign_id) + { + return success(( new MemberSignService() )->getInfo($sign_id)); + } + + /** + * 会员签到 + * @return Response + */ + public function sign() + { + return success(( new MemberSignService() )->sign()); + } + + /** + * 获取月签到数据 + * @param $year + * @param $month + * @return Response + */ + public function signInfo($year, $month) + { + return success(( new MemberSignService() )->getSignInfo($year, $month)); + } + + /** + * 获取日签到奖励 + * @param $year + * @param $month + * @param $day + * @return Response + */ + public function getDayAward($year, $month, $day) + { + return success(( new MemberSignService() )->getDayAward($year, $month, $day)); + } + + /** + * 获取签到设置 + * @return Response + */ + public function signConfig() + { + return success(( new MemberSignService() )->getSignConfig()); + } + +} diff --git a/niucloud/app/api/controller/pay/Pay.php b/niucloud/app/api/controller/pay/Pay.php index f58ede3de..0bc562559 100644 --- a/niucloud/app/api/controller/pay/Pay.php +++ b/niucloud/app/api/controller/pay/Pay.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/poster/Poster.php b/niucloud/app/api/controller/poster/Poster.php index 97f355655..f5dd155ef 100644 --- a/niucloud/app/api/controller/poster/Poster.php +++ b/niucloud/app/api/controller/poster/Poster.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -21,17 +21,17 @@ class Poster extends BaseApiController /** * 获取海报 - * @return void|null + * @return \think\Response */ public function poster() { $data = $this->request->params([ - ['type', ''],//业务类型 - ['param', []],//参数1 + [ 'id', 0 ], // 海报id + [ 'type', '' ], // 海报类型 + [ 'param', [] ], // 数据参数 ]); - $data['channel'] = $this->request->getChannel(); + $data[ 'channel' ] = $this->request->getChannel(); return success(data: poster($this->request->siteId(), ...$data)); } - } diff --git a/niucloud/app/api/controller/sys/Config.php b/niucloud/app/api/controller/sys/Config.php index e12bf6be7..980adad9b 100644 --- a/niucloud/app/api/controller/sys/Config.php +++ b/niucloud/app/api/controller/sys/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -57,4 +57,13 @@ class Config extends BaseApiController ]); return success(( new ConfigService() )->getWapIndexList($data)); } + + /** + * 获取地图配置 + * @return Response + */ + public function getMap() + { + return success(( new ConfigService() )->getMap()); + } } diff --git a/niucloud/app/api/controller/sys/Index.php b/niucloud/app/api/controller/sys/Index.php index 9080fd93f..8bd027bc5 100644 --- a/niucloud/app/api/controller/sys/Index.php +++ b/niucloud/app/api/controller/sys/Index.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/sys/Scan.php b/niucloud/app/api/controller/sys/Scan.php index ef638d3cc..fe2694d44 100644 --- a/niucloud/app/api/controller/sys/Scan.php +++ b/niucloud/app/api/controller/sys/Scan.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/sys/Task.php b/niucloud/app/api/controller/sys/Task.php new file mode 100644 index 000000000..324c49446 --- /dev/null +++ b/niucloud/app/api/controller/sys/Task.php @@ -0,0 +1,37 @@ +getGrowthTask()); + } + + /** + * 积分任务 + * @return Response + */ + public function point() { + return success((new TaskService())->getPointTask()); + } + +} diff --git a/niucloud/app/api/controller/sys/Verify.php b/niucloud/app/api/controller/sys/Verify.php new file mode 100644 index 000000000..9bf177f30 --- /dev/null +++ b/niucloud/app/api/controller/sys/Verify.php @@ -0,0 +1,81 @@ +request->params([ + ['data', []], + ['type', ''] + ]); + return success(data:(new VerifyService())->getVerifyCode($data['type'], $data['data'])); + } + + /** + * 获取核销码信息 + * @param $code + * @return Response + */ + public function getInfoByCode($code){ + return success(data:(new VerifyService())->getInfoByCode($code)); + } + /** + * 核销 + * @param $code + * @return Response + */ + public function verify($code){ + return success(data:(new VerifyService())->verify($code)); + } + /** + * 校验是否是核销员 + * @return Response + */ + public function checkVerifier(){ + return success(data:(new VerifyService())->checkVerifier()); + } + + /** + * 核销记录 + * @return void + */ + public function records(){ + $data = $this->request->params([ + ['relate_tag', 0], + ['type', ''], + ['code', ''], + ['create_time', []] + ]); + return success(data:(new VerifyService())->getRecordsPageByVerifier($data)); + } + + /** + * 获取核销详情 + * @param $code + * @return Response + */ + public function detail(string|int $code){ + return success(data:(new VerifyService())->getRecordsDetailByVerifier($code)); + + } +} diff --git a/niucloud/app/api/controller/upload/Upload.php b/niucloud/app/api/controller/upload/Upload.php index 9a3b331e5..4b7f1c646 100644 --- a/niucloud/app/api/controller/upload/Upload.php +++ b/niucloud/app/api/controller/upload/Upload.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/weapp/Weapp.php b/niucloud/app/api/controller/weapp/Weapp.php index 3ec070ea5..d6bc314d7 100644 --- a/niucloud/app/api/controller/weapp/Weapp.php +++ b/niucloud/app/api/controller/weapp/Weapp.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -13,8 +13,8 @@ namespace app\api\controller\weapp; use app\service\api\notice\NoticeService; use app\service\api\weapp\WeappAuthService; +use app\service\api\weapp\WeappDeliveryService; use core\base\BaseApiController; -use EasyWeChat\Kernel\Exceptions\InvalidArgumentException; use think\Response; class Weapp extends BaseApiController @@ -24,30 +24,69 @@ class Weapp extends BaseApiController * 授权登录 * @return Response */ - public function login(){ - $data = $this->request->params([['code', '']]); + public function login() + { + $data = $this->request->params([ [ 'code', '' ] ]); $weapp_auth_service = new WeappAuthService(); - return success($weapp_auth_service->login($data['code'])); + return success($weapp_auth_service->login($data[ 'code' ])); } /** * 注册 * @return Response */ - public function register(){ + public function register() + { $data = $this->request->params([ - ['openid', ''], - ['mobile_code', ''], - ['mobile', ''], + [ 'openid', '' ], + [ 'unionid', '' ], + [ 'mobile_code', '' ], + [ 'mobile', '' ], ]); $weapp_auth_service = new WeappAuthService(); - return success($weapp_auth_service->register($data['openid'], $data['mobile'], $data['mobile_code'])); + return success($weapp_auth_service->register($data[ 'openid' ], $data[ 'mobile' ], $data[ 'mobile_code' ], $data[ 'unionid' ])); } - public function subscribeMessage(){ - $data = $this->request->params([ ['keys', ''] ]); - return success((new NoticeService())->getWeappNoticeTemplateId($data['keys'])); + public function subscribeMessage() + { + $data = $this->request->params([ [ 'keys', '' ] ]); + return success(( new NoticeService() )->getWeappNoticeTemplateId($data[ 'keys' ])); } + + /** + * 查询小程序是否已开通发货信息管理服务 + * @return bool + * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException + */ + public function getIsTradeManaged() + { + try { + $wechat_template_service = new WeappDeliveryService(); + $result = $wechat_template_service->getIsTradeManaged(); + if ($result) { + return success([ 'is_trade_managed' => true ]); + } + + } catch (\Exception $e) { + } + return success([ 'is_trade_managed' => false ]); + } + + /** + * 通过外部交易号获取消息跳转路径 + */ + public function getMsgJumpPath() + { + $data = $this->request->params([ + [ 'out_trade_no', '' ], + ]); + + $wechat_template_service = new WeappDeliveryService(); + $result = $wechat_template_service->getMsgJumpPath($data[ 'out_trade_no' ]); + return success([ 'path' => $result ]); + + } + } diff --git a/niucloud/app/api/controller/wechat/Serve.php b/niucloud/app/api/controller/wechat/Serve.php index 7bd165a13..a59ae3132 100644 --- a/niucloud/app/api/controller/wechat/Serve.php +++ b/niucloud/app/api/controller/wechat/Serve.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/controller/wechat/Wechat.php b/niucloud/app/api/controller/wechat/Wechat.php index 914bcbfa2..db5454a3f 100644 --- a/niucloud/app/api/controller/wechat/Wechat.php +++ b/niucloud/app/api/controller/wechat/Wechat.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -58,6 +58,7 @@ class Wechat extends BaseController public function register(){ $data = $this->request->params([ ['openid', ''], + ['unionid', ''], ['mobile', ''], ]); //参数验证 @@ -65,7 +66,7 @@ class Wechat extends BaseController 'mobile' => 'mobile' ]); $wechat_auth_service = new WechatAuthService(); - return success($wechat_auth_service->register($data['openid'], $data['mobile'])); + return success($wechat_auth_service->register($data['openid'], $data['mobile'], wx_unionid: $data['unionid'])); } /** diff --git a/niucloud/app/api/middleware/AllowCrossDomain.php b/niucloud/app/api/middleware/AllowCrossDomain.php index 75014fe8f..f0a3f4ebd 100644 --- a/niucloud/app/api/middleware/AllowCrossDomain.php +++ b/niucloud/app/api/middleware/AllowCrossDomain.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/middleware/ApiChannel.php b/niucloud/app/api/middleware/ApiChannel.php index ccbaba79a..ae89c41d3 100644 --- a/niucloud/app/api/middleware/ApiChannel.php +++ b/niucloud/app/api/middleware/ApiChannel.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/middleware/ApiCheckToken.php b/niucloud/app/api/middleware/ApiCheckToken.php index 8299de62b..85a5d15de 100644 --- a/niucloud/app/api/middleware/ApiCheckToken.php +++ b/niucloud/app/api/middleware/ApiCheckToken.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/middleware/ApiLog.php b/niucloud/app/api/middleware/ApiLog.php index 1f0d31d06..33d044e72 100644 --- a/niucloud/app/api/middleware/ApiLog.php +++ b/niucloud/app/api/middleware/ApiLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/route/addon.php b/niucloud/app/api/route/addon.php new file mode 100644 index 000000000..f0d550d2b --- /dev/null +++ b/niucloud/app/api/route/addon.php @@ -0,0 +1,26 @@ +middleware(ApiLog::class) + ->middleware(ApiCheckToken::class, false); \ No newline at end of file diff --git a/niucloud/app/api/route/article.php b/niucloud/app/api/route/article.php index 749eb8540..ee4cd0b94 100644 --- a/niucloud/app/api/route/article.php +++ b/niucloud/app/api/route/article.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/route/auth.php b/niucloud/app/api/route/auth.php index e52151c2f..9dea2cbb3 100644 --- a/niucloud/app/api/route/auth.php +++ b/niucloud/app/api/route/auth.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/route/diy.php b/niucloud/app/api/route/diy.php index f401b9612..ef199c356 100644 --- a/niucloud/app/api/route/diy.php +++ b/niucloud/app/api/route/diy.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/route/file.php b/niucloud/app/api/route/file.php index 622686c6c..ba77c2f15 100644 --- a/niucloud/app/api/route/file.php +++ b/niucloud/app/api/route/file.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/route/member.php b/niucloud/app/api/route/member.php index 03fd6490b..0f100dc5c 100644 --- a/niucloud/app/api/route/member.php +++ b/niucloud/app/api/route/member.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -86,6 +86,23 @@ Route::group('member', function () { //删除会员收货地址 Route::delete('address/:id', 'member.Address/del'); + /***************************************************** 会员等级 **************************************************/ + Route::get('level', 'member.Level/lists'); + + /***************************************************** 会员签到 **************************************************/ + //会员签到记录 + Route::get('sign', 'member.MemberSign/lists'); + //会员签到详情 + Route::get('sign/:sign_id', 'member.MemberSign/info'); + //会员签到 + Route::post('sign', 'member.MemberSign/sign'); + //获取月签到数据 + Route::get('sign/info/:year/:month', 'member.MemberSign/signInfo'); + //获取月签到数据 + Route::get('sign/award/:year/:month/:day', 'member.MemberSign/getDayAward'); + //获取签到设置 + Route::get('sign/config', 'member.MemberSign/signConfig'); + })->middleware(ApiChannel::class) ->middleware(ApiCheckToken::class, true) ->middleware(ApiLog::class); diff --git a/niucloud/app/api/route/pay.php b/niucloud/app/api/route/pay.php index b5a970330..8edd78908 100644 --- a/niucloud/app/api/route/pay.php +++ b/niucloud/app/api/route/pay.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/api/route/route.php b/niucloud/app/api/route/route.php index 97d454ee3..ad0414053 100644 --- a/niucloud/app/api/route/route.php +++ b/niucloud/app/api/route/route.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -51,6 +51,13 @@ Route::group(function() { Route::post('weapp/register', 'weapp.Weapp/register'); // 获取小程序订阅消息模板id Route::get('weapp/subscribemsg', 'weapp.Weapp/subscribeMessage'); + + // 查询小程序是否已开通发货信息管理服务 + Route::get('weapp/getIsTradeManaged', 'weapp.Weapp/getIsTradeManaged'); + + // 通过外部交易号获取消息跳转路径 + Route::get('weapp/getMsgJumpPath', 'weapp.Weapp/getMsgJumpPath'); + //登录 Route::get('login', 'login.Login/login'); //第三方绑定 @@ -86,6 +93,9 @@ Route::group(function() { // 获取手机端首页列表 Route::get('wap_index', 'sys.Config/getWapIndexList'); + // 获取地图设置 + Route::get('map', 'sys.Config/getMap'); + /***************************************************** 地区管理 ****************************************************/ //通过pid获取列表 Route::get('area/list_by_pid/:pid', 'sys.Area/listByPid'); @@ -100,6 +110,27 @@ Route::group(function() { /***************************************************** 海报管理 ****************************************************/ //获取海报 Route::get('poster', 'poster.Poster/poster'); + + /***************************************************** 核销管理 ****************************************************/ + //根据业务获取核销码 + Route::get('verify', 'sys.Verify/getVerifyCode'); + //校验当前会员是否是核销员 + Route::get('check_verifier', 'sys.Verify/checkVerifier'); + //核销记录 + Route::get('verify_records', 'sys.Verify/records'); + //核销详情 + Route::get('verify_detail/:code', 'sys.Verify/detail'); + //通过code码获取核销信息 + Route::get('get_verify_by_code/:code', 'sys.Verify/getInfoByCode'); + //核销操作 + Route::post('verify/:code', 'sys.Verify/verify'); + + /***************************************************** 会员管理 ****************************************************/ + /***************************************************** 任务管理 ****************************************************/ + // 获取成长值任务 + Route::get('task/growth', 'sys.Task/growth'); + // 获取积分任务 + Route::get('task/point', 'sys.Task/point'); })->middleware(ApiChannel::class) ->middleware(ApiCheckToken::class) ->middleware(ApiLog::class); diff --git a/niucloud/app/command/WorkerCommand.php b/niucloud/app/command/WorkerCommand.php index 49127240c..fe5dda152 100644 --- a/niucloud/app/command/WorkerCommand.php +++ b/niucloud/app/command/WorkerCommand.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/command/schedule/Schedule.php b/niucloud/app/command/schedule/Schedule.php index e569e96d6..a8929dba3 100644 --- a/niucloud/app/command/schedule/Schedule.php +++ b/niucloud/app/command/schedule/Schedule.php @@ -58,7 +58,10 @@ class Schedule extends Command foreach ($task_list as $item) { //获取定时任务时间字符串 new Crontab($this->getCrontab($item['time']), function () use ($core_schedule_service, $item, $output) { - $core_schedule_service->execute($item, $output); + if(!empty($item['class'])){ + $core_schedule_service->execute($item, $output); + } + }); } }; diff --git a/niucloud/app/command/workerman/Workerman.php b/niucloud/app/command/workerman/Workerman.php new file mode 100644 index 000000000..f37e749d8 --- /dev/null +++ b/niucloud/app/command/workerman/Workerman.php @@ -0,0 +1,196 @@ +setName('workerman') + ->addArgument('action', Argument::OPTIONAL, "start|stop|restart|reload|status|connections", 'start') + ->addOption('mode', 'm', Option::VALUE_OPTIONAL, 'Run the workerman server in daemon mode.') + ->setDescription('Workerman,高性能PHP应用容器'); + } + + + + /** + * 执行任务 + * @return void + */ + protected function execute(Input $input, Output $output) + { + $this->resetCli($input, $output); + //计划任务 + Worker::$pidFile = runtime_path() .'workerman_schedule.pid'; + $worker = new Worker(); + $worker->name = 'schedule_work'; + $worker->count = 1; + + // 设置时区,避免运行结果与预期不一致 + date_default_timezone_set('PRC'); + $worker->onWorkerStart = function () use($output){ + $output->writeln('['.date('Y-m-d H:i:s').']'." Schedule Starting..."); +// // 每分钟的第1秒执行.用于计划任务是否仍在执行 + new Crontab('*/10 * * * * *', function(){ + $file = root_path('runtime').'.schedule'; + file_put_contents($file, time()); + }); + $core_schedule_service = new CoreScheduleService(); + //查询所有的计划任务 + $task_list = $core_schedule_service->getList(['status' => ScheduleDict::ON]); + + foreach ($task_list as $item) { + //获取定时任务时间字符串 + new Crontab($this->getCrontab($item['time']), function () use ($core_schedule_service, $item, $output) { + if(!empty($item['class'])){ + $core_schedule_service->execute($item, $output); + } + }); + } + $output->writeln('['.date('Y-m-d H:i:s').']'." Schedule Started."); + }; + + //消息队列 + Worker::$pidFile = runtime_path() .'workerman_queue.pid'; + Worker::$logFile = runtime_path().'workerman.log'; + $worker = new Worker(); + $worker->name = 'queue_work'; +// $worker->count = 3; + + $worker->onWorkerStart = function () use($output){ + $output->writeln('['.date('Y-m-d H:i:s').']'." Queue Starting..."); + // 定时,每10秒一次 + Timer::add(30, function()use($output) + { + (new SysSchedule())->select(); + }); + $redis_option = [ + 'connect_timeout' => 10, + 'max_attempts' => 3, + 'retry_seconds' => 5, + 'prefix' => md5(root_path()) + ]; + if(!empty(env('redis.redis_password'))){ + $redis_option['auth'] = env('redis.redis_password'); + } + $redis_option['db'] = env('redis.select'); + $client = new Client('redis://'.env('redis.redis_hostname').':'.env('redis.port'), $redis_option); + $queue_list = $this->getAllQueue(); + + foreach ($queue_list as $queue_class_name){ + $queue_class_name = str_replace('.php', '', $queue_class_name); + // 订阅 + $client->subscribe($queue_class_name, function($data) use($queue_class_name, $output){ + $output->writeln('[queue]['.date('Y-m-d H:i:s').']'." Processing:" . $queue_class_name); + try{ + $class_name = '\\' .$queue_class_name; + $class = new $class_name(); + $class->fire($data); + } catch (\Throwable $e) { + Log::write(date('Y-m-d H:i:s').',队列有错误:'.$queue_class_name.'_'.$e->getMessage().'_'.$e->getFile().'_'.$e->getLine()); + } + $output->writeln('[queue]['.date('Y-m-d H:i:s').']'." Processed:" . $queue_class_name); + }); + } + // 消费失败触发的回调(可选) + $client->onConsumeFailure(function (\Throwable $exception, $package) use($output){ + $output->writeln('[queue]队列 ' . $package['queue'] . " 消费失败,".$exception->getMessage()); + }); + $output->writeln('['.date('Y-m-d H:i:s').']'." Queue Started."); + }; + Worker::runAll(); + } + + /** + * 获取计划任务所需的时间字符串 + * 0 1 2 3 4 5 + * | | | | | | + * | | | | | +------ day of week (0 - 6) (Sunday=0) + * | | | | +------ month (1 - 12) + * | | | +-------- day of month (1 - 31) + * | | +---------- hour (0 - 23) + * | +------------ min (0 - 59) + * +-------------- sec (0-59)[可省略,如果没有0位,则最小时间粒度是分钟] + * @param $data + * @return string + */ + protected function getCrontab($data): string + { + $sec = $data['sec'] ?? '*'; + $min = $data['min'] ?? '*'; + $hour = $data['hour'] ?? '*'; + $day = $data['day'] ?? '*'; + $week = $data['week'] ?? '*'; + $type = $data['type'] ?? ''; + switch ($type) { + case 'sec':// 每隔几秒 + $crontab = '*/' . $sec . ' * * * * *'; + break; + case 'min':// 每隔几分 + $crontab = '0 */' . $min . ' * * * *'; + break; + case 'hour':// 每隔几时第几分钟执行 + $crontab = '0 ' . $min . ' */' . $hour . ' * * *'; + break; + case 'day':// 每隔几日第几小时第几分钟执行 + $crontab = '0 ' . $min . ' ' . $hour . ' */' . $day . ' * *'; + break; + case 'week':// 每周一次,周几具体时间执行 + $crontab = '0 ' .$min . ' ' . $hour . ' * * ' . $week; + break; + case 'month':// 每月一次,某日具体时间执行 + $crontab = '0 ' .$min . ' ' . $hour . ' ' . $day . ' * *'; + break; + } + return $crontab ?? '0 */1 * * * *'; + } + + /** + * 捕获所有队列任务 + * @return array + */ + public function getAllQueue(){ + $class_list = []; + $system_dir = root_path() . 'app' . DIRECTORY_SEPARATOR . 'job'; + $addon_dir = root_path() . 'addon' . DIRECTORY_SEPARATOR; + if(is_dir($system_dir)){ + search_dir($system_dir, $app_data, root_path()); + $class_list = array_merge($class_list, $app_data); + } + + $addons = (new CoreAddonService())->getInstallAddonList(); + foreach ($addons as $v) { + + $addon_path = $addon_dir .$v['key']. DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR. 'job'; + if (is_dir($addon_path)) { + search_dir($addon_path, $addon_data, root_path()); + $class_list = array_merge($class_list, $addon_data); + } + } + + foreach($class_list as &$v){ + $v = str_replace('.php', '', $v); + $v = str_replace('/', '\\', $v); + } + return $class_list; + } +} diff --git a/niucloud/app/common.php b/niucloud/app/common.php index 69baabcea..8b76af006 100644 --- a/niucloud/app/common.php +++ b/niucloud/app/common.php @@ -8,6 +8,7 @@ use think\facade\Cache; use core\util\Snowflake; use app\service\core\upload\CoreImageService; use app\service\core\sys\CoreSysConfigService; + // 应用公共文件 /** @@ -18,13 +19,13 @@ use app\service\core\sys\CoreSysConfigService; * @param int $http_code * @return Response */ -function success(array|string $msg = 'SUCCESS', array|string|bool|null $data = [], int $code = 1, int $http_code = 200): Response +function success($msg = 'SUCCESS', $data = [], int $code = 1, int $http_code = 200) : Response { if (is_array($msg)) { $data = $msg; $msg = 'SUCCESS'; } - return Response::create(['data' => $data, 'msg' => get_lang($msg), 'code' => $code], 'json', $http_code); + return Response::create([ 'data' => $data, 'msg' => get_lang($msg), 'code' => $code ], 'json', $http_code); } @@ -36,13 +37,13 @@ function success(array|string $msg = 'SUCCESS', array|string|bool|null $data = [ * @param int $http_code * @return Response */ -function fail($msg = 'FAIL', ?array $data = [], int $code = 0, int $http_code = 200): Response +function fail($msg = 'FAIL', ?array $data = [], int $code = 0, int $http_code = 200) : Response { if (is_array($msg)) { $data = $msg; $msg = 'FAIL'; } - return Response::create(['data' => $data, 'msg' => get_lang($msg), 'code' => $code], 'json', $http_code); + return Response::create([ 'data' => $data, 'msg' => get_lang($msg), 'code' => $code ], 'json', $http_code); } /** @@ -68,22 +69,22 @@ function get_lang($str) function list_to_tree($list, $pk = 'id', $pid = 'pid', $child = 'child', $root = 0) { // 创建Tree - $tree = array(); + $tree = array (); if (is_array($list)) { // 创建基于主键的数组引用 - $refer = array(); + $refer = array (); foreach ($list as $key => $data) { - $refer[$data[$pk]] =& $list[$key]; + $refer[ $data[ $pk ] ] =& $list[ $key ]; } foreach ($list as $key => $data) { // 判断是否存在parent - $parent_id = $data[$pid]; + $parent_id = $data[ $pid ]; if ($root == $parent_id) { - $tree[] =& $list[$key]; + $tree[] =& $list[ $key ]; } else { - if (isset($refer[$parent_id])) { - $parent =& $refer[$parent_id]; - $parent[$child][] =& $list[$key]; + if (isset($refer[ $parent_id ])) { + $parent =& $refer[ $parent_id ]; + $parent[ $child ][] =& $list[ $key ]; } } } @@ -131,14 +132,14 @@ function array_keys_search($array, $keys, $index = '', $is_sort = true) return []; if (!empty($index) && count($array) != count($array, COUNT_RECURSIVE)) $array = array_column($array, null, $index); - $list = array(); + $list = array (); foreach ($keys as $key) { - if (isset($array[$key])) { + if (isset($array[ $key ])) { if ($is_sort) { - $list[] = $array[$key]; + $list[] = $array[ $key ]; } else { - $list[$key] = $array[$key]; + $list[ $key ] = $array[ $key ]; } } @@ -163,7 +164,7 @@ function del_target_dir($path, $delDir) //打开目录句柄 $handle = opendir($path); if ($handle) { - while (false !== ($item = readdir($handle))) { + while (false !== ( $item = readdir($handle) )) { if ($item != "." && $item != "..") { if (is_dir("$path/$item")) { del_target_dir("$path/$item", $delDir); @@ -199,7 +200,7 @@ function system_name(?string $key = '') 'channel_name' => env('system.channel_name', 'channel'), ]; if (!empty($key)) { - return $params[$key]; + return $params[ $key ]; } else { return $params; } @@ -218,11 +219,11 @@ function get_date_by_time(?int $time = null) function get_start_and_end_time_by_day($day = '') { - $date = $day ?: date('Y-m-d'); + $date = $day ? : date('Y-m-d'); $day_start_time = strtotime($date); //当天结束之间 $day_end_time = $day_start_time + 86400; - return [$day_start_time, $day_end_time]; + return [ $day_start_time, $day_end_time ]; } /** @@ -255,11 +256,12 @@ function get_file_url(string $path) { if (!$path) return ''; if (!str_contains($path, 'http://') && !str_contains($path, 'https://')) { - return request()->domain() .'/'. path_to_url($path); + return request()->domain() . '/' . path_to_url($path); } else { return path_to_url($path); } } + /** * 新增队列工作 * @param $job @@ -284,13 +286,14 @@ function create_job($job, $data = '', $delay = 0, $queue = null) /** * 获取插件对应资源文件(插件安装后获取) - * @param $addon //插件名称 - * @param $file_name //文件名称(包含resource文件路径) + * @param $addon //插件名称 + * @param $file_name //文件名称(包含resource文件路径) */ function addon_resource($addon, $file_name) { - return "addon/". $addon. "/". $file_name; + return "addon/" . $addon . "/" . $file_name; } + /** * 判断 文件/目录 是否可写(取代系统自带的 is_writeable 函数) * @@ -340,13 +343,15 @@ function format_money($number) * @param $precision * @return float|int */ -function format_float_money($number, $precision = 2){ - if($precision > 0){ - return sprintf('%.'.$precision.'f', floor($number*(10**$precision))/(10**$precision)); - }else{ - return sprintf('%.'.$precision.'f', floor($number)); +function format_float_money($number, $precision = 2) +{ + if ($precision > 0) { + return sprintf('%.' . $precision . 'f', floor($number * ( 10 ** $precision )) / ( 10 ** $precision )); + } else { + return sprintf('%.' . $precision . 'f', floor($number)); } } + /** * 金额保留小数点后*位 * @param $number @@ -380,7 +385,7 @@ function create_no(string $prefix = '', string $tag = '') $machine_id = 2; $snowflake = new Snowflake($data_center_id, $machine_id); $id = $snowflake->generateId(); - return $prefix.date('Ymd').$tag.$id; + return $prefix . date('Ymd') . $tag . $id; } /** @@ -405,11 +410,12 @@ function mkdirs($dir, $mode = 0777) */ function mkdirs_or_notexist($dir, $mode = 0777) { - if (! is_dir($dir) && ! mkdir($dir, $mode, true) && ! is_dir($dir)) { + if (!is_dir($dir) && !mkdir($dir, $mode, true) && !is_dir($dir)) { throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir)); } return true; } + /** * 删除缓存文件使用 * @param $dir @@ -470,19 +476,19 @@ function array_merge2(array $array1, array $array2) if (array_key_exists($array2_k, $array1)) { if (is_array($array2_v)) { foreach ($array2_v as $array2_kk => $array2_vv) { - if (array_key_exists($array2_kk, $array1[$array2_k])) { + if (array_key_exists($array2_kk, $array1[ $array2_k ])) { if (is_array($array2_vv)) { - $array1[$array2_k][$array2_kk] = array_merge($array1[$array2_k][$array2_kk], $array2_vv); + $array1[ $array2_k ][ $array2_kk ] = array_merge($array1[ $array2_k ][ $array2_kk ], $array2_vv); } } else { - $array1[$array2_k][$array2_kk] = $array2_vv; + $array1[ $array2_k ][ $array2_kk ] = $array2_vv; } } } else { - $array1[$array2_k] = $array2_v; + $array1[ $array2_k ] = $array2_v; } } else { - $array1[$array2_k] = $array2_v; + $array1[ $array2_k ] = $array2_v; } } return $array1; @@ -496,7 +502,7 @@ function array_merge2(array $array1, array $array2) function get_files_by_dir($dir) { $dh = @opendir($dir); //打开目录,返回一个目录流 - $return = array(); + $return = array (); while ($file = @readdir($dh)) { //循环读取目录下的文件 if ($file != '.' and $file != '..') { $path = $dir . DIRECTORY_SEPARATOR . $file; //设置目录,用于含有子目录的情况 @@ -576,8 +582,11 @@ function dir_mkdir($path = '', $mode = 0777, $recursive = true) { clearstatcache(); if (!is_dir($path)) { - @mkdir($path, $mode, $recursive); - return chmod($path, $mode); + if (mkdir($path, $mode, $recursive)) { + return chmod($path, $mode); + } else { + throw new \core\exception\CommonException("目录{$path}创建失败请检查是否有足够的权限"); + } } return true; } @@ -607,7 +616,7 @@ function parse_sql($content = '', $string = false, $replace = []) // 多行注释标记 $comment = false; // 按行分割,兼容多个平台 - $content = str_replace(["\r\n", "\r"], "\n", $content); + $content = str_replace([ "\r\n", "\r" ], "\n", $content); $content = explode("\n", trim($content)); // 循环处理每一行 foreach ($content as $line) { @@ -699,10 +708,10 @@ function getFileMap($path, $arr = []) if ($file_path != '.' && $file_path != '..') { $temp_path = $path . '/' . $file_path; if (is_dir($temp_path)) { - $arr[$temp_path] = $file_path; + $arr[ $temp_path ] = $file_path; $arr = getFileMap($temp_path, $arr); } else { - $arr[$temp_path] = $file_path; + $arr[ $temp_path ] = $file_path; } } } @@ -718,17 +727,18 @@ function getFileMap($path, $arr = []) * @param $options * @return mixed|string */ -function cache_remember(string $name = null, $value = '', $tag = null, $options = null){ - if(!empty($hit = Cache::get($name)))//可以用has +function cache_remember(string $name = null, $value = '', $tag = null, $options = null) +{ + if (!empty($hit = Cache::get($name)))//可以用has return $hit; if ($value instanceof Closure) { // 获取缓存数据 $value = Container::getInstance()->invokeFunction($value); } if (is_null($tag)) { - Cache::set($name, $value, $options['expire'] ?? null); + Cache::set($name, $value, $options[ 'expire' ] ?? null); } else { - Cache::tag($tag)->set($name, $value, $options['expire'] ?? null); + Cache::tag($tag)->set($name, $value, $options[ 'expire' ] ?? null); } return $value; @@ -738,7 +748,8 @@ function cache_remember(string $name = null, $value = '', $tag = null, $options * 项目目录 * @return string */ -function project_path() { +function project_path() +{ return dirname(root_path()) . DIRECTORY_SEPARATOR; } @@ -748,10 +759,11 @@ function project_path() { * @param $is_delete 转换后是否删除原图 * @return string */ -function image_to_base64(string $path, $is_delete = false) { +function image_to_base64(string $path, $is_delete = false) +{ if (!file_exists($path)) return 'image not exist'; - $mime = getimagesize($path)['mime']; + $mime = getimagesize($path)[ 'mime' ]; $image_data = file_get_contents($path); // 将图片转换为 base64 $base64_data = base64_encode($image_data); @@ -770,9 +782,10 @@ function image_to_base64(string $path, $is_delete = false) { * @return mixed * @throws Exception */ -function get_thumb_images($site_id, $image, $thumb_type = 'all', bool $is_throw_exception = false){ +function get_thumb_images($site_id, $image, $thumb_type = 'all', bool $is_throw_exception = false) +{ - return (new CoreImageService())->thumb($site_id, $image, $thumb_type, $is_throw_exception); + return ( new CoreImageService() )->thumb($site_id, $image, $thumb_type, $is_throw_exception); } /** @@ -780,12 +793,13 @@ function get_thumb_images($site_id, $image, $thumb_type = 'all', bool $is_throw_ * @param $version * @return int */ -function version_to_int($version) { +function version_to_int($version) +{ $version_array = explode(".", $version); - $v1 = sprintf('%03s', (int) $version_array[0] ?? 0); - $v2 = sprintf('%03s', (int) $version_array[1] ?? 0); - $v3 = sprintf('%03s', (int) $version_array[2] ?? 0); + $v1 = sprintf('%03s', (int) $version_array[ 0 ] ?? 0); + $v2 = sprintf('%03s', (int) $version_array[ 1 ] ?? 0); + $v3 = sprintf('%03s', (int) $version_array[ 2 ] ?? 0); return (int) "{$v1}{$v2}{$v3}"; } @@ -794,9 +808,10 @@ function version_to_int($version) { * @param int $ver * @return string */ -function version_to_string($ver) { - if($ver > 999) { - if($ver > 999999) { +function version_to_string($ver) +{ + if ($ver > 999) { + if ($ver > 999999) { $ver .= ""; $v3 = (int) substr($ver, -3); $v2 = (int) substr($ver, -6, 3); @@ -820,7 +835,8 @@ function version_to_string($ver) { * @param string $file_path * @return void */ -function check_file_is_remote(string $file_path){ +function check_file_is_remote(string $file_path) +{ return str_contains($file_path, 'https://') || str_contains($file_path, 'http://') || str_contains($file_path, '.com'); } @@ -830,7 +846,8 @@ function check_file_is_remote(string $file_path){ * @param string $to_file * @return void */ -function file_copy(string $source_file, string $to_file) { +function file_copy(string $source_file, string $to_file) +{ if (!file_exists($source_file)) return false; // 检查目标文件是否存在 @@ -859,71 +876,74 @@ function file_copy(string $source_file, string $to_file) { * @param $size * @return string */ -function qrcode($url, $page, $data, $site_id, $dir, $channel = 'h5', $style = ['is_transparent' => true]){ - $dir = $dir ?: 'upload' . '/'.'qrcode'.'/'.$site_id;//二维码默认存储位置 - if (! is_dir($dir) && ! mkdir($dir, 0777, true) && ! is_dir($dir)) { - throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir)); - } - $file_path = md5($url.$page.serialize($data).serialize($style).$channel); - $path = $dir . '/' . $file_path . '.png'; - if (file_exists($path)) { - return $path; +function qrcode($url, $page, $data, $site_id, $dir = '', $channel = 'h5', $style = [ 'is_transparent' => true ], $outfile = true) +{ + if($outfile){ + $dir = $dir ? : 'upload' . '/' . 'qrcode' . '/' . $site_id;//二维码默认存储位置 + if (!is_dir($dir) && !mkdir($dir, 0777, true) && !is_dir($dir)) { + throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir)); + } + $file_path = md5($url . $page . serialize($data) . serialize($style) . $channel); + $path = $dir . '/' . $file_path . '.png'; + if (file_exists($path)) { + return $path; + } } + $result = array_values(array_filter(event('GetQrcodeOfChannel', [ - 'filepath' => $path, + 'filepath' => $path ?? '', 'url' => $url, 'page' => $page, - 'data' => $data, + 'data' => $data , 'site_id' => $site_id, 'channel' => $channel, + 'outfile' => $outfile ]))); - if(!empty($result[0])){ - $path = $result[0]; + if (!empty($result[ 0 ])) { + $path = $result[ 0 ]; } -// if(!empty($style)){ -// $is_transparent = $style['is_transparent'] ?? false;//是否透明 -// $color = $style['color'] ?? '#000';//颜色 -// $bg_color = $style['bg_color'] ?? '#FFF'; -// //将二维码背景变透明 -// $resource = imagecreatefrompng($path); -// @unlink($path); -// if($is_transparent){ -// $bgcolor = imagecolorallocate($resource, 255, 255, 255); -// imagefill($resource, 0, 0, $bgcolor); -// imagecolortransparent($resource, $bgcolor); -// } -// // 设置彩色二维码的颜色 -// $color = imagecolorallocate($resource, 229, 39, 21); // 红色 -// // 修改二维码的像素颜色 -// imagesetpixel($resource, 10, 10, $color); -// imagepng($resource,$path); -// } - return $path; } /** * 获取海报 * @param int $site_id - * @param string|int $type + * @param $id + * @param $type * @param array $param + * @param string $channel * @param bool $is_throw_exception - * @return string|null + * @return string|void */ -function poster(int $site_id, string|int $type, array $param = [], string $channel = '',bool $is_throw_exception = true){ - return (new \app\service\core\poster\CorePosterService())->get($site_id, $type, $param, $channel, $is_throw_exception); +function poster(int $site_id, $id, $type, array $param = [], string $channel = '', bool $is_throw_exception = true) +{ + return ( new \app\service\core\poster\CorePosterService() )->get($site_id, $id, $type, $param, $channel, $is_throw_exception); } /** * 获取站点插件 * @return array */ -function get_site_addons($site_id = 0) : array { +function get_site_addons($site_id = 0) : array +{ $addons = $site_id ? Cache::get("local_install_addons_{$site_id}") : Cache::get("local_install_addons"); return is_null($addons) ? [] : $addons; } -function get_wap_domain($site_id) { - $wap_url = (new CoreSysConfigService())->getSceneDomain($site_id)['wap_url']; +function get_wap_domain($site_id) +{ + $wap_url = ( new CoreSysConfigService() )->getSceneDomain($site_id)[ 'wap_url' ]; return $wap_url; } + +/** + * $str为要进行截取的字符串,$length为截取长度(汉字算一个字,字母算半个字 + * @param $str + * @param int $length + * @param bool $is_need_apostrophe + * @return string + */ +function str_sub($str, $length = 10, $is_need_apostrophe = true) +{ + return mb_substr($str, 0, $length, 'UTF-8') . ( $is_need_apostrophe ? '...' : '' ); +} diff --git a/niucloud/app/dict/addon/AddonDict.php b/niucloud/app/dict/addon/AddonDict.php index f6e566d7a..9ab98a22b 100644 --- a/niucloud/app/dict/addon/AddonDict.php +++ b/niucloud/app/dict/addon/AddonDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -34,6 +34,12 @@ class AddonDict // 执行失败 const INSTALL_FAIL = 'fail'; + // 插件关键字黑名单 + const ADDON_KEY_BLACK_LIST = [ + 'addon', 'aliapp', 'app', 'applet', 'auht', 'channel', 'dict', 'diy', 'generator', 'home', 'member', 'niucloud', + 'notice', 'pay', 'site', 'sys', 'upload', 'home', 'user', 'weapp', 'wechat' + ]; + /** * 插件操作方式 * @return array diff --git a/niucloud/app/dict/applet/AppletlDict.php b/niucloud/app/dict/applet/AppletlDict.php index bd00235bd..f42958382 100644 --- a/niucloud/app/dict/applet/AppletlDict.php +++ b/niucloud/app/dict/applet/AppletlDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/cash_out/CashOutTypeDict.php b/niucloud/app/dict/cash_out/CashOutTypeDict.php index fb0ff8b26..5beda2a0f 100644 --- a/niucloud/app/dict/cash_out/CashOutTypeDict.php +++ b/niucloud/app/dict/cash_out/CashOutTypeDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/channel/CertDict.php b/niucloud/app/dict/channel/CertDict.php index d959aaccc..b8395da5b 100644 --- a/niucloud/app/dict/channel/CertDict.php +++ b/niucloud/app/dict/channel/CertDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/channel/ReplyDict.php b/niucloud/app/dict/channel/ReplyDict.php index 02157d42d..a3e983fcd 100644 --- a/niucloud/app/dict/channel/ReplyDict.php +++ b/niucloud/app/dict/channel/ReplyDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/channel/WechatDict.php b/niucloud/app/dict/channel/WechatDict.php index 994532f01..fa5ce0bd9 100644 --- a/niucloud/app/dict/channel/WechatDict.php +++ b/niucloud/app/dict/channel/WechatDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/common/ChannelDict.php b/niucloud/app/dict/common/ChannelDict.php index b96ffcbe0..e85526456 100644 --- a/niucloud/app/dict/common/ChannelDict.php +++ b/niucloud/app/dict/common/ChannelDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -34,15 +34,15 @@ class ChannelDict public static function getType($type = '') { $data = [ - self::WEAPP => get_lang('dict_channel.channel_weapp'),//微信小程序 - self::WECHAT => get_lang('dict_channel.channel_wechat'),//'微信公众号', self::H5 => get_lang('dict_channel.channel_h5'),//'手机H5', - self::PC => get_lang('dict_channel.channel_pc'),//'电脑PC', self::APP => get_lang('dict_channel.channel_app'),//'手机app', + self::PC => get_lang('dict_channel.channel_pc'),//'电脑PC', + self::WECHAT => get_lang('dict_channel.channel_wechat'),//'微信公众号', + self::WEAPP => get_lang('dict_channel.channel_weapp'),//微信小程序 ]; if (empty($type)) { return $data; } return $data[$type] ?? ''; } -} \ No newline at end of file +} diff --git a/niucloud/app/dict/diy/ComponentDict.php b/niucloud/app/dict/diy/ComponentDict.php index 65bfd3c37..d8d2ae558 100644 --- a/niucloud/app/dict/diy/ComponentDict.php +++ b/niucloud/app/dict/diy/ComponentDict.php @@ -251,6 +251,18 @@ class ComponentDict 'bgColorEnd' => '' ], ], + 'MemberLevel' => [ + 'title' => '会员等级', + 'icon' => 'iconfont-iconhuangguan', + 'path' => 'edit-member-level', + 'support_page' => [], + 'uses' => 1, + 'sort' => 10009, + 'value' => [ + "style" => "style-1", + "styleName" => "风格1" + ], + ], 'Notice' => [ 'title' => '公告', 'icon' => 'iconfont-icongonggao', diff --git a/niucloud/app/dict/diy/LinkDict.php b/niucloud/app/dict/diy/LinkDict.php index d91a881fd..553f98d07 100644 --- a/niucloud/app/dict/diy/LinkDict.php +++ b/niucloud/app/dict/diy/LinkDict.php @@ -93,6 +93,27 @@ class LinkDict 'url' => '/app/pages/member/address', 'is_share' => 1, 'action' => '' + ], + [ + 'name' => 'MEMBER_MY_LEVEL', + 'title' => get_lang('dict_diy.member_my_level'), + 'url' => '/app/pages/member/level', + 'is_share' => 1, + 'action' => '' + ], + [ + 'name' => 'MEMBER_MY_SIGN_IN', + 'title' => get_lang('dict_diy.member_my_sign_in'), + 'url' => '/app/pages/member/sign_in', + 'is_share' => 1, + 'action' => '' + ], + [ + 'name' => 'MEMBER_VERIFY_INDEX', + 'title' => get_lang('dict_diy.member_verify_index'), + 'url' => '/app/pages/verify/index', + 'is_share' => 1, + 'action' => '' ] ] ], diff --git a/niucloud/app/dict/diy/PagesDict.php b/niucloud/app/dict/diy/PagesDict.php index 46e69cf72..2d7e61d86 100644 --- a/niucloud/app/dict/diy/PagesDict.php +++ b/niucloud/app/dict/diy/PagesDict.php @@ -150,12 +150,18 @@ class PagesDict ] ], 'topStatusBar' => [ + 'isShow' => true, 'bgColor' => "#ffffff", 'isTransparent' => false, - 'isShow' => true, 'style' => 'style-1', + 'styleName' => '风格1', 'textColor' => "#333333", 'textAlign' => 'center', + 'inputPlaceholder' => '请输入搜索关键词', + 'imgUrl' => '', + 'link' => [ + 'name' => "" + ] ], 'popWindow' => [ 'imgUrl' => "", @@ -176,15 +182,15 @@ class PagesDict ], 'DIY_MEMBER_INDEX' => [ 'default_member_index_one' => [ - "title" => "个人中心(风格一)", // 页面名称 + "title" => "默认个人中心1", // 页面名称 'cover' => 'static/resource/images/diy/template/default_member_index_one_cover.png', // 页面封面图 'preview' => '', // 页面预览图 - 'desc' => '官方推出个人中心(风格一)', // 页面描述 + 'desc' => '官方推出默认个人中心1', // 页面描述 'mode' => 'diy', // 页面数据源 "data" => [ "global" => [ - "title" => "个人中心(风格一)", + "title" => "个人中心", 'pageStartBgColor' => '#F8F8F8', 'pageEndBgColor' => '', 'pageGradientAngle' => 'to bottom', @@ -215,12 +221,18 @@ class PagesDict ] ], 'topStatusBar' => [ + 'isShow' => true, 'bgColor' => "#ffffff", 'isTransparent' => false, - 'isShow' => true, 'style' => 'style-1', + 'styleName' => '风格1', 'textColor' => "#333333", 'textAlign' => 'center', + 'inputPlaceholder' => '请输入搜索关键词', + 'imgUrl' => '', + 'link' => [ + 'name' => "" + ] ], 'popWindow' => [ 'imgUrl' => "", @@ -613,15 +625,15 @@ class PagesDict ] ], 'default_member_index_two' => [ - "title" => "个人中心(风格二)", // 页面名称 + "title" => "默认个人中心2", // 页面名称 'cover' => 'static/resource/images/diy/template/default_member_index_two_cover.png', // 页面封面图 'preview' => '', // 页面预览图 - 'desc' => '官方推出个人中心(风格二)', // 页面描述 + 'desc' => '官方推出默认个人中心2', // 页面描述 'mode' => 'diy', // 页面数据源 "data" => [ "global" => [ - "title" => "个人中心(风格二)", + "title" => "个人中心", 'pageStartBgColor' => '#F8F8F8', 'pageEndBgColor' => '', 'pageGradientAngle' => 'to bottom', @@ -652,12 +664,18 @@ class PagesDict ] ], 'topStatusBar' => [ + 'isShow' => true, 'bgColor' => "#ffffff", 'isTransparent' => false, - 'isShow' => true, 'style' => 'style-1', + 'styleName' => '风格1', 'textColor' => "#333333", 'textAlign' => 'center', + 'inputPlaceholder' => '请输入搜索关键词', + 'imgUrl' => '', + 'link' => [ + 'name' => "" + ] ], 'popWindow' => [ 'imgUrl' => "", diff --git a/niucloud/app/dict/member/MemberAccountChangeTypeDict.php b/niucloud/app/dict/member/MemberAccountChangeTypeDict.php index 439ecc430..52f4933a8 100644 --- a/niucloud/app/dict/member/MemberAccountChangeTypeDict.php +++ b/niucloud/app/dict/member/MemberAccountChangeTypeDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/member/MemberAccountTypeDict.php b/niucloud/app/dict/member/MemberAccountTypeDict.php index 1f59a6673..90475485d 100644 --- a/niucloud/app/dict/member/MemberAccountTypeDict.php +++ b/niucloud/app/dict/member/MemberAccountTypeDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -30,6 +30,7 @@ class MemberAccountTypeDict //会员佣金 public const COMMISSION = 'commission'; + public const GROWTH = 'growth'; public static function getType($type = '') { @@ -38,6 +39,7 @@ class MemberAccountTypeDict self::BALANCE => get_lang('dict_member.account_balance'), self::MONEY => get_lang('dict_member.account_money'), self::COMMISSION => get_lang('dict_member.account_commission'), + self::GROWTH => get_lang('dict_member.account_growth'), ]; if (empty($type)) { return $data; @@ -45,4 +47,4 @@ class MemberAccountTypeDict return $data[$type] ?? ''; } -} \ No newline at end of file +} diff --git a/niucloud/app/dict/member/MemberCashOutDict.php b/niucloud/app/dict/member/MemberCashOutDict.php index 570ae454f..582b2b62f 100644 --- a/niucloud/app/dict/member/MemberCashOutDict.php +++ b/niucloud/app/dict/member/MemberCashOutDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/member/MemberDict.php b/niucloud/app/dict/member/MemberDict.php index bcca0a508..9e51da95d 100644 --- a/niucloud/app/dict/member/MemberDict.php +++ b/niucloud/app/dict/member/MemberDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/member/MemberLoginTypeDict.php b/niucloud/app/dict/member/MemberLoginTypeDict.php index 251b8c44a..7a6da4a7c 100644 --- a/niucloud/app/dict/member/MemberLoginTypeDict.php +++ b/niucloud/app/dict/member/MemberLoginTypeDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/member/MemberRegisterChannelDict.php b/niucloud/app/dict/member/MemberRegisterChannelDict.php index 734ba6c26..fc5489c2e 100644 --- a/niucloud/app/dict/member/MemberRegisterChannelDict.php +++ b/niucloud/app/dict/member/MemberRegisterChannelDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/member/MemberRegisterTypeDict.php b/niucloud/app/dict/member/MemberRegisterTypeDict.php index bc1139245..f24580d88 100644 --- a/niucloud/app/dict/member/MemberRegisterTypeDict.php +++ b/niucloud/app/dict/member/MemberRegisterTypeDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/member/MemberSignDict.php b/niucloud/app/dict/member/MemberSignDict.php new file mode 100644 index 000000000..d2d1859a3 --- /dev/null +++ b/niucloud/app/dict/member/MemberSignDict.php @@ -0,0 +1,37 @@ + get_lang('dict_member_sign.status_not_sign'),//未签到 + self::SIGNED => get_lang('dict_member_sign.status_signed'),//已签到 + ]; + } +} \ No newline at end of file diff --git a/niucloud/app/dict/member/MemberSignTypeDict.php b/niucloud/app/dict/member/MemberSignTypeDict.php new file mode 100644 index 000000000..633b98619 --- /dev/null +++ b/niucloud/app/dict/member/MemberSignTypeDict.php @@ -0,0 +1,37 @@ + get_lang('dict_member_sign_award.type_day'),//日签 + self::CONTINUE => get_lang('dict_member_sign_award.type_continue'),//连签 + ]; + } +} \ No newline at end of file diff --git a/niucloud/app/dict/member/account_change_type.php b/niucloud/app/dict/member/account_change_type.php index 1b56aa6cd..c24df63ba 100644 --- a/niucloud/app/dict/member/account_change_type.php +++ b/niucloud/app/dict/member/account_change_type.php @@ -13,6 +13,15 @@ return [ //是否减少 'dec' => 1, ], + //调整 + 'member_register' => [ + //名称 + 'name' => get_lang('dict_member.account_point_member_register'), + //是否增加 + 'inc' => 1, + //是否减少 + 'dec' => 0, + ], //充值赠送 'recharge_give' => [ //名称 @@ -22,7 +31,33 @@ return [ //是否减少 'dec' => 0, ], - + //会员升级礼包 + 'level_upgrade' => [ + //名称 + 'name' => get_lang('dict_member.account_point_level_upgrade'), + //是否增加 + 'inc' => 1, + //是否减少 + 'dec' => 0, + ], + //日签奖励 + 'day_sign_award' => [ + //名称 + 'name' => get_lang('dict_member.account_point_day_sign_award'), + //是否增加 + 'inc' => 1, + //是否减少 + 'dec' => 0, + ], + //连签奖励 + 'continue_sign_award' => [ + //名称 + 'name' => get_lang('dict_member.account_point_continue_sign_award'), + //是否增加 + 'inc' => 1, + //是否减少 + 'dec' => 0, + ], ], MemberAccountTypeDict::BALANCE => [ //调整 @@ -34,6 +69,15 @@ return [ //是否减少 'dec' => 1, ], + //调整 + 'member_register' => [ + //名称 + 'name' => get_lang('dict_member.account_balance_member_register'), + //是否增加 + 'inc' => 1, + //是否减少 + 'dec' => 0, + ], //充值 'recharge' => [ //名称 @@ -69,6 +113,33 @@ return [ //是否减少 'dec' => 0, ], + //会员升级礼包 + 'level_upgrade' => [ + //名称 + 'name' => get_lang('dict_member.account_balance_level_upgrade'), + //是否增加 + 'inc' => 1, + //是否减少 + 'dec' => 0, + ], + //日签奖励 + 'day_sign_award' => [ + //名称 + 'name' => get_lang('dict_member.account_balance_day_sign_award'), + //是否增加 + 'inc' => 1, + //是否减少 + 'dec' => 0, + ], + //连签奖励 + 'continue_sign_award' => [ + //名称 + 'name' => get_lang('dict_member.account_balance_continue_sign_award'), + //是否增加 + 'inc' => 1, + //是否减少 + 'dec' => 0, + ], ], MemberAccountTypeDict::MONEY => [ @@ -113,4 +184,4 @@ return [ 'dec' => 1, ], ] -]; \ No newline at end of file +]; diff --git a/niucloud/app/dict/member/benefits.php b/niucloud/app/dict/member/benefits.php new file mode 100644 index 000000000..0e4e80daf --- /dev/null +++ b/niucloud/app/dict/member/benefits.php @@ -0,0 +1,22 @@ + [ + 'key' => 'discount', + 'name' => '下单折扣', // 权益名称 + 'desc' => '商品购买享受折扣优惠', // 权益说明 + 'component' => '/src/app/views/member/components/benefits-discount.vue', + "content" => [ + 'admin' => function($site_id, $config) { + return "下单享受{$config['discount']}折折扣"; + }, + 'member_level' => function($site_id, $config) { + return [ + 'title' => "可享{$config['discount']}折", + 'desc' => '购物折扣', + 'icon' => '/static/resource/images/member/benefits/benefits_discount.png' + ]; + } + ] + ] +]; diff --git a/niucloud/app/dict/member/gift.php b/niucloud/app/dict/member/gift.php new file mode 100644 index 000000000..6114a781e --- /dev/null +++ b/niucloud/app/dict/member/gift.php @@ -0,0 +1,53 @@ + [ + 'key' => 'balance', + 'name' => '送红包', // 礼包名称 + 'desc' => '发放红包', // 礼包说明 + 'component' => '/src/app/views/member/components/gift-balance.vue', + 'grant' => function($site_id, $member_id, $config, $param) { + $account_type = \app\dict\member\MemberAccountTypeDict::BALANCE; + $service = new \app\service\core\member\CoreMemberAccountService(); + $service->addLog($site_id, $member_id, $account_type, $config['money'], $param['from_type'] ?? '', $param['memo'] ?? '', $param['related_id'] ?? ''); + }, + 'content' => [ + 'admin' => function($site_id, $config) { + return "{$config['money']}元红包"; + }, + // 会员等级 + 'member_level' => function($site_id, $config) { + $content = []; + $content[] = [ + 'text' => "{$config['money']}元", + 'background' => '/static/resource/images/member/gift/gift_balance_bg.png' + ]; + return $content; + } + ] + ], + 'point' => [ + 'key' => 'point', + 'name' => '送积分', // 礼包名称 + 'desc' => '发放积分', // 礼包说明 + 'component' => '/src/app/views/member/components/gift-point.vue', + 'grant' => function($site_id, $member_id, $config, $param) { + $account_type = \app\dict\member\MemberAccountTypeDict::POINT; + $service = new \app\service\core\member\CoreMemberAccountService(); + $service->addLog($site_id, $member_id, $account_type, $config['num'], $param['from_type'] ?? '', $param['memo'] ?? '', $param['related_id'] ?? ''); + }, + 'content' => [ + 'admin' => function($site_id, $config) { + return "{$config['num']}积分"; + }, + 'member_level' => function($site_id, $config) { + $content = []; + $content[] = [ + 'text' => "{$config['num']}积分", + 'background' => '/static/resource/images/member/gift/gift_point_bg.png' + ]; + return $content; + } + ] + ] +]; diff --git a/niucloud/app/dict/member/growth_rule.php b/niucloud/app/dict/member/growth_rule.php new file mode 100644 index 000000000..640540ba8 --- /dev/null +++ b/niucloud/app/dict/member/growth_rule.php @@ -0,0 +1,16 @@ + [ + 'key' => 'member_register', + 'name' => '会员注册', + 'desc' => '会员注册之后发放成长值', + 'component' => '/src/app/views/member/components/growth-rule-register.vue', + 'calculate' => '', // 计算成长值 + 'content' => [ + 'admin' => function($site_id, $config) { + return "会员注册之后发放{$config['growth']}成长值"; + } + ] + ], +]; diff --git a/niucloud/app/dict/member/point_rule.php b/niucloud/app/dict/member/point_rule.php new file mode 100644 index 000000000..97f79abbf --- /dev/null +++ b/niucloud/app/dict/member/point_rule.php @@ -0,0 +1,21 @@ + [ + 'member_register' => [ + 'key' => 'member_register', + 'name' => '会员注册', + 'desc' => '会员注册之后发放积分', + 'component' => '/src/app/views/member/components/point-rule-register.vue', + 'calculate' => '', // 计算成长值, + 'content' => [ + 'admin' => function($site_id, $config) { + return "会员注册之后发放{$config['point']}积分"; + } + ] + ], + ], + 'consume' => [ + + ] +]; diff --git a/niucloud/app/dict/menu/admin.php b/niucloud/app/dict/menu/admin.php index 7a16c5f92..52698ded8 100644 --- a/niucloud/app/dict/menu/admin.php +++ b/niucloud/app/dict/menu/admin.php @@ -260,6 +260,20 @@ return [ 'status' => '1', 'is_show' => '1', ], + [ + 'menu_name' => '布局设置', + 'menu_key' => 'layout_setting', + 'menu_short_name' => '布局设置', + 'menu_type' => '1', + 'icon' => 'element-Message', + 'api_url' => 'sys/config/layout', + 'router_path' => 'setting/layout', + 'view_path' => 'setting/layout', + 'methods' => 'get', + 'sort' => '8', + 'status' => '1', + 'is_show' => '1', + ], ], ], [ diff --git a/niucloud/app/dict/menu/site.php b/niucloud/app/dict/menu/site.php index 7dd2ecab9..39288f063 100644 --- a/niucloud/app/dict/menu/site.php +++ b/niucloud/app/dict/menu/site.php @@ -67,7 +67,7 @@ return [ 'router_path' => '', 'view_path' => '', 'methods' => 'post', - 'sort' => '95', + 'sort' => '0', 'status' => '1', 'is_show' => '1', ], @@ -81,7 +81,7 @@ return [ 'router_path' => 'diy/list', 'view_path' => 'diy/list', 'methods' => 'get', - 'sort' => '90', + 'sort' => '98', 'status' => '1', 'is_show' => '1', ], @@ -95,7 +95,7 @@ return [ 'router_path' => 'diy/route', 'view_path' => 'diy/route', 'methods' => 'get', - 'sort' => '85', + 'sort' => '97', 'status' => '1', 'is_show' => '1', ], @@ -109,7 +109,7 @@ return [ 'router_path' => 'diy/tabbar', 'view_path' => 'diy/tabbar', 'methods' => 'get', - 'sort' => '80', + 'sort' => '96', 'status' => '1', 'is_show' => '1', 'children' => [ @@ -123,7 +123,7 @@ return [ 'router_path' => '', 'view_path' => '', 'methods' => 'post', - 'sort' => '100', + 'sort' => '0', 'status' => '1', 'is_show' => '1', ], @@ -139,10 +139,38 @@ return [ 'router_path' => 'diy/attachment', 'view_path' => 'tools/attachment', 'methods' => 'get', - 'sort' => '75', + 'sort' => '95', 'status' => '1', 'is_show' => '1', ], + [ + 'menu_name' => '海报管理', + 'menu_key' => 'poster_management', + 'menu_short_name' => '海报管理', + 'menu_type' => '1', + 'icon' => 'element-Files', + 'api_url' => 'poster', + 'router_path' => 'poster/list', + 'view_path' => 'poster/list', + 'methods' => 'get', + 'sort' => '94', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '海报装修', + 'menu_key' => 'poster_decorate', + 'menu_short_name' => '海报装修', + 'menu_type' => '1', + 'icon' => '', + 'api_url' => 'poster/', + 'router_path' => 'poster/edit', + 'view_path' => 'poster/edit', + 'methods' => 'put', + 'sort' => '0', + 'status' => '1', + 'is_show' => '0', + ] ], ], [ @@ -203,6 +231,36 @@ return [ 'sort' => '90', 'status' => '1', 'is_show' => '0', + 'children' => [ + [ + 'menu_name' => '调整会员积分', + 'menu_key' => 'adjust_point', + 'menu_short_name' => '调整会员积分', + 'menu_type' => '2', + 'icon' => '', + 'api_url' => 'member/account/point', + 'router_path' => '', + 'view_path' => '', + 'methods' => 'post', + 'sort' => '0', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '调整会员余额', + 'menu_key' => 'adjust_balance', + 'menu_short_name' => '调整会员余额', + 'menu_type' => '2', + 'icon' => '', + 'api_url' => 'member/account/balance', + 'router_path' => '', + 'view_path' => '', + 'methods' => 'post', + 'sort' => '0', + 'status' => '1', + 'is_show' => '1', + ] + ], ], [ 'menu_name' => '会员标签', @@ -262,19 +320,197 @@ return [ ], ], ], + [ + 'menu_name' => '会员等级', + 'menu_key' => 'member_level', + 'menu_short_name' => '会员等级', + 'menu_type' => '0', + 'icon' => 'element-CollectionTag', + 'api_url' => 'member/level', + 'router_path' => 'member/level', + 'view_path' => 'member/level', + 'methods' => 'get', + 'sort' => '79', + 'status' => '1', + 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '等级列表', + 'menu_key' => 'member_level_list', + 'menu_short_name' => '会员等级', + 'menu_type' => '1', + 'icon' => 'element-CollectionTag', + 'api_url' => 'member/level', + 'router_path' => 'member/level', + 'view_path' => 'member/level', + 'methods' => 'get', + 'sort' => '50', + 'status' => '1', + 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '添加等级', + 'menu_key' => 'member_level_add', + 'menu_short_name' => '添加标签', + 'menu_type' => '2', + 'icon' => '', + 'api_url' => 'member/level', + 'router_path' => '', + 'view_path' => '', + 'methods' => 'post', + 'sort' => '0', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '编辑等级', + 'menu_key' => 'member_level_edit', + 'menu_short_name' => '编辑标签', + 'menu_type' => '2', + 'icon' => '', + 'api_url' => 'member/level/', + 'router_path' => '', + 'view_path' => '', + 'methods' => 'put', + 'sort' => '0', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '删除等级', + 'menu_key' => 'member_level_delete', + 'menu_short_name' => '删除等级', + 'menu_type' => '2', + 'icon' => '', + 'api_url' => 'member/level/', + 'router_path' => '', + 'view_path' => '', + 'methods' => 'delete', + 'sort' => '0', + 'status' => '1', + 'is_show' => '1', + ], + ], + ], + [ + 'menu_name' => '添加/编辑等级', + 'menu_key' => 'member_level_edit_page', + 'menu_short_name' => '添加/编辑等级', + 'menu_type' => '1', + 'icon' => '', + 'api_url' => 'member/label/', + 'router_path' => 'member/level_edit', + 'view_path' => 'member/level_edit', + 'methods' => 'get', + 'sort' => '49', + 'status' => '1', + 'is_show' => '0', + ], + [ + 'menu_name' => '成长值规则', + 'menu_key' => 'growth_rule', + 'menu_short_name' => '成长值规则', + 'menu_type' => '1', + 'icon' => '', + 'api_url' => 'member/config/growth_rule', + 'router_path' => 'setting/growth_rule', + 'view_path' => 'setting/growth_rule', + 'methods' => 'get', + 'sort' => '49', + 'status' => '1', + 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '设置成长值规则', + 'menu_key' => 'set_growth_rule', + 'menu_short_name' => '设置成长值规则', + 'menu_type' => '2', + 'icon' => '', + 'api_url' => 'member/config/growth_rule', + 'router_path' => '', + 'view_path' => '', + 'methods' => 'post', + 'sort' => '100', + 'status' => '1', + 'is_show' => '1', + ] + ] + ], + ] + ], + [ + 'menu_name' => '会员成长值', + 'menu_key' => 'member_growth', + 'menu_short_name' => '会员成长值', + 'menu_type' => '1', + 'icon' => 'iconfont-iconjifen-xianxing', + 'api_url' => 'member/account/growth', + 'router_path' => 'member/growth', + 'view_path' => 'member/growth', + 'methods' => 'get', + 'sort' => '49', + 'status' => '1', + 'is_show' => '0', + ], [ 'menu_name' => '会员积分', 'menu_key' => 'member_point', 'menu_short_name' => '会员积分', - 'menu_type' => '1', + 'menu_type' => '0', 'icon' => 'iconfont-iconjifen-xianxing', 'api_url' => 'member/account/point', 'router_path' => 'member/point', 'view_path' => 'member/point', 'methods' => 'get', - 'sort' => '70', + 'sort' => '51', 'status' => '1', 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '积分明细', + 'menu_key' => 'member_point_list', + 'menu_short_name' => '积分明细', + 'menu_type' => '1', + 'icon' => 'iconfont-iconjifen-xianxing', + 'api_url' => 'member/account/point', + 'router_path' => 'member/point', + 'view_path' => 'member/point', + 'methods' => 'get', + 'sort' => '120', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '积分规则', + 'menu_key' => 'point_rule', + 'menu_short_name' => '积分规则', + 'menu_type' => '1', + 'icon' => '', + 'api_url' => 'member/config/point_rule', + 'router_path' => 'setting/point_rule', + 'view_path' => 'setting/point_rule', + 'methods' => 'get', + 'sort' => '110', + 'status' => '1', + 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '积分规则', + 'menu_key' => 'set_point_rule', + 'menu_short_name' => '设置积分规则', + 'menu_type' => '2', + 'icon' => '', + 'api_url' => 'member/config/point_rule', + 'router_path' => '', + 'view_path' => '', + 'methods' => 'post', + 'sort' => '100', + 'status' => '1', + 'is_show' => '1', + ] + ] + ], + ] ], [ 'menu_name' => '会员余额', @@ -303,8 +539,8 @@ return [ 'sort' => '59', 'status' => '1', 'is_show' => '1', - ], - ], + ] + ] ], [ 'menu_name' => '财务管理', @@ -393,6 +629,125 @@ return [ ], ], ], + [ + 'menu_name' => '营销管理', + 'menu_key' => 'active', + 'menu_short_name' => '营销', + 'parent_key' => '', + 'menu_type' => '0', + 'icon' => 'iconfont-iconyingxiao', + 'api_url' => '', + 'router_path' => '', + 'view_path' => '', + 'methods' => '', + 'sort' => '56', + 'status' => '1', + 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '核销管理', + 'menu_key' => 'verify', + 'menu_short_name' => '核销管理', + 'menu_type' => '1', + 'icon' => '', + 'api_url' => '', + 'router_path' => '', + 'view_path' => '', + 'methods' => 'get', + 'sort' => '48', + 'status' => '1', + 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '核销员', + 'menu_key' => 'verifier_list', + 'menu_short_name' => '核销员', + 'menu_type' => '1', + 'icon' => '', + 'api_url' => '', + 'router_path' => 'marketing/verifier', + 'view_path' => 'marketing/verifier', + 'methods' => 'get', + 'sort' => '48', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '核销记录', + 'menu_key' => 'verify_list', + 'menu_short_name' => '核销记录', + 'menu_type' => '1', + 'icon' => '', + 'api_url' => '', + 'router_path' => 'marketing/verify', + 'view_path' => 'marketing/verify', + 'methods' => 'get', + 'sort' => '48', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '核销详情', + 'menu_key' => 'verify_detail', + 'menu_short_name' => '核销详情', + 'menu_type' => '1', + 'icon' => '', + 'api_url' => '', + 'router_path' => 'marketing/verify/detail', + 'view_path' => 'marketing/verify_detail', + 'methods' => 'get', + 'sort' => '48', + 'status' => '1', + 'is_show' => '0', + ] + ], + ], + [ + 'menu_name' => '签到管理', + 'menu_key' => 'sign', + 'menu_short_name' => '签到管理', + 'menu_type' => '1', + 'icon' => 'element-FolderChecked', + 'api_url' => '', + 'router_path' => '', + 'view_path' => '', + 'methods' => 'get', + 'sort' => '30', + 'status' => '1', + 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '签到设置', + 'menu_key' => 'sign_set', + 'menu_short_name' => '签到设置', + 'menu_type' => '1', + 'icon' => 'element-FolderChecked', + 'api_url' => '', + 'router_path' => 'marketing/sign/config', + 'view_path' => 'marketing/sign_config', + 'methods' => 'get', + 'sort' => '30', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '签到记录', + 'menu_key' => 'sign_list', + 'menu_short_name' => '签到记录', + 'menu_type' => '1', + 'icon' => 'element-FolderChecked', + 'api_url' => '', + 'router_path' => 'marketing/sign', + 'view_path' => 'marketing/sign_list', + 'methods' => 'get', + 'sort' => '30', + 'status' => '1', + 'is_show' => '1', + ] + ], + ], + ], + ], [ 'menu_name' => '应用管理', 'menu_key' => 'addon', @@ -409,9 +764,9 @@ return [ 'is_show' => '1', 'children' => [ [ - 'menu_name' => '应用管理', + 'menu_name' => '应用列表', 'menu_key' => 'addon_list', - 'menu_short_name' => '应用管理', + 'menu_short_name' => '应用列表', 'menu_type' => '1', 'icon' => 'iconfont-iconmanage-apply', 'api_url' => 'addon/list', @@ -903,100 +1258,92 @@ return [ 'menu_name' => '网站设置', 'menu_key' => 'setting_system', 'menu_short_name' => '网站设置', - 'menu_type' => '1', + 'menu_type' => '0', 'icon' => 'element-Basketball', - 'api_url' => 'sys/config/website', - 'router_path' => 'setting/system', - 'view_path' => 'setting/system', - 'methods' => 'get', + 'api_url' => '', + 'router_path' => '', + 'view_path' => '', + 'methods' => '', 'sort' => '100', 'status' => '1', 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '基础设置', + 'menu_key' => 'setting_system_web', + 'menu_short_name' => '基础设置', + 'menu_type' => '1', + 'icon' => 'element-Basketball', + 'api_url' => 'sys/config/website', + 'router_path' => 'setting/system', + 'view_path' => 'setting/system', + 'methods' => 'get', + 'sort' => '100', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '版权设置', + 'menu_key' => 'setting_copyright', + 'menu_short_name' => '版权设置', + 'menu_type' => '1', + 'icon' => 'iconfont-iconbanquan1', + 'api_url' => 'sys/config/copyright', + 'router_path' => 'setting/copyright', + 'view_path' => 'setting/copyright', + 'methods' => 'get', + 'sort' => '90', + 'status' => '1', + 'is_show' => '1', + ], + ] ], - [ - 'menu_name' => '协议编辑', - 'menu_key' => 'system_agreement_edit', - 'menu_short_name' => '协议编辑', - 'menu_type' => '1', - 'icon' => '', - 'api_url' => 'sys/agreement/', - 'router_path' => 'setting/agreement/edit', - 'view_path' => 'setting/agreement_edit', - 'methods' => 'put', - 'sort' => '100', - 'status' => '1', - 'is_show' => '0', - ], - [ - 'menu_name' => '地图设置', - 'menu_key' => 'map_setting', - 'menu_short_name' => '地图设置', - 'menu_type' => '1', - 'icon' => 'element-Message', - 'api_url' => 'sys/config/map', - 'router_path' => 'setting/map', - 'view_path' => 'setting/map', - 'methods' => 'get', - 'sort' => '99', - 'status' => '1', - 'is_show' => '1', - ], - [ - 'menu_name' => '版权设置', - 'menu_key' => 'setting_copyright', - 'menu_short_name' => '版权设置', - 'menu_type' => '1', - 'icon' => 'iconfont-iconbanquan1', - 'api_url' => 'sys/config/copyright', - 'router_path' => 'setting/copyright', - 'view_path' => 'setting/copyright', - 'methods' => 'get', - 'sort' => '90', - 'status' => '1', - 'is_show' => '1', - ], - [ - 'menu_name' => '协议管理', - 'menu_key' => 'system_agreement', - 'menu_short_name' => '协议管理', - 'menu_type' => '1', - 'icon' => 'element-Notebook', - 'api_url' => 'sys/agreement', - 'router_path' => 'setting/agreement', - 'view_path' => 'setting/agreement', - 'methods' => 'get', - 'sort' => '80', - 'status' => '1', - 'is_show' => '1', - ], + [ 'menu_name' => '会员设置', 'menu_key' => 'setting_member', 'menu_short_name' => '会员设置', - 'menu_type' => '1', + 'menu_type' => '0', 'icon' => 'iconfont-iconjiaoseyonghu', - 'api_url' => 'member/config/member', - 'router_path' => 'setting/member', - 'view_path' => 'setting/member', - 'methods' => 'get', + 'api_url' => '', + 'router_path' => '', + 'view_path' => '', + 'methods' => '', 'sort' => '71', 'status' => '1', 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '会员设置', + 'menu_key' => 'setting_member_config', + 'menu_short_name' => '会员设置', + 'menu_type' => '1', + 'icon' => 'iconfont-iconjiaoseyonghu', + 'api_url' => 'member/config/member', + 'router_path' => 'setting/member', + 'view_path' => 'setting/member', + 'methods' => 'get', + 'sort' => '71', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '注册登录', + 'menu_key' => 'setting_login_register', + 'menu_short_name' => '注册登录', + 'menu_type' => '1', + 'icon' => 'iconfont-iconzhuceshezhi', + 'api_url' => 'member/config/login', + 'router_path' => 'setting/login', + 'view_path' => 'setting/login', + 'methods' => 'get', + 'sort' => '70', + 'status' => '1', + 'is_show' => '1', + ], + ] ], - [ - 'menu_name' => '注册登录', - 'menu_key' => 'setting_login_register', - 'menu_short_name' => '注册登录', - 'menu_type' => '1', - 'icon' => 'iconfont-iconzhuceshezhi', - 'api_url' => 'member/config/login', - 'router_path' => 'setting/login', - 'view_path' => 'setting/login', - 'methods' => 'get', - 'sort' => '70', - 'status' => '1', - 'is_show' => '1', - ], + [ 'menu_name' => '支付管理', 'menu_key' => 'setting_pay', @@ -1071,22 +1418,23 @@ return [ ], ], ], + [ + 'menu_name' => '提现设置', + 'menu_key' => 'cash_out_config', + 'menu_short_name' => '提现设置', + 'menu_type' => '1', + 'icon' => 'element-Postcard', + 'api_url' => 'member/config/cash_out', + 'router_path' => 'setting/cash_out', + 'view_path' => 'setting/cash_out', + 'methods' => 'post', + 'sort' => '59', + 'status' => '1', + 'is_show' => '1', + ], ], ], - [ - 'menu_name' => '提现设置', - 'menu_key' => 'cash_out_config', - 'menu_short_name' => '提现设置', - 'menu_type' => '1', - 'icon' => 'element-Postcard', - 'api_url' => 'member/config/cash_out', - 'router_path' => 'setting/cash_out', - 'view_path' => 'setting/cash_out', - 'methods' => 'post', - 'sort' => '59', - 'status' => '1', - 'is_show' => '1', - ], + [ 'menu_name' => '消息管理', 'menu_key' => 'setting_notice', @@ -1176,19 +1524,92 @@ return [ ], ], [ - 'menu_name' => '存储设置', - 'menu_key' => 'setting_storage', - 'menu_short_name' => '存储设置', - 'menu_type' => '1', + 'menu_name' => '系统工具', + 'menu_key' => 'setting_tool', + 'menu_short_name' => '系统工具', + 'menu_type' => '0', 'icon' => 'element-FolderChecked', - 'api_url' => 'sys/storage', - 'router_path' => 'setting/storage', - 'view_path' => 'setting/storage', - 'methods' => 'get', + 'api_url' => '', + 'router_path' => '', + 'view_path' => '', + 'methods' => '', 'sort' => '30', 'status' => '1', 'is_show' => '1', + 'children' => [ + [ + 'menu_name' => '协议管理', + 'menu_key' => 'system_agreement', + 'menu_short_name' => '协议管理', + 'menu_type' => '1', + 'icon' => 'element-Notebook', + 'api_url' => 'sys/agreement', + 'router_path' => 'setting/agreement', + 'view_path' => 'setting/agreement', + 'methods' => 'get', + 'sort' => '80', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '协议编辑', + 'menu_key' => 'system_agreement_edit', + 'menu_short_name' => '协议编辑', + 'menu_type' => '1', + 'icon' => '', + 'api_url' => 'sys/agreement/', + 'router_path' => 'setting/agreement/edit', + 'view_path' => 'setting/agreement_edit', + 'methods' => 'put', + 'sort' => '100', + 'status' => '1', + 'is_show' => '0', + ], + [ + 'menu_name' => '地图秘钥', + 'menu_key' => 'map_setting', + 'menu_short_name' => '地图秘钥', + 'menu_type' => '1', + 'icon' => 'element-Message', + 'api_url' => 'sys/config/map', + 'router_path' => 'setting/map', + 'view_path' => 'setting/map', + 'methods' => 'get', + 'sort' => '99', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '存储设置', + 'menu_key' => 'setting_storage', + 'menu_short_name' => '存储设置', + 'menu_type' => '1', + 'icon' => 'element-FolderChecked', + 'api_url' => 'sys/storage', + 'router_path' => 'setting/storage', + 'view_path' => 'setting/storage', + 'methods' => 'get', + 'sort' => '30', + 'status' => '1', + 'is_show' => '1', + ], + [ + 'menu_name' => '数据导出', + 'menu_key' => 'setting_export', + 'menu_short_name' => '数据导出', + 'menu_type' => '1', + 'icon' => 'element-FolderChecked', + 'api_url' => '', + 'router_path' => 'setting/export', + 'view_path' => 'setting/export', + 'methods' => 'get', + 'sort' => '30', + 'status' => '1', + 'is_show' => '1', + ] + ] ], + ], ], [ @@ -1252,5 +1673,5 @@ return [ 'is_show' => '0', ], ], - ], + ] ]; diff --git a/niucloud/app/dict/notice/NoticeDict.php b/niucloud/app/dict/notice/NoticeDict.php index 8883272e2..eaf0a5a0f 100644 --- a/niucloud/app/dict/notice/NoticeDict.php +++ b/niucloud/app/dict/notice/NoticeDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/notice/NoticeTypeDict.php b/niucloud/app/dict/notice/NoticeTypeDict.php index 27ad9f978..63719e258 100644 --- a/niucloud/app/dict/notice/NoticeTypeDict.php +++ b/niucloud/app/dict/notice/NoticeTypeDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/notice/notice.php b/niucloud/app/dict/notice/notice.php index df6aaca35..35acb421e 100644 --- a/niucloud/app/dict/notice/notice.php +++ b/niucloud/app/dict/notice/notice.php @@ -20,21 +20,5 @@ return [ 'variable' => [ 'code' => '验证码' ], - ], - //充值成功通知,站点端发送 - - 'recharge_success' => [ - 'key' => 'recharge_success', - 'receiver_type' => 1, - 'name' => '充值成功通知', - 'title' => '会员充值成功后发送', - 'async' => true, - 'variable' => [ - 'price' => '充值金额', - 'balance' => '充值后账户', - 'time' => '充值时间', - 'trade_no' => '交易单号' - ], ] - -]; \ No newline at end of file +]; diff --git a/niucloud/app/dict/notice/weapp.php b/niucloud/app/dict/notice/weapp.php index c07c422b1..bee73cf4c 100644 --- a/niucloud/app/dict/notice/weapp.php +++ b/niucloud/app/dict/notice/weapp.php @@ -1,14 +1,4 @@ [ - 'tid' => '755', - 'content' => [ - ['交易单号', '{trade_no}', 'keyword1'], - ['充值金额', '{price}', 'keyword2'], - ['账户余额', '{balance}', 'keyword3'], - ['充值时间', '{time}', 'keyword4'], - ], - 'kid_list' => [1, 3, 4, 2], - 'scene_desc' => '' - ] -]; \ No newline at end of file + +]; diff --git a/niucloud/app/dict/notice/wechat.php b/niucloud/app/dict/notice/wechat.php index 41627a727..bee73cf4c 100644 --- a/niucloud/app/dict/notice/wechat.php +++ b/niucloud/app/dict/notice/wechat.php @@ -1,14 +1,4 @@ [ - 'temp_key' => '52552', - 'keyword_name_list' => [ '充值时间', '充值金额' ], -// 'first' => '', - 'content' => [ - [ '充值时间', '{time}', 'time1' ], - [ '充值金额', '{price}', 'amount3' ], -// [ '充值状态', '充值成功', 'keyword3' ] - ], -// 'remark' => '' - ] -]; \ No newline at end of file + +]; diff --git a/niucloud/app/dict/pay/OnlinePayDict.php b/niucloud/app/dict/pay/OnlinePayDict.php index 661787177..7732aec51 100644 --- a/niucloud/app/dict/pay/OnlinePayDict.php +++ b/niucloud/app/dict/pay/OnlinePayDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/pay/OnlineRefundDict.php b/niucloud/app/dict/pay/OnlineRefundDict.php index 8bd435437..0a247063f 100644 --- a/niucloud/app/dict/pay/OnlineRefundDict.php +++ b/niucloud/app/dict/pay/OnlineRefundDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/pay/PayChannelDict.php b/niucloud/app/dict/pay/PayChannelDict.php index 9650f1bf6..3ac4b18f4 100644 --- a/niucloud/app/dict/pay/PayChannelDict.php +++ b/niucloud/app/dict/pay/PayChannelDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/pay/PayDict.php b/niucloud/app/dict/pay/PayDict.php index 2c4e20637..b43c01d84 100644 --- a/niucloud/app/dict/pay/PayDict.php +++ b/niucloud/app/dict/pay/PayDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/pay/RefundDict.php b/niucloud/app/dict/pay/RefundDict.php index ac7e21f32..aaed034a4 100644 --- a/niucloud/app/dict/pay/RefundDict.php +++ b/niucloud/app/dict/pay/RefundDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/pay/TransferDict.php b/niucloud/app/dict/pay/TransferDict.php index ae39eba23..d92d9754e 100644 --- a/niucloud/app/dict/pay/TransferDict.php +++ b/niucloud/app/dict/pay/TransferDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -14,7 +14,7 @@ namespace app\dict\pay; class TransferDict { - public const WECHAT = 'wechat';//微信支付 + public const WECHAT = 'wechatpay';//微信支付 public const ALIPAY = 'alipay';//支付宝支付 diff --git a/niucloud/app/dict/poster/ComponentDict.php b/niucloud/app/dict/poster/ComponentDict.php new file mode 100644 index 000000000..423f23251 --- /dev/null +++ b/niucloud/app/dict/poster/ComponentDict.php @@ -0,0 +1,120 @@ + [ + 'title' => get_lang('dict_diy_poster.component_type_basic'), + 'support' => [], // 支持的插件 + 'list' => [ + 'Text' => [ + 'title' => "文本", // 组件名称 + 'type' => 'text', // 组件类型,文本:text,image:图片,qrcode:二维码 + 'icon' => "iconfont-iconbiaoti", // 组件图标 + 'path' => "text", // 组件预览,前缀 edit-,编辑组件属性,前缀 preview- + 'uses' => 0, + 'sort' => 10000, + 'relate' => '', // 关联字段,空为不处理// 组件属性 + 'value' => '文本内容', + ], + 'Image' => [ + 'title' => "图片", + 'type' => 'image', + 'icon' => "iconfont-icontupian1", + 'path' => "image", + 'uses' => 0, + 'sort' => 10001, + 'relate' => '', // 关联字段,空为不处理 + 'value' => '', + ], + 'Qrcode' => [ + 'title' => "二维码", + 'type' => 'qrcode', + 'icon' => "iconfont-iconerweima", + 'path' => "qrcode", + 'uses' => 1, + 'sort' => 10002, + 'relate' => 'url', // 关联字段,空为不处理 + 'value' => '', + ], + 'HeadImg' => [ + 'title' => "头像", + 'type' => 'image', + 'icon' => "iconfont-icongeren", + 'path' => "headimg", + 'uses' => 1, + 'sort' => 10003, + 'relate' => 'headimg', // 关联字段,空为不处理 + 'value' => '', + 'template' => [ + "width" => 50, // 宽度 + 'height' => 50, // 高度 + 'minWidth' => 30, // 最小宽度 + 'minHeight' => 30, // 最小高度 + ], + ], + 'NickName' => [ + 'title' => "昵称", + 'type' => 'text', + 'icon' => "iconfont-iconnicheng1", + 'path' => "nickname", + 'uses' => 1, + 'sort' => 10004, + 'relate' => 'nickname', // 关联字段,空为不处理 + 'value' => '', + 'template' => [ + "width" => 50, // 宽度 + 'height' => 50, // 高度 + 'minWidth' => 30, // 最小宽度 + 'minHeight' => 30, // 最小高度 + ], + ], + 'Draw' => [ + 'title' => "绘画", + 'type' => 'draw', + 'icon' => "iconfont-iconhuihua1", + 'path' => "draw", + 'uses' => 0, + 'sort' => 10005, + 'relate' => '', // 关联字段,空为不处理 + 'value' => '', + 'template' => [ + "width" => 100, // 宽度 + 'height' => 100, // 高度 + 'minWidth' => 30, // 最小宽度 + 'minHeight' => 30, // 最小高度 + 'drawType' => 'Polygon', + 'bgColor' => '#eeeeee', + 'points' => [], // [x,y]:左上,右上,右下,左下 + ], + ], + + ], + ], + ]; + + return ( new DictLoader("Poster") )->loadComponents($system_components); + } + +} diff --git a/niucloud/app/dict/scan/ScanDict.php b/niucloud/app/dict/scan/ScanDict.php index bab930d3d..67d084c84 100644 --- a/niucloud/app/dict/scan/ScanDict.php +++ b/niucloud/app/dict/scan/ScanDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/schedule/ScheduleDict.php b/niucloud/app/dict/schedule/ScheduleDict.php index 1eb11adf2..425ff49a7 100644 --- a/niucloud/app/dict/schedule/ScheduleDict.php +++ b/niucloud/app/dict/schedule/ScheduleDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/schedule/schedule.php b/niucloud/app/dict/schedule/schedule.php index 9f71cd3a9..53966d447 100644 --- a/niucloud/app/dict/schedule/schedule.php +++ b/niucloud/app/dict/schedule/schedule.php @@ -24,5 +24,16 @@ return [ ], 'class' => 'app\job\schedule\SiteExpireClose', 'function' => '' + ], + [ + 'key' => 'site_stat', + 'name' => '站点统计', + 'desc' => '', + 'time' => [ + 'type' => 'hour', + 'hour' => 1, + ], + 'class' => 'app\job\schedule\SiteStatJob', + 'function' => '' ] ]; diff --git a/niucloud/app/dict/site/SiteAccountLogDict.php b/niucloud/app/dict/site/SiteAccountLogDict.php index 44f210868..e8364c7a8 100644 --- a/niucloud/app/dict/site/SiteAccountLogDict.php +++ b/niucloud/app/dict/site/SiteAccountLogDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/site/SiteDict.php b/niucloud/app/dict/site/SiteDict.php index 1f23e3067..5c3c7039c 100644 --- a/niucloud/app/dict/site/SiteDict.php +++ b/niucloud/app/dict/site/SiteDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/AgreementDict.php b/niucloud/app/dict/sys/AgreementDict.php index 4193a6171..6fb7bd8b4 100644 --- a/niucloud/app/dict/sys/AgreementDict.php +++ b/niucloud/app/dict/sys/AgreementDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/AppTypeDict.php b/niucloud/app/dict/sys/AppTypeDict.php index e55e24113..a3a0ba9e8 100644 --- a/niucloud/app/dict/sys/AppTypeDict.php +++ b/niucloud/app/dict/sys/AppTypeDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/ConfigKeyDict.php b/niucloud/app/dict/sys/ConfigKeyDict.php index 3344dde99..14c1370c0 100644 --- a/niucloud/app/dict/sys/ConfigKeyDict.php +++ b/niucloud/app/dict/sys/ConfigKeyDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/DateDict.php b/niucloud/app/dict/sys/DateDict.php index 0a4928e1c..6be293dd5 100644 --- a/niucloud/app/dict/sys/DateDict.php +++ b/niucloud/app/dict/sys/DateDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/ExportDict.php b/niucloud/app/dict/sys/ExportDict.php new file mode 100644 index 000000000..aa862b94f --- /dev/null +++ b/niucloud/app/dict/sys/ExportDict.php @@ -0,0 +1,52 @@ + get_lang('dict_export.status_exporting'), + self::SUCCESS => get_lang('dict_export.status_success'), + self::FAIL => get_lang('dict_export.status_fail'), + ]; + } + + /** + * 导出数据类型 + * @return array + */ + public static function getExportType() + { + $type_array = event("ExportDataType"); + $type_list = []; + foreach ($type_array as $v) + { + $type_list = empty($type_list) ? $v : array_merge($type_list, $v); + } + return $type_list; + } + +} \ No newline at end of file diff --git a/niucloud/app/dict/sys/FileDict.php b/niucloud/app/dict/sys/FileDict.php index 9f08f48fb..67cfe0c31 100644 --- a/niucloud/app/dict/sys/FileDict.php +++ b/niucloud/app/dict/sys/FileDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/IconDict.php b/niucloud/app/dict/sys/IconDict.php index 69d0963c3..dd91790ee 100644 --- a/niucloud/app/dict/sys/IconDict.php +++ b/niucloud/app/dict/sys/IconDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/MenuDict.php b/niucloud/app/dict/sys/MenuDict.php index 80b6c63f3..ab6401ad4 100644 --- a/niucloud/app/dict/sys/MenuDict.php +++ b/niucloud/app/dict/sys/MenuDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/MenuTypeDict.php b/niucloud/app/dict/sys/MenuTypeDict.php index 983298c79..4f2c12cd5 100644 --- a/niucloud/app/dict/sys/MenuTypeDict.php +++ b/niucloud/app/dict/sys/MenuTypeDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/MethodDict.php b/niucloud/app/dict/sys/MethodDict.php index d9ac7a674..1eac615af 100644 --- a/niucloud/app/dict/sys/MethodDict.php +++ b/niucloud/app/dict/sys/MethodDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/PosterDict.php b/niucloud/app/dict/sys/PosterDict.php index 367324d7d..566ece729 100644 --- a/niucloud/app/dict/sys/PosterDict.php +++ b/niucloud/app/dict/sys/PosterDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -19,19 +19,33 @@ class PosterDict /** * 获取方式 + * @param string $type * @return array */ - public static function getType() + public static function getType($type = '') { $list = []; $temp = array_filter(event('GetPosterType') ?? []); - foreach($temp as $v){ + foreach ($temp as $v) { $list = array_merge($list, $v); } - return $list; + if (!empty($type)) { + $item = []; + foreach ($list as $v) { + if ($v[ 'type' ] == $type) { + $item = $v; + break; + } + } + return $item; + } else { + return $list; + } } + public const ON = '1';//开启 public const OFF = '2';//关闭 + /** * 状态 * @return array diff --git a/niucloud/app/dict/sys/RoleStatusDict.php b/niucloud/app/dict/sys/RoleStatusDict.php index 651a78df5..6661c9baa 100644 --- a/niucloud/app/dict/sys/RoleStatusDict.php +++ b/niucloud/app/dict/sys/RoleStatusDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/SmsDict.php b/niucloud/app/dict/sys/SmsDict.php index 5574b02f7..0a4c518ad 100644 --- a/niucloud/app/dict/sys/SmsDict.php +++ b/niucloud/app/dict/sys/SmsDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/StorageDict.php b/niucloud/app/dict/sys/StorageDict.php index f2e99c935..c715b10f4 100644 --- a/niucloud/app/dict/sys/StorageDict.php +++ b/niucloud/app/dict/sys/StorageDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/UserDict.php b/niucloud/app/dict/sys/UserDict.php index 2c9dc3896..5c8d040f3 100644 --- a/niucloud/app/dict/sys/UserDict.php +++ b/niucloud/app/dict/sys/UserDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/sys/WechatMediaDict.php b/niucloud/app/dict/sys/WechatMediaDict.php index d43f0cd98..2ae6fbf6b 100644 --- a/niucloud/app/dict/sys/WechatMediaDict.php +++ b/niucloud/app/dict/sys/WechatMediaDict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/dict/verify/VerifyDict.php b/niucloud/app/dict/verify/VerifyDict.php new file mode 100644 index 000000000..f98a1853e --- /dev/null +++ b/niucloud/app/dict/verify/VerifyDict.php @@ -0,0 +1,33 @@ + ['app\listener\system\AppInitListener'], + 'AppInit' => [ 'app\listener\system\AppInitListener' ], 'HttpRun' => [], 'HttpEnd' => [], 'LogLevel' => [], @@ -20,27 +20,27 @@ $system_event = [ * 会员相关事件 */ //会员注册事件 - 'MemberRegister' => ['app\listener\member\MemberRegisterListener'], + 'MemberRegister' => [ 'app\listener\member\MemberRegisterListener' ], //会员登录事件 - 'MemberLogin' => ['app\listener\member\MemberLoginListener'], + 'MemberLogin' => [ 'app\listener\member\MemberLoginListener' ], //会员账户变化事件 - 'MemberAccount' => ['app\listener\member\MemberAccountListener'], + 'MemberAccount' => [ 'app\listener\member\MemberAccountListener' ], //扫码事件 - 'Scan' => ['app\listener\scan\ScanListener'], - 'AddSiteAfter' => ['app\listener\site\AddSiteAfterListener'], + 'Scan' => [ 'app\listener\scan\ScanListener' ], + 'AddSiteAfter' => [ 'app\listener\site\AddSiteAfterListener' ], /** * 支付相关事件 */ - 'PayCreate' => ['app\listener\pay\PayCreateListener'], + 'PayCreate' => [ 'app\listener\pay\PayCreateListener' ], //支付成功 - 'PaySuccess' => ['app\listener\pay\PaySuccessListener'], + 'PaySuccess' => [ 'app\listener\pay\PaySuccessListener' ], //退款成功 - 'RefundSuccess' => ['app\listener\pay\RefundSuccessListener'], + 'RefundSuccess' => [ 'app\listener\pay\RefundSuccessListener' ], //转账成功 - 'TransferSuccess' => ['app\listener\pay\TransferSuccessListener'], + 'TransferSuccess' => [ 'app\listener\pay\TransferSuccessListener' ], // 任务失败统一回调,有四种定义方式 'queue_failed' => [ - ['app\listener\job\QueueFailedLoggerListener', 'report'], + [ 'app\listener\job\QueueFailedLoggerListener', 'report' ], ], //系统应用管理加载 'AppManage' => [ @@ -81,13 +81,30 @@ $system_event = [ ], //创建二维码 'GetQrcodeOfChannel' => [ - //微信小程序码 + // 微信公众号二维码 'app\listener\qrcode\WechatQrcodeListener', - //微信小程序码 + // 微信小程序二维码 'app\listener\qrcode\WeappQrcodeListener' - ] + ], + //导出数据类型 + 'ExportDataType' => [ + //会员导出 + 'app\listener\member\MemberExportTypeListener', + ], + //导出数据源 + 'ExportData' => [ + //会员导出 + 'app\listener\member\MemberExportDataListener', + ], + //统计执行 + 'StatExecute' => [], + //统计字段获取 + 'StatField' => [], + + // 获取海报数据 + 'GetPosterData' => ['app\listener\system\Poster'], ], 'subscribe' => [ ], ]; -return (new DictLoader("Event"))->load($system_event); +return ( new DictLoader("Event") )->load($system_event); diff --git a/niucloud/app/install/source/database.sql b/niucloud/app/install/source/database.sql index 102e2c455..fe605e4b5 100644 --- a/niucloud/app/install/source/database.sql +++ b/niucloud/app/install/source/database.sql @@ -4,31 +4,31 @@ SET NAMES utf8mb4; DROP TABLE IF EXISTS `addon`; CREATE TABLE `addon` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', - `title` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '插件名称', - `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '插件图标', - `key` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '插件标识', - `desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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 NULL COMMENT '插件描述', `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态', - `author` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '作者', - `version` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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 '更新时间', - `cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '封面', - `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'app' COMMENT '插件类型app,addon', - `support_app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '插件支持的应用空表示通用插件', + `cover` varchar(255) NOT NULL DEFAULT '' COMMENT '封面', + `type` varchar(255) NOT NULL DEFAULT 'app' COMMENT '插件类型app,addon', + `support_app` varchar(255) NOT NULL DEFAULT '' COMMENT '插件支持的应用空表示通用插件', `is_star` tinyint(4) NOT NULL DEFAULT 1 COMMENT '是否加星', - `compile` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '编译端口', + `compile` varchar(2000) NOT NULL DEFAULT '' COMMENT '编译端口', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件表' ROW_FORMAT = Dynamic; DROP TABLE IF EXISTS `addon_log`; CREATE TABLE `addon_log` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', - `action` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作类型 install 安装 uninstall 卸载 update 更新', - `key` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '插件标识', - `from_version` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '升级前的版本号', - `to_version` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '升级后的版本号', + `action` varchar(40) NOT NULL DEFAULT '' COMMENT '操作类型 install 安装 uninstall 卸载 update 更新', + `key` varchar(20) NOT NULL DEFAULT '' COMMENT '插件标识', + `from_version` varchar(20) NOT NULL DEFAULT '' COMMENT '升级前的版本号', + `to_version` varchar(20) NOT NULL DEFAULT '' COMMENT '升级后的版本号', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件日志表' ROW_FORMAT = Dynamic; @@ -38,8 +38,8 @@ CREATE TABLE `applet_site_version` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', `version_id` int(11) NOT NULL DEFAULT 0 COMMENT '版本id', - `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '小程序类型', - `action` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作方式 download 下载 upgrade 更新', + `type` varchar(20) NOT NULL DEFAULT '' COMMENT '小程序类型', + `action` varchar(20) NOT NULL DEFAULT '' COMMENT '操作方式 download 下载 upgrade 更新', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '站点小程序版本表' ROW_FORMAT = Dynamic; @@ -47,15 +47,15 @@ CREATE TABLE `applet_site_version` ( DROP TABLE IF EXISTS `applet_version`; CREATE TABLE `applet_version` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', - `config` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置信息', - `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '小程序类型', - `desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '插件描述', + `config` varchar(255) NOT NULL DEFAULT '' COMMENT '配置信息', + `type` varchar(20) NOT NULL DEFAULT '' COMMENT '小程序类型', + `desc` text NULL COMMENT '插件描述', `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态 下架 上架', - `uid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '发布者', - `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '小程序包地址', - `version` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '版本号', - `version_num` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '版本号数字(用于排序)', - `release_version` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '发布线上版本号', + `uid` varchar(40) NOT NULL DEFAULT '' COMMENT '发布者', + `path` varchar(255) NOT NULL DEFAULT '' COMMENT '小程序包地址', + `version` varchar(20) NOT NULL DEFAULT '' COMMENT '版本号', + `version_num` varchar(20) NOT NULL DEFAULT '' COMMENT '版本号数字(用于排序)', + `release_version` varchar(20) NOT NULL DEFAULT '' 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 '更新时间', @@ -66,30 +66,31 @@ CREATE TABLE `applet_version` ( DROP TABLE IF EXISTS `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '页面名称', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '页面标识', - `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '页面模板', - `template` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '模板名称', - `mode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'diy' COMMENT '页面展示模式,diy:自定义,fixed:固定', - `value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分享内容', - `visit_count` int(11) NOT NULL DEFAULT 0 COMMENT '访问量', - `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', + `page_title` varchar(255) NOT NULL DEFAULT '' COMMENT '页面名称(用于后台展示)', + `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 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 '创建时间', + `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '自定义页面' ROW_FORMAT = Dynamic; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci COMMENT='自定义页面' ROW_FORMAT=DYNAMIC; DROP TABLE IF EXISTS `diy_route`; CREATE TABLE `diy_route` ( `id` int(11) NOT NULL AUTO_INCREMENT, `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', - `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '页面名称', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '页面标识', - `page` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '页面路径', - `share` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分享内容', + `title` varchar(255) NOT NULL DEFAULT '' COMMENT '页面名称', + `name` varchar(255) NOT NULL DEFAULT '' COMMENT '页面标识', + `page` varchar(255) NOT NULL DEFAULT '' COMMENT '页面路径', + `share` varchar(1000) NOT NULL DEFAULT '' COMMENT '分享内容', `is_share` int(11) NOT NULL DEFAULT 0 COMMENT '是否支持分享', `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序', PRIMARY KEY (`id`) USING BTREE @@ -99,44 +100,44 @@ DROP TABLE IF EXISTS `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', - `column_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '字段名称', - `column_comment` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '字段描述', - `column_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '字段类型', - `is_required` tinyint(4) NULL DEFAULT 0 COMMENT '是否必填 0-非必填 1-必填', - `is_pk` tinyint(4) NULL DEFAULT 0 COMMENT '是否为主键 0-不是 1-是', - `is_insert` tinyint(4) NULL DEFAULT 0 COMMENT '是否为插入字段 0-不是 1-是', - `is_update` tinyint(4) NULL DEFAULT 0 COMMENT '是否为更新字段 0-不是 1-是', - `is_lists` tinyint(4) NULL DEFAULT 1 COMMENT '是否为列表字段 0-不是 1-是', - `is_query` tinyint(4) NULL DEFAULT 1 COMMENT '是否为查询字段 0-不是 1-是', - `is_search` tinyint(4) NULL DEFAULT 1 COMMENT '是否搜索字段', - `query_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '=' COMMENT '查询类型', - `view_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'input' COMMENT '显示类型', - `dict_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `addon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '远程下拉关联应用', - `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '远程下拉关联model', - `label_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '远程下拉标题字段', - `value_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '远程下拉value字段', + `column_name` varchar(100) NOT NULL DEFAULT '' COMMENT '字段名称', + `column_comment` varchar(300) NOT NULL DEFAULT '' COMMENT '字段描述', + `column_type` varchar(100) NOT NULL DEFAULT '' COMMENT '字段类型', + `is_required` tinyint(1) NULL DEFAULT 0 COMMENT '是否必填 0-非必填 1-必填', + `is_pk` tinyint(1) NULL DEFAULT 0 COMMENT '是否为主键 0-不是 1-是', + `is_insert` tinyint(1) NULL DEFAULT 0 COMMENT '是否为插入字段 0-不是 1-是', + `is_update` tinyint(1) NULL DEFAULT 0 COMMENT '是否为更新字段 0-不是 1-是', + `is_lists` tinyint(1) NULL DEFAULT 1 COMMENT '是否为列表字段 0-不是 1-是', + `is_query` tinyint(1) NULL DEFAULT 1 COMMENT '是否为查询字段 0-不是 1-是', + `is_search` tinyint(1) NULL DEFAULT 1 COMMENT '是否搜索字段', + `query_type` varchar(100) NULL DEFAULT '=' COMMENT '查询类型', + `view_type` varchar(100) NULL DEFAULT 'input' COMMENT '显示类型', + `dict_type` varchar(255) NULL DEFAULT '' COMMENT '字典类型', + `addon` varchar(255) NULL DEFAULT '' COMMENT '远程下拉关联应用', + `model` varchar(255) NULL DEFAULT '' COMMENT '远程下拉关联model', + `label_key` varchar(255) NULL DEFAULT '' COMMENT '远程下拉标题字段', + `value_key` varchar(255) NULL DEFAULT '' COMMENT '远程下拉value字段', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', `is_delete` tinyint(4) NULL DEFAULT 0 COMMENT '是否为软删除字段 0-不是 1-是', `is_order` tinyint(4) NULL DEFAULT 0 COMMENT '是否为排序字段 0-不是 1-是', - `validate_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '验证类型', + `validate_type` varchar(255) NULL DEFAULT '' COMMENT '验证类型', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成表字段信息表' ROW_FORMAT = Dynamic; DROP TABLE IF EXISTS `generate_table`; CREATE TABLE `generate_table` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', - `table_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '表名', - `table_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '描述前缀', - `module_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '模块名', - `class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '类名前缀', + `table_name` varchar(255) NOT NULL DEFAULT '' COMMENT '表名', + `table_content` varchar(255) NOT NULL DEFAULT '' COMMENT '描述前缀', + `module_name` varchar(255) NOT NULL DEFAULT '' COMMENT '模块名', + `class_name` varchar(255) NOT NULL DEFAULT '' COMMENT '类名前缀', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', `edit_type` int(11) NOT NULL DEFAULT 1 COMMENT '编辑方式 1-弹框 2-新页面', - `addon_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '插件名', + `addon_name` varchar(255) NOT NULL DEFAULT '' COMMENT '插件名', `order_type` int(11) NOT NULL DEFAULT 0 COMMENT '排序方式 0-无排序 1-正序 2-倒序', - `parent_menu` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '上级菜单', - `relations` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '关联配置', + `parent_menu` varchar(255) NOT NULL DEFAULT '' COMMENT '上级菜单', + `relations` text NULL COMMENT '关联配置', `synchronous_number` int(11) NOT NULL DEFAULT 0 COMMENT '同步次数', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成表' ROW_FORMAT = Dynamic; @@ -144,22 +145,22 @@ CREATE TABLE `generate_table` ( DROP TABLE IF EXISTS `jobs`; CREATE TABLE `jobs` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `queue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `attempts` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, - `reserve_time` int(10) UNSIGNED NULL DEFAULT 0, - `available_time` int(10) UNSIGNED NULL DEFAULT 0, - `create_time` int(10) UNSIGNED NULL DEFAULT 0, + `queue` varchar(255) NOT NULL, + `payload` longtext NOT NULL, + `attempts` tinyint(4) UNSIGNED NOT NULL DEFAULT 0, + `reserve_time` int(11) UNSIGNED NULL DEFAULT 0, + `available_time` int(11) UNSIGNED NULL DEFAULT 0, + `create_time` int(11) UNSIGNED NULL DEFAULT 0, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '消息队列任务表' ROW_FORMAT = Dynamic; DROP TABLE IF EXISTS `jobs_failed`; CREATE TABLE `jobs_failed` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `connection` text NOT NULL, + `queue` text NOT NULL, + `payload` longtext NOT NULL, + `exception` longtext NOT NULL, `fail_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '消息队列任务失败记录表' ROW_FORMAT = Dynamic; @@ -167,26 +168,26 @@ CREATE TABLE `jobs_failed` ( DROP TABLE IF EXISTS `member`; CREATE TABLE `member` ( `member_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', - `member_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员编码', + `member_no` varchar(255) NOT NULL DEFAULT '' COMMENT '会员编码', `pid` int(11) NOT NULL DEFAULT 0 COMMENT '推广会员id', `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员用户名', - `mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号', - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员密码', - `nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员昵称', - `headimg` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员头像', + `username` varchar(255) NOT NULL DEFAULT '' COMMENT '会员用户名', + `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号', + `password` varchar(255) NOT NULL DEFAULT '' COMMENT '会员密码', + `nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '会员昵称', + `headimg` varchar(1000) NOT NULL DEFAULT '' COMMENT '会员头像', `member_level` int(11) NOT NULL DEFAULT 0 COMMENT '会员等级', - `member_label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员标签', - `wx_openid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '微信用户openid', - `weapp_openid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '微信小程序openid', - `wx_unionid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '微信unionid', - `ali_openid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付宝账户id', - `douyin_openid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '抖音小程序openid', - `register_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'H5' COMMENT '注册来源', - `register_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '注册方式', - `login_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '当前登录ip', - `login_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'h5' COMMENT '当前登录的操作终端类型', - `login_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', + `member_label` varchar(255) NOT NULL DEFAULT '' COMMENT '会员标签', + `wx_openid` varchar(255) NOT NULL DEFAULT '' COMMENT '微信用户openid', + `weapp_openid` varchar(255) NOT NULL DEFAULT '' COMMENT '微信小程序openid', + `wx_unionid` varchar(255) NOT NULL DEFAULT '' COMMENT '微信unionid', + `ali_openid` varchar(255) NOT NULL DEFAULT '' COMMENT '支付宝账户id', + `douyin_openid` varchar(255) NOT NULL DEFAULT '' COMMENT '抖音小程序openid', + `register_channel` varchar(255) NOT NULL DEFAULT 'H5' COMMENT '注册来源', + `register_type` varchar(255) NOT NULL DEFAULT '' COMMENT '注册方式', + `login_ip` varchar(255) NOT NULL DEFAULT '' COMMENT '当前登录ip', + `login_type` varchar(255) NOT NULL DEFAULT 'h5' COMMENT '当前登录的操作终端类型', + `login_channel` varchar(255) NOT NULL DEFAULT '', `login_count` int(11) NOT NULL DEFAULT 0 COMMENT '登录次数', `login_time` int(11) NOT NULL DEFAULT 0 COMMENT '当前登录时间', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '注册时间', @@ -194,7 +195,7 @@ CREATE TABLE `member` ( `last_consum_time` int(11) NOT NULL DEFAULT 0 COMMENT '最后消费时间', `sex` tinyint(4) NOT NULL DEFAULT 0 COMMENT '性别 0保密 1男 2女', `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '用户状态 用户状态默认为1', - `birthday` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '出生日期', + `birthday` varchar(20) NOT NULL DEFAULT '' COMMENT '出生日期', `point` int(11) NOT NULL DEFAULT 0 COMMENT '可用积分', `point_get` int(11) NOT NULL DEFAULT 0 COMMENT '累计获取积分', `balance` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '可用余额', @@ -213,8 +214,8 @@ CREATE TABLE `member` ( `province_id` int(11) NOT NULL DEFAULT 0 COMMENT '省id', `city_id` int(11) NOT NULL DEFAULT 0 COMMENT '市id', `district_id` int(11) NOT NULL DEFAULT 0 COMMENT '区县id', - `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址', - `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '定位地址', + `address` varchar(255) NOT NULL DEFAULT '' COMMENT '详细地址', + `location` varchar(255) NOT NULL DEFAULT '' COMMENT '定位地址', `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', PRIMARY KEY (`member_id`) USING BTREE @@ -225,13 +226,13 @@ CREATE TABLE `member_account_log` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `member_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户id', `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', - `account_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'point' COMMENT '账户类型', + `account_type` varchar(255) NOT NULL DEFAULT 'point' COMMENT '账户类型', `account_data` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '账户数据', `account_sum` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '变动后的账户余额', - `from_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '来源类型', - `related_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '关联Id', + `from_type` varchar(255) NOT NULL DEFAULT '' COMMENT '来源类型', + `related_id` varchar(50) NOT NULL DEFAULT '' COMMENT '关联Id', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', - `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注信息', + `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注信息', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员账单表' ROW_FORMAT = Dynamic; @@ -259,23 +260,22 @@ CHARACTER SET utf8mb4, COLLATE utf8mb4_general_ci, COMMENT = '会员收货地址'; -ALTER TABLE `member_address` - ADD INDEX IDX_member_address (member_id); +ALTER TABLE `member_address`ADD INDEX IDX_member_address (member_id); DROP TABLE IF EXISTS `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', - `cash_out_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提现交易号', + `cash_out_no` varchar(50) NOT NULL DEFAULT '' COMMENT '提现交易号', `member_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id', - `account_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'money' COMMENT '提现账户类型', - `transfer_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '转账提现类型', - `transfer_realname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '联系人名称', - `transfer_mobile` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号', - `transfer_bank` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '银行名称', - `transfer_account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '收款账号', - `transfer_fail_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '失败原因', - `transfer_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '转账状态', + `account_type` varchar(255) NOT NULL DEFAULT 'money' COMMENT '提现账户类型', + `transfer_type` varchar(20) NOT NULL DEFAULT '0' COMMENT '转账提现类型', + `transfer_realname` varchar(50) NOT NULL DEFAULT '' COMMENT '联系人名称', + `transfer_mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号', + `transfer_bank` varchar(255) NOT NULL DEFAULT '' COMMENT '银行名称', + `transfer_account` varchar(255) NOT NULL DEFAULT '' COMMENT '收款账号', + `transfer_fail_reason` varchar(255) NOT NULL DEFAULT '' COMMENT '失败原因', + `transfer_status` varchar(20) NOT NULL DEFAULT '' COMMENT '转账状态', `transfer_time` int(11) NOT NULL DEFAULT 0 COMMENT '转账时间', `apply_money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '提现申请金额', `rate` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '提现手续费比率', @@ -283,13 +283,13 @@ CREATE TABLE `member_cash_out` ( `money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '提现到账金额', `audit_time` int(11) NOT NULL DEFAULT 0 COMMENT '审核时间', `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态1待审核2.待转账3已转账 -1拒绝 -2 已取消', - `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注', + `remark` varchar(100) NOT NULL DEFAULT '' COMMENT '备注', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '申请时间', - `refuse_reason` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '拒绝理由', + `refuse_reason` varchar(100) NOT NULL DEFAULT '' COMMENT '拒绝理由', `update_time` int(11) NOT NULL DEFAULT 0, - `transfer_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '转账单号', + `transfer_no` varchar(50) NOT NULL DEFAULT '' COMMENT '转账单号', `cancel_time` int(11) NOT NULL DEFAULT 0 COMMENT '取消时间', - `final_transfer_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '转账方式', + `final_transfer_type` varchar(255) NOT NULL DEFAULT '' COMMENT '转账方式', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员提现表' ROW_FORMAT = Dynamic; @@ -298,12 +298,12 @@ CREATE TABLE `member_cash_out_account` ( `account_id` int(11) NOT NULL AUTO_INCREMENT, `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', `member_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id', - `account_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户类型', - `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '银行名称', - `realname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '真实名称', + `account_type` varchar(255) NOT NULL DEFAULT '' COMMENT '账户类型', + `bank_name` varchar(255) NOT NULL DEFAULT '' COMMENT '银行名称', + `realname` varchar(255) NOT NULL DEFAULT '' COMMENT '真实名称', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', - `account_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提现账户', + `account_no` varchar(255) NOT NULL DEFAULT '' COMMENT '提现账户', PRIMARY KEY (`account_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员提现账户' ROW_FORMAT = Dynamic; @@ -311,8 +311,8 @@ DROP TABLE IF EXISTS `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', - `label_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标签名称', - `memo` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注', + `label_name` varchar(50) NOT NULL DEFAULT '' COMMENT '标签名称', + `memo` varchar(1000) NOT NULL DEFAULT '' COMMENT '备注', `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', @@ -322,39 +322,56 @@ CREATE TABLE `member_label` ( DROP TABLE IF EXISTS `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', - `level_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '等级名称', - `growth` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '所需成长值', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注', - `status` int(11) NOT NULL DEFAULT 1 COMMENT '状态 0已禁用1已启用', - `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', - `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + `level_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '会员等级', + `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', + `level_name` varchar(50) NOT NULL DEFAULT '' COMMENT '等级名称', + `growth` int(11) NOT NULL DEFAULT '0' COMMENT '所需成长值', + `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', + `status` int(11) NOT NULL DEFAULT '1' COMMENT '状态 0已禁用1已启用', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', + `level_benefits` text COMMENT '等级权益', + `level_gifts` text COMMENT '等级礼包', PRIMARY KEY (`level_id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员等级' ROW_FORMAT = Dynamic; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci COMMENT='会员等级' ROW_FORMAT=DYNAMIC; + +DROP TABLE IF EXISTS `member_sign`; +CREATE TABLE `member_sign` ( + `sign_id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', + `member_id` int(11) NOT NULL DEFAULT '0' COMMENT '会员id', + `days` int(11) NOT NULL DEFAULT '0' COMMENT '连续签到天数', + `day_award` varchar(255) NOT NULL DEFAULT '' COMMENT '日签奖励', + `continue_award` varchar(255) NOT NULL DEFAULT '' COMMENT '连签奖励', + `continue_tag` varchar(30) NOT NULL DEFAULT '' COMMENT '连签奖励标识', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '签到时间', + `start_time` int(11) NOT NULL DEFAULT '0' COMMENT '签到周期开始时间', + `is_sign` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否签到(0未签到 1已签到)', + PRIMARY KEY (`sign_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci COMMENT='会员签到表' ROW_FORMAT=DYNAMIC; DROP TABLE IF EXISTS `pay`; CREATE TABLE `pay` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', `main_id` int(11) NOT NULL DEFAULT 0 COMMENT '支付会员id', - `out_trade_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付流水号', - `trade_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '业务类型', + `out_trade_no` varchar(255) NOT NULL DEFAULT '' COMMENT '支付流水号', + `trade_type` varchar(255) NOT NULL DEFAULT '' COMMENT '业务类型', `trade_id` int(11) NOT NULL DEFAULT 0 COMMENT '业务id', - `trade_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '交易单号', - `body` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付主体', + `trade_no` varchar(255) NOT NULL DEFAULT '' COMMENT '交易单号', + `body` varchar(1000) NOT NULL DEFAULT '' COMMENT '支付主体', `money` decimal(10, 2) NOT NULL COMMENT '支付金额', - `voucher` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付票据', + `voucher` varchar(255) NOT NULL DEFAULT '' COMMENT '支付票据', `status` int(11) NOT NULL DEFAULT 0 COMMENT '支付状态(0.待支付 1. 支付中 2. 已支付 -1已取消)', - `json` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付扩展用支付信息', + `json` varchar(255) NOT NULL DEFAULT '' COMMENT '支付扩展用支付信息', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', `pay_time` int(11) NOT NULL DEFAULT 0 COMMENT '支付时间', `cancel_time` int(11) NOT NULL DEFAULT 0 COMMENT '关闭时间', - `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付方式', - `mch_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '商户收款账号', - `main_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', - `channel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付渠道', - `fail_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '失败原因', + `type` varchar(255) NOT NULL DEFAULT '' COMMENT '支付方式', + `mch_id` varchar(50) NOT NULL DEFAULT '' COMMENT '商户收款账号', + `main_type` varchar(255) NOT NULL DEFAULT '', + `channel` varchar(50) NOT NULL DEFAULT '' COMMENT '支付渠道', + `fail_reason` varchar(255) NOT NULL DEFAULT '' COMMENT '失败原因', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '支付记录表' ROW_FORMAT = Dynamic; @@ -362,9 +379,9 @@ DROP TABLE IF EXISTS `pay_channel`; CREATE TABLE `pay_channel` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', `site_id` int(11) NOT NULL DEFAULT 1 COMMENT '站点id', - `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付类型', - `channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付渠道', - `config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付配置', + `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 '修改时间', `status` int(11) NOT NULL DEFAULT 0 COMMENT '是否启用', @@ -376,18 +393,18 @@ DROP TABLE IF EXISTS `pay_refund`; 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 utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '退款单号', - `out_trade_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付流水号', - `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付方式', - `channel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_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 utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '退款原因', - `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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 '关闭时间', - `fail_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '失败原因', - `voucher` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付凭证', + `fail_reason` varchar(255) NOT NULL DEFAULT '' COMMENT '失败原因', + `voucher` varchar(255) NOT NULL DEFAULT '' COMMENT '支付凭证', `trade_type` varchar(255) NOT NULL DEFAULT '' COMMENT '业务类型', `trade_id` varchar(50) NOT NULL DEFAULT '' COMMENT '业务关联id', `refund_type` varchar(255) NOT NULL DEFAULT '' COMMENT '退款方式', @@ -401,26 +418,26 @@ DROP TABLE IF EXISTS `pay_transfer`; CREATE TABLE `pay_transfer` ( `id` int(11) NOT NULL AUTO_INCREMENT, `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', - `trade_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '业务类型', - `transfer_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '转账单号', + `trade_type` varchar(255) NOT NULL DEFAULT '' COMMENT '业务类型', + `transfer_no` varchar(50) NOT NULL DEFAULT '' COMMENT '转账单号', `main_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id', - `main_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '主体类型', - `transfer_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '转账类型', - `transfer_realname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '联系人名称', - `transfer_mobile` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号', - `transfer_bank` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '银行名称', - `transfer_account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '收款账号', - `transfer_voucher` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '凭证', - `transfer_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '凭证说明', - `transfer_fail_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '失败原因', - `transfer_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '转账状态', + `main_type` varchar(255) NOT NULL DEFAULT '' COMMENT '主体类型', + `transfer_type` varchar(20) NOT NULL DEFAULT '' COMMENT '转账类型', + `transfer_realname` varchar(50) NOT NULL DEFAULT '' COMMENT '联系人名称', + `transfer_mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号', + `transfer_bank` varchar(255) NOT NULL DEFAULT '' COMMENT '银行名称', + `transfer_account` varchar(255) NOT NULL DEFAULT '' COMMENT '收款账号', + `transfer_voucher` varchar(255) NOT NULL DEFAULT '' COMMENT '凭证', + `transfer_remark` varchar(255) NOT NULL DEFAULT '' COMMENT '凭证说明', + `transfer_fail_reason` varchar(255) NOT NULL DEFAULT '' COMMENT '失败原因', + `transfer_status` varchar(20) NOT NULL DEFAULT '' COMMENT '转账状态', `money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '转账金额', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '申请时间', `transfer_time` int(11) NOT NULL DEFAULT 0 COMMENT '转账时间', `update_time` int(11) NOT NULL DEFAULT 0, - `openid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `batch_id` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '转账批次id', + `openid` varchar(50) NOT NULL DEFAULT '', + `remark` varchar(255) NOT NULL, + `batch_id` varchar(500) NOT NULL DEFAULT '' COMMENT '转账批次id', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '转账表' ROW_FORMAT = Dynamic; @@ -428,15 +445,15 @@ DROP TABLE IF EXISTS `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单编号', - `order_from` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单来源', - `order_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单类型', - `out_trade_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付流水号', + `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员ip', - `member_message` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员留言信息', + `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 '订单金额', @@ -445,9 +462,9 @@ CREATE TABLE `recharge_order` ( `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '商家留言', + `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '商家留言', `invoice_id` int(11) NOT NULL DEFAULT 0 COMMENT '发票id,0表示不开发票', - `close_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '关闭原因', + `close_reason` varchar(255) NOT NULL DEFAULT '' COMMENT '关闭原因', PRIMARY KEY (`order_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单表' ROW_FORMAT = Dynamic; @@ -458,14 +475,14 @@ CREATE TABLE `recharge_order_item` ( `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '项目类型', - `item_name` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '项目名称', - `item_image` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '项目图片', + `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' 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`) USING BTREE @@ -476,8 +493,8 @@ 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单编号', - `refund_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '退款单号', + `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 '退货数量', @@ -486,7 +503,7 @@ CREATE TABLE `recharge_order_item_refund` ( `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '项目类型', + `item_type` varchar(255) NOT NULL DEFAULT '' COMMENT '项目类型', PRIMARY KEY (`refund_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单退款表' ROW_FORMAT = Dynamic; @@ -495,12 +512,12 @@ 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作内容', + `action` varchar(255) NOT NULL DEFAULT '' COMMENT '操作内容', `uid` int(11) NOT NULL DEFAULT 0 COMMENT '操作人id', - `nick_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作人名称', + `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单状态名称,操作后', + `order_status_name` varchar(255) NOT NULL DEFAULT '' COMMENT '订单状态名称,操作后', `action_time` int(11) NOT NULL DEFAULT 0 COMMENT '操作时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单操作记录表' ROW_FORMAT = Dynamic; @@ -508,30 +525,31 @@ CREATE TABLE `recharge_order_log` ( DROP TABLE IF EXISTS `site`; CREATE TABLE `site` ( `site_id` int(11) NOT NULL AUTO_INCREMENT, - `site_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '站点名称', + `site_name` varchar(50) NOT NULL DEFAULT '' COMMENT '站点名称', `group_id` int(11) NOT NULL DEFAULT 0 COMMENT '分组ID(0:不限制)', - `keywords` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '关键字', - `app_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'admin' COMMENT '站点类型', - `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '站点logo', - `desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '简介', + `keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字', + `app_type` varchar(50) NOT NULL DEFAULT 'admin' COMMENT '站点类型', + `logo` varchar(255) NOT NULL DEFAULT '' COMMENT '站点logo', + `desc` varchar(255) NOT NULL DEFAULT '' COMMENT '简介', `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态 1-正常 0-体验期 2-已到期', - `latitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '纬度', - `longitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '经度', + `latitude` varchar(255) NOT NULL DEFAULT '' COMMENT '纬度', + `longitude` varchar(255) NOT NULL DEFAULT '' COMMENT '经度', `province_id` int(11) NOT NULL DEFAULT 0 COMMENT '省', `city_id` int(11) NOT NULL DEFAULT 0 COMMENT '市', `district_id` int(11) NOT NULL DEFAULT 0 COMMENT '区', - `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址', - `full_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '完整地址', - `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '客服电话', - `business_hours` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '营业时间', + `address` varchar(255) NOT NULL DEFAULT '' COMMENT '详细地址', + `full_address` varchar(255) NOT NULL DEFAULT '' COMMENT '完整地址', + `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(20) NOT NULL DEFAULT 0 COMMENT '到期时间(如果是0 无限期)', - `front_end_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '前台名称', - `front_end_logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '前台logo', - `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '网站图标', - `member_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '最大会员码值', - `app` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '站点主应用', - `addons` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '站点包含的插件', + `front_end_name` varchar(50) NOT NULL DEFAULT '' COMMENT '前台名称', + `front_end_logo` varchar(255) NOT NULL DEFAULT '' COMMENT '前台logo', + `front_end_icon` varchar(255) NOT NULL DEFAULT '' COMMENT '前台icon', + `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '网站图标', + `member_no` varchar(255) NOT NULL DEFAULT '0' COMMENT '最大会员码值', + `app` text NOT NULL COMMENT '站点主应用', + `addons` text NOT NULL COMMENT '站点包含的插件', `initalled_addon` text DEFAULT NULL COMMENT '站点已执行初始化方法的插件', `site_domain` varchar(255) NOT NULL DEFAULT '' COMMENT '站点域名', PRIMARY KEY (`site_id`) USING BTREE @@ -541,32 +559,71 @@ DROP TABLE IF EXISTS `site_account_log`; 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pay' COMMENT '账单类型pay,refund,transfer', + `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '对应类型交易单号', - `create_time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '添加时间', + `trade_no` varchar(255) NOT NULL DEFAULT '' COMMENT '对应类型交易单号', + `create_time` varchar(255) NOT NULL DEFAULT '0' COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '站点账单记录' ROW_FORMAT = Dynamic; DROP TABLE IF EXISTS `site_group`; CREATE TABLE `site_group` ( `group_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '分组ID', - `group_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分组名称', - `group_desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '分组介绍', - `app` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '应用', - `addon` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '插件', + `group_name` varchar(255) NOT NULL DEFAULT '' COMMENT '分组名称', + `group_desc` text NULL COMMENT '分组介绍', + `app` text NOT NULL COMMENT '应用', + `addon` text NOT NULL COMMENT '插件', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`group_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '店铺分组(分组权限)' ROW_FORMAT = Dynamic; +DROP TABLE IF EXISTS `stat_hour`; +CREATE TABLE `stat_hour` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', + `addon` varchar(255) NOT NULL DEFAULT '' COMMENT '插件', + `field` varchar(255) NOT NULL DEFAULT '' COMMENT '统计字段', + `field_total` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '总计', + `year` int(11) NOT NULL DEFAULT '0' COMMENT '年', + `month` int(11) NOT NULL DEFAULT '0' COMMENT '月', + `day` int(11) NOT NULL DEFAULT '0' COMMENT '天', + `start_time` int(11) NOT NULL DEFAULT '0' COMMENT '当日开始时间戳', + `last_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后执行时间', + `hour_0` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_1` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_2` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_3` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_4` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_5` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_6` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_7` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_8` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_9` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_10` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_11` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_12` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_13` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_14` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_15` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_16` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_17` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_18` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_19` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_20` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_21` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_22` decimal(10,2) NOT NULL DEFAULT '0.00', + `hour_23` decimal(10,2) NOT NULL DEFAULT '0.00', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci COMMENT='小时统计表' ROW_FORMAT=DYNAMIC; + DROP TABLE IF EXISTS `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', - `agreement_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '协议关键字', - `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '协议标题', - `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '协议内容', + `agreement_key` varchar(255) NOT NULL DEFAULT '' COMMENT '协议关键字', + `title` varchar(255) NOT NULL DEFAULT '' COMMENT '协议标题', + `content` text NULL COMMENT '协议内容', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE @@ -576,10 +633,10 @@ DROP TABLE IF EXISTS `sys_area`; CREATE TABLE `sys_area` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `pid` int(11) NOT NULL DEFAULT 0 COMMENT '父级', - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '名称', - `shortname` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '简称', - `longitude` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '经度', - `latitude` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '纬度', + `name` varchar(50) NOT NULL DEFAULT '' COMMENT '名称', + `shortname` varchar(30) NOT NULL DEFAULT '' COMMENT '简称', + `longitude` varchar(30) NOT NULL DEFAULT '' COMMENT '经度', + `latitude` varchar(30) NOT NULL DEFAULT '' COMMENT '纬度', `level` smallint(6) NOT NULL DEFAULT 0 COMMENT '级别', `sort` mediumint(9) NOT NULL DEFAULT 0 COMMENT '排序', `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态1有效', @@ -590,17 +647,17 @@ DROP TABLE IF EXISTS `sys_attachment`; CREATE TABLE `sys_attachment` ( `att_id` int(11) NOT NULL AUTO_INCREMENT, `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', - `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '附件名称', - `real_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '原始文件名', - `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '完整地址', - `dir` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '附件路径', - `att_size` char(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '附件大小', - `att_type` char(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '附件类型image,video', - `storage_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '图片上传类型 local本地 aliyun 阿里云oss qiniu 七牛 ....', + `name` varchar(100) NOT NULL DEFAULT '' COMMENT '附件名称', + `real_name` varchar(255) NOT NULL DEFAULT '' COMMENT '原始文件名', + `path` varchar(255) NOT NULL DEFAULT '' COMMENT '完整地址', + `dir` varchar(200) NOT NULL DEFAULT '' COMMENT '附件路径', + `att_size` char(30) NOT NULL DEFAULT '' COMMENT '附件大小', + `att_type` char(30) NOT NULL DEFAULT '' COMMENT '附件类型image,video', + `storage_type` varchar(20) NOT NULL DEFAULT '' COMMENT '图片上传类型 local本地 aliyun 阿里云oss qiniu 七牛 ....', `cate_id` int(11) NOT NULL DEFAULT 0 COMMENT '相关分类', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '上传时间', `update_time` int(11) NOT NULL DEFAULT 0, - `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '网络地址', + `url` varchar(255) NOT NULL DEFAULT '' COMMENT '网络地址', PRIMARY KEY (`att_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '附件管理表' ROW_FORMAT = Dynamic; @@ -609,9 +666,9 @@ CREATE TABLE `sys_attachment_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', `pid` int(11) NOT NULL DEFAULT 0 COMMENT '父级ID', - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文件管理类型(image,video)', - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分类名称', - `enname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分类目录', + `type` varchar(50) NOT NULL DEFAULT '' COMMENT '文件管理类型(image,video)', + `name` varchar(50) NOT NULL DEFAULT '' COMMENT '分类名称', + `enname` varchar(50) NOT NULL DEFAULT '' COMMENT '分类目录', `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `id`(`id` ASC) USING BTREE @@ -621,12 +678,12 @@ DROP TABLE IF EXISTS `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', - `config_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置项关键字', - `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '配置值json', + `config_key` varchar(255) NOT NULL DEFAULT '' COMMENT '配置项关键字', + `value` text NULL COMMENT '配置值json', `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '是否启用 1启用 0不启用', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', - `addon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '所属插件', + `addon` varchar(255) NOT NULL DEFAULT '' COMMENT '所属插件', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统配置表' ROW_FORMAT = Dynamic; @@ -636,13 +693,13 @@ CREATE TABLE `sys_cron_task` ( `site_id` int(11) NOT NULL DEFAULT 0, `status` int(11) NOT NULL DEFAULT 1 COMMENT '任务状态', `count` int(11) NOT NULL DEFAULT 0 COMMENT '执行次数', - `title` char(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务名称', - `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务模式 cron 定时任务 crond 周期任务', - `crond_type` char(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务周期', + `title` char(50) NOT NULL DEFAULT '' COMMENT '任务名称', + `type` varchar(255) NOT NULL DEFAULT '' COMMENT '任务模式 cron 定时任务 crond 周期任务', + `crond_type` char(200) NOT NULL DEFAULT '' COMMENT '任务周期', `crond_length` int(11) NOT NULL DEFAULT 0 COMMENT '任务周期', - `task` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务命令', - `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '附加参数', - `status_desc` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '上次执行结果', + `task` varchar(500) NOT NULL DEFAULT '' COMMENT '任务命令', + `data` longtext NULL COMMENT '附加参数', + `status_desc` varchar(1000) NOT NULL DEFAULT '' 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 '创建时间', @@ -655,37 +712,77 @@ CREATE TABLE `sys_cron_task` ( DROP TABLE IF EXISTS `sys_dict`; CREATE TABLE `sys_dict` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id', - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '字典名称', - `key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '字典关键词', - `dictionary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典数据', - `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', + `name` varchar(50) NOT NULL DEFAULT '' COMMENT '字典名称', + `key` varchar(100) NOT NULL DEFAULT '' COMMENT '字典关键词', + `dictionary` text NOT NULL COMMENT '字典数据', + `memo` varchar(255) NOT NULL DEFAULT '', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据字典表' ROW_FORMAT = Dynamic; +DROP TABLE IF EXISTS `sys_export`; +CREATE TABLE `sys_export` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点ID', + `export_key` varchar(255) NOT NULL DEFAULT '' COMMENT '主题关键字', + `export_num` int(11) NOT NULL DEFAULT '0' COMMENT '导出数据数量', + `file_path` varchar(255) NOT NULL DEFAULT '' COMMENT '文件存储路径', + `file_size` varchar(255) NOT NULL DEFAULT '' COMMENT '文件大小', + `export_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '导出状态', + `fail_reason` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '失败原因', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '导出时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci COMMENT='导出报表' ROW_FORMAT=DYNAMIC; + +DROP TABLE IF EXISTS `verifier`; +CREATE TABLE `verifier` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', + `member_id` int(11) NOT NULL DEFAULT '0' COMMENT '会员id', + `uid` int(11) NOT NULL DEFAULT '0' COMMENT '用户id', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + `verify_type` varchar(255) NOT NULL DEFAULT '' COMMENT '核销类型', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci COMMENT='核销员表' ROW_FORMAT=DYNAMIC; + +DROP TABLE IF EXISTS `verify`; +CREATE TABLE `verify` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', + `code` varchar(255) NOT NULL DEFAULT '' COMMENT '核销码', + `data` varchar(255) NOT NULL DEFAULT '' COMMENT '核销参数', + `type` varchar(30) NOT NULL DEFAULT '' COMMENT '核销类型', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '核销时间', + `verifier_member_id` int(11) NOT NULL DEFAULT '0' COMMENT '核销会员id', + `value` varchar(1000) NOT NULL DEFAULT '' COMMENT '核销内容', + `body` varchar(500) NOT NULL DEFAULT '' COMMENT '描述', + `relate_tag` varchar(255) NOT NULL DEFAULT '' COMMENT '业务标识', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci COMMENT='核销记录' ROW_FORMAT=DYNAMIC; + DROP TABLE IF EXISTS `sys_menu`; CREATE TABLE `sys_menu` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '菜单ID', - `app_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'admin' COMMENT '应用类型', - `menu_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单名称', - `menu_short_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单短标题', - `menu_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单标识(菜单输入,接口自动生成)', - `parent_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '父级key', + `app_type` varchar(255) NOT NULL DEFAULT 'admin' COMMENT '应用类型', + `menu_name` varchar(32) NOT NULL DEFAULT '' COMMENT '菜单名称', + `menu_short_name` varchar(50) NOT NULL DEFAULT '' COMMENT '菜单短标题', + `menu_key` varchar(255) NOT NULL DEFAULT '' COMMENT '菜单标识(菜单输入,接口自动生成)', + `parent_key` varchar(255) NOT NULL DEFAULT '' COMMENT '父级key', `menu_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '菜单类型 0目录 1菜单 2按钮', - `icon` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '图标 菜单有效', - `api_url` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'api接口地址', - `router_path` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单路由地址 前端使用', - `view_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单文件地址', - `methods` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提交方式POST GET PUT DELETE', + `icon` varchar(500) NOT NULL DEFAULT '' COMMENT '图标 菜单有效', + `api_url` varchar(100) NOT NULL DEFAULT '' COMMENT 'api接口地址', + `router_path` varchar(128) NOT NULL DEFAULT '' COMMENT '菜单路由地址 前端使用', + `view_path` varchar(255) NOT NULL DEFAULT '' COMMENT '菜单文件地址', + `methods` varchar(10) NOT NULL DEFAULT '' COMMENT '提交方式POST GET PUT DELETE', `sort` int NOT NULL DEFAULT 1 COMMENT '排序', `status` tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '正常,禁用(禁用后不允许访问)', `is_show` tinyint(4) NOT NULL DEFAULT 1 COMMENT '是否显示', `create_time` int(11) NOT NULL DEFAULT 0, `delete_time` int(11) NOT NULL DEFAULT 0, - `addon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '所属插件', - `source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'system' COMMENT '菜单来源 system 系统文件 create 新建菜单 generator 代码生成器', - `menu_attr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单属性 common 公共 system 系统', + `addon` varchar(255) NOT NULL DEFAULT '' COMMENT '所属插件', + `source` varchar(255) NOT NULL DEFAULT 'system' COMMENT '菜单来源 system 系统文件 create 新建菜单 generator 代码生成器', + `menu_attr` varchar(50) NOT NULL DEFAULT '' COMMENT '菜单属性 common 公共 system 系统', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单表' ROW_FORMAT = Dynamic; @@ -693,17 +790,17 @@ DROP TABLE IF EXISTS `sys_notice`; CREATE TABLE `sys_notice` ( `id` int(11) NOT NULL AUTO_INCREMENT, `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点ID', - `key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标识', - `sms_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '短信配置参数', + `key` varchar(50) NOT NULL DEFAULT '' COMMENT '标识', + `sms_content` text NULL COMMENT '短信配置参数', `is_wechat` tinyint(4) NOT NULL DEFAULT 0 COMMENT '公众号模板消息(0:关闭,1:开启)', `is_weapp` tinyint(4) NOT NULL DEFAULT 0 COMMENT '小程序订阅消息(0:关闭,1:开启)', `is_sms` tinyint(4) NOT NULL DEFAULT 0 COMMENT '发送短信(0:关闭,1:开启)', - `wechat_template_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '微信模版消息id', - `weapp_template_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '微信小程序订阅消息id', - `sms_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '短信id(对应短信配置)', + `wechat_template_id` varchar(255) NOT NULL DEFAULT '' COMMENT '微信模版消息id', + `weapp_template_id` varchar(255) NOT NULL DEFAULT '' COMMENT '微信小程序订阅消息id', + `sms_id` varchar(255) NOT NULL DEFAULT '' COMMENT '短信id(对应短信配置)', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', - `wechat_first` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '微信头部', - `wechat_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '微信说明', + `wechat_first` varchar(255) NOT NULL DEFAULT '' COMMENT '微信头部', + `wechat_remark` varchar(255) NOT NULL DEFAULT '' COMMENT '微信说明', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '通知模型' ROW_FORMAT = Dynamic; @@ -711,19 +808,19 @@ DROP TABLE IF EXISTS `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', - `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '消息key', - `notice_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'sms' COMMENT '消息类型(sms,wechat.weapp)', + `key` varchar(255) NULL DEFAULT '' COMMENT '消息key', + `notice_type` varchar(50) NULL DEFAULT 'sms' COMMENT '消息类型(sms,wechat.weapp)', `uid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '通知的用户id', `member_id` int(11) NOT NULL DEFAULT 0 COMMENT '消息的会员id', - `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '接收人用户昵称或姓名', - `receiver` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '接收人(对应手机号,openid)', - `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '消息数据', + `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '接收人用户昵称或姓名', + `receiver` varchar(255) NOT NULL DEFAULT '' COMMENT '接收人(对应手机号,openid)', + `content` text NULL COMMENT '消息数据', `is_click` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '点击次数', `is_visit` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '访问次数', `visit_time` int(11) NOT NULL DEFAULT 0 COMMENT '访问时间', `create_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '消息时间', - `result` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '结果', - `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, + `result` varchar(1000) NOT NULL DEFAULT '' COMMENT '结果', + `params` text NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '通知记录表' ROW_FORMAT = Dynamic; @@ -731,14 +828,14 @@ DROP TABLE IF EXISTS `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, - `mobile` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号码', - `sms_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '发送关键字(注册、找回密码)', - `key` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '发送关键字(注册、找回密码)', - `template_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', + `mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号码', + `sms_type` varchar(32) NOT NULL DEFAULT '' COMMENT '发送关键字(注册、找回密码)', + `key` varchar(32) NOT NULL DEFAULT '' COMMENT '发送关键字(注册、找回密码)', + `template_id` varchar(50) NOT NULL DEFAULT '', `content` text NOT NULL COMMENT '发送内容', `params` text NOT NULL COMMENT '数据参数', - `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'sending' COMMENT '发送状态:sending-发送中;success-发送成功;fail-发送失败', - `result` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '短信结果', + `status` varchar(32) NOT NULL DEFAULT 'sending' COMMENT '发送状态:sending-发送中;success-发送成功;fail-发送失败', + `result` text NULL COMMENT '短信结果', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', `send_time` int(11) NOT NULL DEFAULT 0 COMMENT '发送时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', @@ -750,8 +847,8 @@ DROP TABLE IF EXISTS `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', - `role_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '角色名称', - `rules` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '角色权限(menus_id)', + `role_name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称', + `rules` text NULL COMMENT '角色权限(menus_id)', `status` tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '最后修改时间', @@ -761,32 +858,27 @@ CREATE TABLE `sys_role` ( DROP TABLE IF EXISTS `sys_poster`; CREATE TABLE `sys_poster` ( `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', - `site_id` int NOT NULL DEFAULT 0 COMMENT '站点id', + `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', `name` varchar(255) NOT NULL DEFAULT '' COMMENT '海报名称', `type` varchar(255) NOT NULL DEFAULT '' COMMENT '海报类型', `channel` varchar(255) NOT NULL DEFAULT '' COMMENT '海报支持渠道', - `value` text DEFAULT NULL COMMENT '配置值json', - `status` tinyint NOT NULL DEFAULT 1 COMMENT '是否启用 1启用 2不启用', - `create_time` int NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int NOT NULL DEFAULT 0 COMMENT '修改时间', + `value` text COMMENT '配置值json', + `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否启用 1启用 2不启用', `addon` varchar(255) NOT NULL DEFAULT '' COMMENT '所属插件', + `is_default` int(11) NOT NULL DEFAULT '0' COMMENT '是否默认海报,1:是,0:否', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`) -) -ENGINE = INNODB, -AUTO_INCREMENT = 3, -AVG_ROW_LENGTH = 8192, -CHARACTER SET utf8mb4, -COLLATE utf8mb4_general_ci, -COMMENT = '海报表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci COMMENT='海报表' ROW_FORMAT=DYNAMIC; DROP TABLE IF EXISTS `sys_schedule`; CREATE TABLE `sys_schedule` ( `id` int(11) NOT NULL AUTO_INCREMENT, `site_id` int(11) NOT NULL DEFAULT 0, - `addon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '所属插件', - `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '计划任务模板key', + `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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务周期 json结构', + `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 '下次执行时间', @@ -800,11 +892,11 @@ CREATE TABLE `sys_schedule` ( DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `uid` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '系统用户ID', - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户账号', - `head_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', - `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户密码', - `real_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '实际姓名', - `last_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '最后一次登录ip', + `username` varchar(255) NOT NULL DEFAULT '' COMMENT '用户账号', + `head_img` varchar(255) NOT NULL DEFAULT '', + `password` varchar(100) NOT NULL DEFAULT '' COMMENT '用户密码', + `real_name` varchar(16) NOT NULL DEFAULT '' COMMENT '实际姓名', + `last_ip` varchar(50) NOT NULL DEFAULT '' COMMENT '最后一次登录ip', `last_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最后一次登录时间', `create_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', `login_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '登录次数', @@ -819,13 +911,13 @@ CREATE TABLE `sys_user` ( DROP TABLE IF EXISTS `sys_user_log`; CREATE TABLE `sys_user_log` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '管理员操作记录ID', - `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '登录IP', + `ip` varchar(50) NOT NULL DEFAULT '' COMMENT '登录IP', `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', `uid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '管理员id', - `username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '管理员姓名', - `url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '链接', + `username` varchar(64) NOT NULL DEFAULT '' COMMENT '管理员姓名', + `url` varchar(128) NOT NULL DEFAULT '' COMMENT '链接', `params` longtext DEFAULT NULL COMMENT '参数', - `type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '请求方式', + `type` varchar(32) NOT NULL DEFAULT '' COMMENT '请求方式', `create_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '管理员操作记录表' ROW_FORMAT = Dynamic; @@ -835,7 +927,7 @@ CREATE TABLE `sys_user_role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL DEFAULT 0 COMMENT '用户id', `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', - `role_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '角色id', + `role_ids` varchar(255) NOT NULL DEFAULT '' COMMENT '角色id', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', `is_admin` int(11) NOT NULL DEFAULT 0 COMMENT '是否是超级管理员', `status` int(11) NOT NULL DEFAULT 1 COMMENT '状态', @@ -846,14 +938,14 @@ DROP TABLE IF EXISTS `weapp_version`; CREATE TABLE `weapp_version` ( `id` int(11) NOT NULL AUTO_INCREMENT, `site_id` int(11) NOT NULL DEFAULT 0, - `version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', + `version` varchar(255) NOT NULL DEFAULT '', `version_no` int(11) NOT NULL DEFAULT 1, - `desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '说明', + `desc` varchar(255) NOT NULL DEFAULT '' COMMENT '说明', `create_time` int(11) NOT NULL DEFAULT 0, `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', `update_time` int(11) NOT NULL DEFAULT 0, `fail_reason` text DEFAULT NULL, - `task_key` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '上传任务key', + `task_key` varchar(20) NOT NULL DEFAULT '' COMMENT '上传任务key', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; @@ -861,21 +953,21 @@ DROP TABLE IF EXISTS `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', - `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '昵称', - `avatar` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像', + `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '昵称', + `avatar` varchar(500) NOT NULL DEFAULT '' COMMENT '头像', `sex` smallint(6) NOT NULL DEFAULT 1 COMMENT '性别', - `language` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户语言', - `country` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '国家', - `province` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省', - `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市', - `district` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '行政区/县', - `openid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户的标识,对当前公众号唯一 用户的唯一身份ID', - `unionid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '粉丝unionid', + `language` varchar(20) NOT NULL DEFAULT '' COMMENT '用户语言', + `country` varchar(60) NOT NULL DEFAULT '' COMMENT '国家', + `province` varchar(255) NOT NULL DEFAULT '' COMMENT '省', + `city` varchar(255) NOT NULL DEFAULT '' COMMENT '城市', + `district` varchar(255) NOT NULL DEFAULT '' COMMENT '行政区/县', + `openid` varchar(255) NOT NULL DEFAULT '' COMMENT '用户的标识,对当前公众号唯一 用户的唯一身份ID', + `unionid` varchar(255) NOT NULL DEFAULT '' COMMENT '粉丝unionid', `groupid` int(11) NOT NULL DEFAULT 0 COMMENT '粉丝所在组id', `is_subscribe` tinyint(4) NOT NULL DEFAULT 1 COMMENT '是否订阅', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注', + `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', `subscribe_time` int(11) NOT NULL DEFAULT 0 COMMENT '关注时间', - `subscribe_scene` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '返回用户关注的渠道来源', + `subscribe_scene` varchar(100) NOT NULL DEFAULT '' COMMENT '返回用户关注的渠道来源', `unsubscribe_time` int(11) NOT NULL DEFAULT 0 COMMENT '取消关注时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '粉丝信息最后更新时间', `app_id` int(11) NOT NULL DEFAULT 0 COMMENT '应用appid', @@ -886,11 +978,11 @@ DROP TABLE IF EXISTS `wechat_media`; CREATE TABLE `wechat_media` ( `id` int(11) NOT NULL AUTO_INCREMENT, `site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id', - `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '类型', - `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '值', + `type` varchar(255) NOT NULL DEFAULT '' COMMENT '类型', + `value` text NULL COMMENT '值', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', - `media_id` varchar(70) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '微信端返回的素材id', + `media_id` varchar(70) NOT NULL DEFAULT '0' COMMENT '微信端返回的素材id', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '微信素材表' ROW_FORMAT = Dynamic; @@ -911,10 +1003,8 @@ CREATE TABLE `wechat_reply` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '公众号消息回调表' ROW_FORMAT = Dynamic; -INSERT INTO `site` VALUES (1, 'niucloud-admin', '0', '', 'admin', '', '', '1', '', '', '0', '0', '0', '', '', '', '', '0', '0', '', '', '', '0', '', '', '', ''); - -UPDATE `site` SET site_id = 0 WHERE site_id = 1; - +INSERT INTO `site`(site_id, site_name, group_id, keywords, app_type, logo, `desc`, status, latitude, longitude, province_id, city_id, district_id, address, full_address, phone, business_hours, create_time, expire_time, front_end_name, front_end_logo, front_end_icon, icon, member_no, app, addons, initalled_addon, site_domain) VALUES +(0, 'niucloud-admin', 0, '', 'admin', '', '', 1, '', '', 0, 0, 0, '', '', '', '', 0, 0, '', '', '', '', '0', '', '', '', ''); INSERT INTO `sys_user` VALUES ('1', '', '', '', '', '', '0', '0', '0', '1', '0', '0', '0'); diff --git a/niucloud/app/job/member/MemberGiftGrantJob.php b/niucloud/app/job/member/MemberGiftGrantJob.php new file mode 100644 index 000000000..7aad6ebbc --- /dev/null +++ b/niucloud/app/job/member/MemberGiftGrantJob.php @@ -0,0 +1,32 @@ +memberGiftGrant($site_id, $member_id, $gift, $param); + return true; + } + + public function failed($data) + { + + } +} diff --git a/niucloud/app/job/notice/Notice.php b/niucloud/app/job/notice/Notice.php index 87a30c03a..5d7492a38 100644 --- a/niucloud/app/job/notice/Notice.php +++ b/niucloud/app/job/notice/Notice.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/job/pay/PayReturnTo.php b/niucloud/app/job/pay/PayReturnTo.php index bcc523faf..45a6a3c6f 100644 --- a/niucloud/app/job/pay/PayReturnTo.php +++ b/niucloud/app/job/pay/PayReturnTo.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/job/schedule/OrderClose.php b/niucloud/app/job/schedule/OrderClose.php index 281d02747..116a08620 100644 --- a/niucloud/app/job/schedule/OrderClose.php +++ b/niucloud/app/job/schedule/OrderClose.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/job/schedule/SiteExpireClose.php b/niucloud/app/job/schedule/SiteExpireClose.php index f3fdf0653..99a419070 100644 --- a/niucloud/app/job/schedule/SiteExpireClose.php +++ b/niucloud/app/job/schedule/SiteExpireClose.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/job/schedule/SiteStatJob.php b/niucloud/app/job/schedule/SiteStatJob.php new file mode 100644 index 000000000..5ccaf0f93 --- /dev/null +++ b/niucloud/app/job/schedule/SiteStatJob.php @@ -0,0 +1,28 @@ +getExportDataColumn($type); + //获取导出数据源 + $data = (new CoreExportService())->getExportData($site_id, $type, $where, $page); + (new CoreExportService())->export($site_id, $type, $data_column, $data); + return true; + } +} diff --git a/niucloud/app/lang/en.php b/niucloud/app/lang/en.php index c95e49f77..7ffc30fd9 100644 --- a/niucloud/app/lang/en.php +++ b/niucloud/app/lang/en.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/lang/en/api.php b/niucloud/app/lang/en/api.php index 14b2ace70..dfed4358e 100644 --- a/niucloud/app/lang/en/api.php +++ b/niucloud/app/lang/en/api.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/lang/en/dict.php b/niucloud/app/lang/en/dict.php index c9fbbf5ad..bb2f0c7bb 100644 --- a/niucloud/app/lang/en/dict.php +++ b/niucloud/app/lang/en/dict.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/lang/en/validate.php b/niucloud/app/lang/en/validate.php index 8112e5b27..1a6f5bcaf 100644 --- a/niucloud/app/lang/en/validate.php +++ b/niucloud/app/lang/en/validate.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/lang/zh-cn.php b/niucloud/app/lang/zh-cn.php index 6097fedec..efcb4d55d 100644 --- a/niucloud/app/lang/zh-cn.php +++ b/niucloud/app/lang/zh-cn.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/lang/zh-cn/api.php b/niucloud/app/lang/zh-cn/api.php index dd66ea099..2d6be5065 100644 --- a/niucloud/app/lang/zh-cn/api.php +++ b/niucloud/app/lang/zh-cn/api.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -155,6 +155,8 @@ return [ 'MOBILE_NOT_CHANGE' => '绑定的手机号与原手机号一致', 'QRCODE_EXPIRE' => '登录二维码失效', 'PASSWORD_REQUIRE' => '密码不能为空', + 'LEVEL_NOT_ALLOWED_DELETE' => '该等级下存在会员不允许删除', + 'MEMBER_LEVEL_MAX' => '最多只能有十个等级', //会员提现 'CASHOUT_NOT_OPEN' => '会员提现业务未开启', @@ -257,5 +259,26 @@ return [ 'UPLOAD_KEY_NOT_EXIST' => '未找到微信小程序代码上传秘钥', 'NEED_TO_AUTHORIZE_FIRST' => '使用云服务需先进行授权', 'WEAPP_UPLOADING' => '小程序有正在上传的版本,请等待上一版本上传完毕后再进行操作', - 'CLOUD_BUILD_TASK_EXIST' => '已有正在执行中的编译任务' + 'CLOUD_BUILD_TASK_EXIST' => '已有正在执行中的编译任务', + + //核销相关 + 'VERIFY_TYPE_ERROR' => '核销类型错误', + 'VERIFY_CODE_EXPIRED' => '核销码已过期', + 'VERIFIER_NOT_EXIST' => '核销员不存在', + + //签到相关 + 'SIGN_NOT_USE' => '签到未开启', + 'SIGN_NOT_SET' => '签到参数未配置', + 'SIGNED_TODAY' => '今日已签到', + 'CONTINUE_SIGN' => '连签', + 'DAYS' => '天!', + 'SIGN_SUCCESS' => '签到成功', + 'GET_AWARD' => '恭喜您获得以下奖励', + + //导出相关 + 'EXPORT_SUCCESS' => '导出成功', + 'EXPORT_FAIL' => '导出失败', + 'EXPORT_NO_DATA' => '暂无可导出数据', + 'DIRECTORY' => '目录', + 'WAS_NOT_CREATED' => '创建失败', ]; diff --git a/niucloud/app/lang/zh-cn/dict.php b/niucloud/app/lang/zh-cn/dict.php index df20c3d4a..319a75f63 100644 --- a/niucloud/app/lang/zh-cn/dict.php +++ b/niucloud/app/lang/zh-cn/dict.php @@ -105,12 +105,18 @@ return [ 'account_point_recharge_give' => '充值赠送', 'account_money' => '可提现余额', 'account_commission' => '佣金', + 'account_growth' => '成长值', 'login_username' => '用户名密码登录', 'login_mobile' => '手机验证码登录', 'login_wechat' => '微信公众号授权登录', 'login_weapp' => '微信小程序授权登录', 'account_point_adjust' => '账户调整', + 'account_point_member_register' => '会员注册', + 'account_point_level_upgrade' => '升级礼包', + 'account_point_day_sign_award' => '日签奖励', + 'account_point_continue_sign_award' => '连签奖励', 'account_balance_adjust' => '账户调整', + 'account_balance_member_register' => '会员注册', 'account_money_award' => '活动奖励', 'account_money_cash_out' => '账户提现', 'account_money_adjust' => '账户调整', @@ -121,6 +127,9 @@ return [ 'account_balance_order' => '订单消费', 'account_balance_order_refund' => '订单退款', + 'account_balance_level_upgrade' => '升级礼包', + 'account_balance_day_sign_award' => '日签奖励', + 'account_balance_continue_sign_award' => '连签奖励', ], 'dict_order' => [ @@ -220,10 +229,17 @@ return [ 'member_my_commission' => '我的佣金', 'member_my_personal' => '个人资料', 'member_my_address' => '收货地址', + 'member_my_level' => '会员等级', + 'member_my_sign_in' => '我的签到', + 'member_verify_index' => '核销台', 'diy_page' => '自定义页面', 'diy_link' => '自定义链接' ], + // 自定义海报 + 'dict_diy_poster'=>[ + 'component_type_basic' => '基础组件', + ], //短信相关 'dict_sms' => [ 'status_sending' => '发送中', @@ -342,5 +358,21 @@ return [ 'type_voice' => '语音', 'type_video' => '视频', 'type_news' => '图文', - ] + ], + //导出状态 + 'dict_export' => [ + 'status_exporting' => '导出中', + 'status_success' => '导出成功', + 'status_fail' => '导出失败', + ], + //签到类型 + 'dict_member_sign_award' => [ + 'type_day' => '日签', + 'type_continue' => '连签' + ], + //签到状态 + 'dict_member_sign' => [ + 'status_not_sign' => '未签到', + 'status_signed' => '已签到' + ], ]; diff --git a/niucloud/app/lang/zh-cn/validate.php b/niucloud/app/lang/zh-cn/validate.php index 8c38aced9..cc3325ae5 100644 --- a/niucloud/app/lang/zh-cn/validate.php +++ b/niucloud/app/lang/zh-cn/validate.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -87,7 +87,10 @@ return [ 'cash_out_is_auto_transfer_in' => '是否启用转账必须是0或1', 'status_require' => '会员状态必须填写', 'not_exit_status' => '不存在的会员状态', - 'username_cannot_pure_number' => '账号不能是纯数字' + 'username_cannot_pure_number' => '账号不能是纯数字', + 'level_name_require' => '等级名称必须填写', + 'level_growth_require' => '等级成长值必须填写', + 'level_growth_integer' => '成长值只能为整数' ], 'validate_member_config' => [ 'length_number' => '会员编码必须是整数', @@ -187,5 +190,6 @@ return [ 'type_require' => '请选择插件类型', 'not_exit_type' => '无效的插件类型', 'key_regex' => '插件标识格式有误', + 'in_black_list' => '插件标识不能定义成黑名单中的值' ] ]; diff --git a/niucloud/app/listener/applet/WeappListener.php b/niucloud/app/listener/applet/WeappListener.php index 49251115f..6db7142aa 100644 --- a/niucloud/app/listener/applet/WeappListener.php +++ b/niucloud/app/listener/applet/WeappListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/member/MemberAccountListener.php b/niucloud/app/listener/member/MemberAccountListener.php index 179980d3c..45d8c6520 100644 --- a/niucloud/app/listener/member/MemberAccountListener.php +++ b/niucloud/app/listener/member/MemberAccountListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -12,6 +12,9 @@ namespace app\listener\member; +use app\dict\member\MemberAccountTypeDict; +use app\service\core\member\CoreMemberLevelService; + /** * 会员账户变化事件(积分,余额,零钱) * Class MemberAccount @@ -25,6 +28,10 @@ class MemberAccountListener */ public function handle(array $account_log) { + // 如果是会员成长值变更 + if ($account_log['account_type'] == MemberAccountTypeDict::GROWTH) { + (new CoreMemberLevelService())->checkLevelUpgrade($account_log['site_id'], $account_log['member_id']); + } return; } -} \ No newline at end of file +} diff --git a/niucloud/app/listener/member/MemberExportDataListener.php b/niucloud/app/listener/member/MemberExportDataListener.php new file mode 100644 index 000000000..336445bbc --- /dev/null +++ b/niucloud/app/listener/member/MemberExportDataListener.php @@ -0,0 +1,40 @@ +where([['site_id', '=', $param['site_id']]])->withSearch(['keyword','register_type', 'create_time', 'is_del', 'member_label', 'register_channel'], $param['where'])->field($field)->append(['register_channel_name', 'status_name']); + if ($param['page']['page'] > 0 && $param['page']['limit'] > 0) { + $data = $search_model->page($param['page']['page'], $param['page']['limit'])->select()->toArray(); + } else { + $data = $search_model->select()->toArray(); + } + } + return $data; + } +} \ No newline at end of file diff --git a/niucloud/app/listener/member/MemberExportTypeListener.php b/niucloud/app/listener/member/MemberExportTypeListener.php new file mode 100644 index 000000000..9bf5e341c --- /dev/null +++ b/niucloud/app/listener/member/MemberExportTypeListener.php @@ -0,0 +1,46 @@ + [ + 'name' => '会员列表', + 'column' => [ + 'member_id' => [ 'name' => '会员id'], + 'member_no' => [ 'name' => '会员编码'], + 'username' => [ 'name' => '用户名'], + 'mobile' => [ 'name' => '手机号'], + 'nickname' => [ 'name' => '昵称'], + 'point' => [ 'name' => '积分'], + 'balance' => [ 'name' => '余额'], + 'money' => [ 'name' => '余额(可提现)'], + 'growth' => [ 'name' => '成长值'], + 'commission' => [ 'name' => '当前佣金'], + 'register_channel_name' => [ 'name' => '注册来源'], + 'status_name' => [ 'name' => '用户状态'], + 'create_time' => [ 'name' => '注册时间'], + 'last_visit_time' => [ 'name' => '最后访问时间'], + ], + ] + ]; + } +} \ No newline at end of file diff --git a/niucloud/app/listener/member/MemberLoginListener.php b/niucloud/app/listener/member/MemberLoginListener.php index 1e773270e..5a23d4424 100644 --- a/niucloud/app/listener/member/MemberLoginListener.php +++ b/niucloud/app/listener/member/MemberLoginListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/member/MemberRegisterListener.php b/niucloud/app/listener/member/MemberRegisterListener.php index a4087d8c5..8f52c90f7 100644 --- a/niucloud/app/listener/member/MemberRegisterListener.php +++ b/niucloud/app/listener/member/MemberRegisterListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -11,6 +11,8 @@ namespace app\listener\member; +use app\service\core\member\CoreMemberService; + /** * 会员注册成功事件 * Class MemberRegister @@ -24,6 +26,10 @@ class MemberRegisterListener */ public function handle($member) { + // 注册发放成长值 + CoreMemberService::sendGrowth($member['site_id'], $member['member_id'], 'member_register', ['from_type' => 'member_register']); + // 注册发放积分 + CoreMemberService::sendPoint($member['site_id'], $member['member_id'], 'member_register', ['from_type' => 'member_register']); return; } -} \ No newline at end of file +} diff --git a/niucloud/app/listener/pay/PayCreateListener.php b/niucloud/app/listener/pay/PayCreateListener.php index 2b9a9d549..a81f7862f 100644 --- a/niucloud/app/listener/pay/PayCreateListener.php +++ b/niucloud/app/listener/pay/PayCreateListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/pay/PayNotifyListener.php b/niucloud/app/listener/pay/PayNotifyListener.php index aa82fbe2e..57801cb72 100644 --- a/niucloud/app/listener/pay/PayNotifyListener.php +++ b/niucloud/app/listener/pay/PayNotifyListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/pay/PaySuccessListener.php b/niucloud/app/listener/pay/PaySuccessListener.php index e20db0cb0..1d733b453 100644 --- a/niucloud/app/listener/pay/PaySuccessListener.php +++ b/niucloud/app/listener/pay/PaySuccessListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/pay/RefundSuccessListener.php b/niucloud/app/listener/pay/RefundSuccessListener.php index 0a64867bd..57d05978c 100644 --- a/niucloud/app/listener/pay/RefundSuccessListener.php +++ b/niucloud/app/listener/pay/RefundSuccessListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/pay/TransferSuccessListener.php b/niucloud/app/listener/pay/TransferSuccessListener.php index 077253a2c..8c8111b23 100644 --- a/niucloud/app/listener/pay/TransferSuccessListener.php +++ b/niucloud/app/listener/pay/TransferSuccessListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/qrcode/WeappQrcodeListener.php b/niucloud/app/listener/qrcode/WeappQrcodeListener.php index 7e8139d0c..f80048e73 100644 --- a/niucloud/app/listener/qrcode/WeappQrcodeListener.php +++ b/niucloud/app/listener/qrcode/WeappQrcodeListener.php @@ -13,8 +13,8 @@ class WeappQrcodeListener extends BaseNoticeTemplate public function handle(array $params) { - if ('weapp' == $params['channel']) { - return (new CoreWeappService())->qrcode($params['site_id'], $params['page'], $params['data'], $params['filepath']); + if ('weapp' == $params[ 'channel' ]) { + return ( new CoreWeappService() )->qrcode($params[ 'site_id' ], $params[ 'page' ], $params[ 'data' ], $params[ 'filepath' ]); } } diff --git a/niucloud/app/listener/qrcode/WechatQrcodeListener.php b/niucloud/app/listener/qrcode/WechatQrcodeListener.php index d6fd4cc10..0fc095a64 100644 --- a/niucloud/app/listener/qrcode/WechatQrcodeListener.php +++ b/niucloud/app/listener/qrcode/WechatQrcodeListener.php @@ -3,10 +3,9 @@ namespace app\listener\qrcode; use app\listener\notice_template\BaseNoticeTemplate; -use app\service\core\weapp\CoreWeappService; /** - * 生成小程序二维码 + * 生成微信公众号二维码 */ class WechatQrcodeListener extends BaseNoticeTemplate { @@ -18,8 +17,14 @@ class WechatQrcodeListener extends BaseNoticeTemplate $url = $params['url']; $data = $params['data']; $path = $params['filepath']; + $outfile = $params['outfile'] ?? true; + if($outfile === false){ + $path = false; + } //生成二维码 - $url = $url.'/'.$page; + if(!empty($page)){ + $url = $url.'/'.$page; + } if(!empty($data)){ $scene = []; foreach($data as $v){ @@ -27,7 +32,14 @@ class WechatQrcodeListener extends BaseNoticeTemplate } $url .= '?'.implode('&', $scene); } + ob_start();//开启缓冲区 \core\util\QRcode::png($url, $path, QR_ECLEVEL_L, 4, 1); + if($outfile === false){ + $img = ob_get_contents();//获取缓冲区内容 + $path = 'data:image/png;base64,' . base64_encode($img);//转base64 + } + ob_end_clean();//清除缓冲区内容 + ob_flush(); return $path; } } diff --git a/niucloud/app/listener/scan/ScanListener.php b/niucloud/app/listener/scan/ScanListener.php index f746ee783..d601056d0 100644 --- a/niucloud/app/listener/scan/ScanListener.php +++ b/niucloud/app/listener/scan/ScanListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/site/AddSiteAfterListener.php b/niucloud/app/listener/site/AddSiteAfterListener.php index c8901a0a9..6e0ca79fc 100644 --- a/niucloud/app/listener/site/AddSiteAfterListener.php +++ b/niucloud/app/listener/site/AddSiteAfterListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -104,6 +104,7 @@ class AddSiteAfterListener if (!empty($addon_index_template)) { $diy_service->add([ + 'page_title' => $addon_index_template[ 'title' ], "title" => $addon_index_template[ 'title' ], "name" => $addon_flag, "type" => $addon_flag, @@ -129,7 +130,7 @@ class AddSiteAfterListener if ($params[ 'is_start' ] == 1) { // 查询链接,设置启动页 - $other_page = (new DiyRouteService())->getList([ 'url' => $addon_template_info[ 'page' ], 'addon' => $addon ]); + $other_page = ( new DiyRouteService() )->getList([ 'url' => $addon_template_info[ 'page' ], 'addon' => $addon ]); if (!empty($other_page)) { $diy_service->changeTemplate([ diff --git a/niucloud/app/listener/system/AdminIndexListener.php b/niucloud/app/listener/system/AdminIndexListener.php index bd84e1b6e..36913a012 100644 --- a/niucloud/app/listener/system/AdminIndexListener.php +++ b/niucloud/app/listener/system/AdminIndexListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/system/AppInitListener.php b/niucloud/app/listener/system/AppInitListener.php index a35482d17..ae9a1acfe 100644 --- a/niucloud/app/listener/system/AppInitListener.php +++ b/niucloud/app/listener/system/AppInitListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/system/AppManageListener.php b/niucloud/app/listener/system/AppManageListener.php index ea8002b9f..9debd9dbc 100644 --- a/niucloud/app/listener/system/AppManageListener.php +++ b/niucloud/app/listener/system/AppManageListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/system/Poster.php b/niucloud/app/listener/system/Poster.php new file mode 100644 index 000000000..22201120a --- /dev/null +++ b/niucloud/app/listener/system/Poster.php @@ -0,0 +1,51 @@ +where([ + [ 'site_id', '=', $site_id ], + [ 'member_id', '=', $member_id ] + ])->field('nickname,headimg')->findOrEmpty()->toArray(); + + if (empty($member_info)) { + return []; + } + + $nickname = $member_info[ 'nickname' ]; + if (mb_strlen($nickname, 'UTF-8') > 10) { + $nickname = mb_strlen($nickname) > 10 ? mb_substr($nickname, 0, 7, 'UTF-8') . '...' : $nickname; + } + + $headimg = $member_info[ 'headimg' ]; + if (empty($headimg)) { + $headimg = 'static/resource/images/default_headimg.jpg'; + } + $return_data = [ + 'nickname' => $nickname, + 'headimg' => $headimg, + ]; + return $return_data; + } +} diff --git a/niucloud/app/listener/system/SiteIndexListener.php b/niucloud/app/listener/system/SiteIndexListener.php index 114276e04..5b56100c3 100644 --- a/niucloud/app/listener/system/SiteIndexListener.php +++ b/niucloud/app/listener/system/SiteIndexListener.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/listener/system/SiteLayout.php b/niucloud/app/listener/system/SiteLayout.php index 8761e3f2c..de58e4cb8 100644 --- a/niucloud/app/listener/system/SiteLayout.php +++ b/niucloud/app/listener/system/SiteLayout.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/addon/Addon.php b/niucloud/app/model/addon/Addon.php index 4280951b0..69ad3f550 100644 --- a/niucloud/app/model/addon/Addon.php +++ b/niucloud/app/model/addon/Addon.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/addon/AddonLog.php b/niucloud/app/model/addon/AddonLog.php index a7f4d6a7a..71873b478 100644 --- a/niucloud/app/model/addon/AddonLog.php +++ b/niucloud/app/model/addon/AddonLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/applet/AppletSiteVersion.php b/niucloud/app/model/applet/AppletSiteVersion.php index 6e4d34a86..fe0a5e8e5 100644 --- a/niucloud/app/model/applet/AppletSiteVersion.php +++ b/niucloud/app/model/applet/AppletSiteVersion.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/applet/AppletVersion.php b/niucloud/app/model/applet/AppletVersion.php index 408109e65..f722ea5de 100644 --- a/niucloud/app/model/applet/AppletVersion.php +++ b/niucloud/app/model/applet/AppletVersion.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/diy/Diy.php b/niucloud/app/model/diy/Diy.php index e1fe4623e..65ee05abe 100644 --- a/niucloud/app/model/diy/Diy.php +++ b/niucloud/app/model/diy/Diy.php @@ -167,7 +167,7 @@ class Diy extends BaseModel } /** - * 搜索器:自定义页面名称 + * 搜索器:页面标题(用于前台展示),页面名称(用于后台展示) * @param $query * @param $value * @param $data @@ -175,7 +175,7 @@ class Diy extends BaseModel public function searchTitleAttr($query, $value, $data) { if ($value) { - $query->where("title", 'like', '%' . $value . '%'); + $query->where("title|page_title", 'like', '%' . $value . '%'); } } diff --git a/niucloud/app/model/diy/DiyRoute.php b/niucloud/app/model/diy/DiyRoute.php index 7deb9f2ad..3f08276c8 100644 --- a/niucloud/app/model/diy/DiyRoute.php +++ b/niucloud/app/model/diy/DiyRoute.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/member/Member.php b/niucloud/app/model/member/Member.php index 862f1239e..66a627b8e 100644 --- a/niucloud/app/model/member/Member.php +++ b/niucloud/app/model/member/Member.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -207,6 +207,19 @@ class Member extends BaseModel } } + /** + * 会员等级筛选 + * @param Query $query + * @param $value + * @param $data + * @return void + */ + public function searchMemberLevelAttr(Query $query, $value, $data) + { + if ($value) { + $query->where('member_level', '=', $value); + } + } /** * 创建时间搜索器 @@ -246,5 +259,11 @@ class Member extends BaseModel } } + public function memberLevelData() { + return $this->hasOne(MemberLevel::class, 'level_id', 'member_level'); + } + public function memberLevelNameBind() { + return $this->hasOne(MemberLevel::class, 'level_id', 'member_level')->bind(['member_level_name' => 'level_name']); + } } diff --git a/niucloud/app/model/member/MemberAccountLog.php b/niucloud/app/model/member/MemberAccountLog.php index 14d9bd4ad..c96369036 100644 --- a/niucloud/app/model/member/MemberAccountLog.php +++ b/niucloud/app/model/member/MemberAccountLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -107,7 +107,7 @@ class MemberAccountLog extends BaseModel public function getFromTypeNameAttr($value, $data) { if (isset($data['from_type'], $data['account_type'])) - return MemberAccountChangeTypeDict::getType($data['account_type'])[$data['from_type']]['name']; + return MemberAccountChangeTypeDict::getType($data['account_type'])[$data['from_type']]['name'] ?? ''; else return ''; } diff --git a/niucloud/app/model/member/MemberAddress.php b/niucloud/app/model/member/MemberAddress.php index b02e7f5b8..16281e03d 100644 --- a/niucloud/app/model/member/MemberAddress.php +++ b/niucloud/app/model/member/MemberAddress.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/member/MemberCashOut.php b/niucloud/app/model/member/MemberCashOut.php index 1848ea436..54af2154a 100644 --- a/niucloud/app/model/member/MemberCashOut.php +++ b/niucloud/app/model/member/MemberCashOut.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/member/MemberCashOutAccount.php b/niucloud/app/model/member/MemberCashOutAccount.php index 1d070e717..642e3cece 100644 --- a/niucloud/app/model/member/MemberCashOutAccount.php +++ b/niucloud/app/model/member/MemberCashOutAccount.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/member/MemberLabel.php b/niucloud/app/model/member/MemberLabel.php index 28aae7cc0..7ff6afe59 100644 --- a/niucloud/app/model/member/MemberLabel.php +++ b/niucloud/app/model/member/MemberLabel.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/member/MemberLevel.php b/niucloud/app/model/member/MemberLevel.php index 847c8fa19..38d9bdaed 100644 --- a/niucloud/app/model/member/MemberLevel.php +++ b/niucloud/app/model/member/MemberLevel.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ namespace app\model\member; +use app\service\core\member\CoreMemberService; use core\base\BaseModel; /** @@ -20,7 +21,6 @@ use core\base\BaseModel; */ class MemberLevel extends BaseModel { - /** * 数据表主键 * @var string @@ -33,4 +33,36 @@ class MemberLevel extends BaseModel */ protected $name = 'member_level'; + protected $type = [ + 'level_benefits' => 'json', + 'level_gifts' => 'json' + ]; + + /** + * 获取对应等级的会员数量 + * @param $value + * @param $data + * @return int + * @throws DbException + */ + public function getMemberNumAttr($value, $data) + { + if (isset($data[ 'level_id' ])) { + return ( new Member() )->where([ [ 'member_level', "=", $data[ 'level_id' ] ] ])->count(); + } else + return 0; + } + + /** + * 会员等级名称 + * @param $query + * @param $value + * @param $data + */ + public function searchLevelNameAttr($query, $value, $data) + { + if ($value != '') { + $query->where('level_name', 'like', '%'.$value.'%'); + } + } } diff --git a/niucloud/app/model/member/MemberSign.php b/niucloud/app/model/member/MemberSign.php new file mode 100644 index 000000000..486ca5505 --- /dev/null +++ b/niucloud/app/model/member/MemberSign.php @@ -0,0 +1,85 @@ +hasOne(Member::class, 'member_id', 'member_id')->joinType('left'); + } + + /** + * 是否签到名称 + * @param $value + * @param $data + * @return mixed|string + */ + public function getIsSignNameAttr($value, $data) + { + if (empty($data['is_sign'])) + return ''; + return MemberSignDict::getStatus()[$data['is_sign']] ?? ''; + } + + /** + * 创建时间搜索器 + * @param Query $query + * @param $value + * @param $data + */ + 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('member_sign.create_time', $start_time, $end_time); + } else if ($start_time > 0 && $end_time == 0) { + $query->where([['member_sign.create_time', '>=', $start_time]]); + } else if ($start_time == 0 && $end_time > 0) { + $query->where([['member_sign.create_time', '<=', $end_time]]); + } + } +} diff --git a/niucloud/app/model/pay/Pay.php b/niucloud/app/model/pay/Pay.php index 6c51c4802..23c4e3d3d 100644 --- a/niucloud/app/model/pay/Pay.php +++ b/niucloud/app/model/pay/Pay.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/pay/PayChannel.php b/niucloud/app/model/pay/PayChannel.php index 583d968a5..26e1e6773 100644 --- a/niucloud/app/model/pay/PayChannel.php +++ b/niucloud/app/model/pay/PayChannel.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/pay/Refund.php b/niucloud/app/model/pay/Refund.php index 6ce432af5..2b4046e59 100644 --- a/niucloud/app/model/pay/Refund.php +++ b/niucloud/app/model/pay/Refund.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/pay/Transfer.php b/niucloud/app/model/pay/Transfer.php index 1e859b8e1..6426fef8c 100644 --- a/niucloud/app/model/pay/Transfer.php +++ b/niucloud/app/model/pay/Transfer.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/site/Site.php b/niucloud/app/model/site/Site.php index 01ec18360..d1f2527a2 100644 --- a/niucloud/app/model/site/Site.php +++ b/niucloud/app/model/site/Site.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/site/SiteAccountLog.php b/niucloud/app/model/site/SiteAccountLog.php index 56d42b5d1..b87b5f242 100644 --- a/niucloud/app/model/site/SiteAccountLog.php +++ b/niucloud/app/model/site/SiteAccountLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/site/SiteGroup.php b/niucloud/app/model/site/SiteGroup.php index 610b9e7cd..b0a056cfd 100644 --- a/niucloud/app/model/site/SiteGroup.php +++ b/niucloud/app/model/site/SiteGroup.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/stat/StatHour.php b/niucloud/app/model/stat/StatHour.php new file mode 100644 index 000000000..2a6467bc9 --- /dev/null +++ b/niucloud/app/model/stat/StatHour.php @@ -0,0 +1,37 @@ +where("name", 'like', '%' . $value . '%'); + } + } + + /** + * 搜索器:海报类型 + * @param $query + * @param $value + * @param $data + */ + public function searchTypeAttr($query, $value, $data) + { + if ($value) { + $query->where("type", '=', $value); + } + } } diff --git a/niucloud/app/model/sys/SysAgreement.php b/niucloud/app/model/sys/SysAgreement.php index f227a1009..edd64a346 100644 --- a/niucloud/app/model/sys/SysAgreement.php +++ b/niucloud/app/model/sys/SysAgreement.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysArea.php b/niucloud/app/model/sys/SysArea.php index aaca9c03b..86671b546 100644 --- a/niucloud/app/model/sys/SysArea.php +++ b/niucloud/app/model/sys/SysArea.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysAttachment.php b/niucloud/app/model/sys/SysAttachment.php index ca99ae06c..c9bfb2bf0 100644 --- a/niucloud/app/model/sys/SysAttachment.php +++ b/niucloud/app/model/sys/SysAttachment.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysAttachmentCategory.php b/niucloud/app/model/sys/SysAttachmentCategory.php index 948ef688e..398a65af9 100644 --- a/niucloud/app/model/sys/SysAttachmentCategory.php +++ b/niucloud/app/model/sys/SysAttachmentCategory.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysConfig.php b/niucloud/app/model/sys/SysConfig.php index e65891e5e..f8373e035 100644 --- a/niucloud/app/model/sys/SysConfig.php +++ b/niucloud/app/model/sys/SysConfig.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysExport.php b/niucloud/app/model/sys/SysExport.php new file mode 100644 index 000000000..2e541b0ef --- /dev/null +++ b/niucloud/app/model/sys/SysExport.php @@ -0,0 +1,109 @@ +whereLike('export_key', '%' . $value . '%'); + } + } + + /** + * 导出状态搜索器 + * @param Query $query + * @param $value + * @param $data + */ + public function searchExportStatusAttr(Query $query, $value, $data) + { + if ($value) { + $query->where('export_status', $value); + } + } + + /** + * 导出时间搜索器 + * @param $query + * @param $value + * @param $data + */ + public function searchCreateTimeAttr($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/SysMenu.php b/niucloud/app/model/sys/SysMenu.php index c735fe9c0..c9a59025c 100644 --- a/niucloud/app/model/sys/SysMenu.php +++ b/niucloud/app/model/sys/SysMenu.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysNotice.php b/niucloud/app/model/sys/SysNotice.php index 7cce34163..d9f3adb81 100644 --- a/niucloud/app/model/sys/SysNotice.php +++ b/niucloud/app/model/sys/SysNotice.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysNoticeLog.php b/niucloud/app/model/sys/SysNoticeLog.php index 054140c44..41a48e6da 100644 --- a/niucloud/app/model/sys/SysNoticeLog.php +++ b/niucloud/app/model/sys/SysNoticeLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysNoticeSmsLog.php b/niucloud/app/model/sys/SysNoticeSmsLog.php index 281643136..19205e4b4 100644 --- a/niucloud/app/model/sys/SysNoticeSmsLog.php +++ b/niucloud/app/model/sys/SysNoticeSmsLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysRole.php b/niucloud/app/model/sys/SysRole.php index aa2d1a73b..4c1fa4633 100644 --- a/niucloud/app/model/sys/SysRole.php +++ b/niucloud/app/model/sys/SysRole.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysSchedule.php b/niucloud/app/model/sys/SysSchedule.php index d74536113..82d56fa3c 100644 --- a/niucloud/app/model/sys/SysSchedule.php +++ b/niucloud/app/model/sys/SysSchedule.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysUser.php b/niucloud/app/model/sys/SysUser.php index cb9549f31..920aaed65 100644 --- a/niucloud/app/model/sys/SysUser.php +++ b/niucloud/app/model/sys/SysUser.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysUserLog.php b/niucloud/app/model/sys/SysUserLog.php index 3d446059b..9eb831866 100644 --- a/niucloud/app/model/sys/SysUserLog.php +++ b/niucloud/app/model/sys/SysUserLog.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/sys/SysUserRole.php b/niucloud/app/model/sys/SysUserRole.php index cbc80b904..205dbcf67 100644 --- a/niucloud/app/model/sys/SysUserRole.php +++ b/niucloud/app/model/sys/SysUserRole.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/verify/Verifier.php b/niucloud/app/model/verify/Verifier.php new file mode 100644 index 000000000..e2b739960 --- /dev/null +++ b/niucloud/app/model/verify/Verifier.php @@ -0,0 +1,53 @@ + 'timestamp' + ]; + + /** + * 数据表主键 + * @var string + */ + protected $pk = 'id'; + + /** + * 模型名称 + * @var string + */ + protected $name = 'verifier'; + + // 设置json类型字段 + protected $json = [ 'verify_type' ]; + + // 设置JSON数据返回数组 + protected $jsonAssoc = true; + + public function member() { + return $this->hasOne(Member::class, 'member_id', 'member_id'); + } + + +} diff --git a/niucloud/app/model/verify/Verify.php b/niucloud/app/model/verify/Verify.php new file mode 100644 index 000000000..d4d8725fd --- /dev/null +++ b/niucloud/app/model/verify/Verify.php @@ -0,0 +1,119 @@ +hasOne(Member::class, 'member_id', 'verifier_member_id'); + } + + /** + * 核销码搜索 + * @param $query + * @param $value + * @param $data + */ + public function searchCodeAttr(Query $query, $value, $data) + { + if ($value) { + $query->whereLike('code', '%'.$value.'%'); + } + } + + /** + * 业务id搜索 + * @param $query + * @param $value + * @param $data + * @return void + */ + public function searchRelateTagAttr($query, $value, $data) + { + if ($value) { + $query->where('relate_tag', '=', $value); + } + } + + /** + * 核销类型搜索 + * @param $query + * @param $value + * @param $data + */ + public function searchTypeAttr($query, $value, $data) + { + if ($value) { + $query->where('type', '=', $value); + } + } + + /** + * 创建时间搜索器 + * @param Query $query + * @param $value + * @param $data + */ + 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]]); + } + } + + /** + * 核销类型转换 + * @param $value + * @return void + */ + public function getTypeNameAttr($value, $data) { + if (empty($data['type'])) + return ''; + return VerifyDict::getType()[$data['type']]['name'] ?? ''; + } + +} diff --git a/niucloud/app/model/wechat/WechatFans.php b/niucloud/app/model/wechat/WechatFans.php index 02a501baa..fb38545d5 100644 --- a/niucloud/app/model/wechat/WechatFans.php +++ b/niucloud/app/model/wechat/WechatFans.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/wechat/WechatMedia.php b/niucloud/app/model/wechat/WechatMedia.php index 7a75a54fd..5e2d7244f 100644 --- a/niucloud/app/model/wechat/WechatMedia.php +++ b/niucloud/app/model/wechat/WechatMedia.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/model/wechat/WechatReply.php b/niucloud/app/model/wechat/WechatReply.php index 544dbe7d0..62213f1be 100644 --- a/niucloud/app/model/wechat/WechatReply.php +++ b/niucloud/app/model/wechat/WechatReply.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/addon/AddonService.php b/niucloud/app/service/admin/addon/AddonService.php index f35725661..c2a14f112 100644 --- a/niucloud/app/service/admin/addon/AddonService.php +++ b/niucloud/app/service/admin/addon/AddonService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/aliapp/AliappConfigService.php b/niucloud/app/service/admin/aliapp/AliappConfigService.php index 6ef814f39..c4dc02368 100644 --- a/niucloud/app/service/admin/aliapp/AliappConfigService.php +++ b/niucloud/app/service/admin/aliapp/AliappConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/applet/AppletDownloadService.php b/niucloud/app/service/admin/applet/AppletDownloadService.php index 0a2ec504e..2cdae7657 100644 --- a/niucloud/app/service/admin/applet/AppletDownloadService.php +++ b/niucloud/app/service/admin/applet/AppletDownloadService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/applet/AppletVersionService.php b/niucloud/app/service/admin/applet/AppletVersionService.php index e7f56a3ec..535f23f95 100644 --- a/niucloud/app/service/admin/applet/AppletVersionService.php +++ b/niucloud/app/service/admin/applet/AppletVersionService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/applet/AppletVersionSiteService.php b/niucloud/app/service/admin/applet/AppletVersionSiteService.php index 9ffbb1064..df482ad2d 100644 --- a/niucloud/app/service/admin/applet/AppletVersionSiteService.php +++ b/niucloud/app/service/admin/applet/AppletVersionSiteService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/auth/AuthService.php b/niucloud/app/service/admin/auth/AuthService.php index 7a79deed7..cea4269b0 100644 --- a/niucloud/app/service/admin/auth/AuthService.php +++ b/niucloud/app/service/admin/auth/AuthService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -140,7 +140,7 @@ class AuthService extends BaseAdminService $menu_service = new MenuService(); if($is_admin){//查询全部启用的权限 - return (new AuthSiteService())->getMenuList($is_tree, 1, $addon); + return ( new MenuService() )->getAllMenuList($this->app_type, 1, $is_tree, 1); }else{ $user_role_ids = $user_role_info['role_ids']; $role_service = new RoleService(); diff --git a/niucloud/app/service/admin/auth/AuthSiteService.php b/niucloud/app/service/admin/auth/AuthSiteService.php index 646bfdbad..a440f1ec4 100644 --- a/niucloud/app/service/admin/auth/AuthSiteService.php +++ b/niucloud/app/service/admin/auth/AuthSiteService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/auth/ConfigService.php b/niucloud/app/service/admin/auth/ConfigService.php index e91caec89..017686faa 100644 --- a/niucloud/app/service/admin/auth/ConfigService.php +++ b/niucloud/app/service/admin/auth/ConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/auth/LoginService.php b/niucloud/app/service/admin/auth/LoginService.php index 9cd917ec6..58477d653 100644 --- a/niucloud/app/service/admin/auth/LoginService.php +++ b/niucloud/app/service/admin/auth/LoginService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -89,6 +89,8 @@ class LoginService extends BaseAdminService //创建token $token_info = $this->createToken($userinfo, $app_type); + $this->request->uid($userinfo->uid); + //查询权限以及菜单 $data = [ 'token' => $token_info['token'], @@ -96,6 +98,7 @@ class LoginService extends BaseAdminService 'userinfo' => [ 'uid' => $userinfo->uid, 'username' => $userinfo->username, + 'is_super_admin' => AuthService::isSuperAdmin() ], 'site_id' => $default_site_id, 'site_info' => null, @@ -104,6 +107,9 @@ class LoginService extends BaseAdminService if ($app_type == AppTypeDict::ADMIN || ($app_type == AppTypeDict::SITE && $data['site_id']) ) { $data['site_info'] = (new SiteService())->getInfo($data['site_id']); } + if ($app_type == AppTypeDict::ADMIN && !$data['userinfo']['is_super_admin']) { + $data['userinfo']['site_ids'] = (new \app\service\admin\home\AuthSiteService())->getSiteIds(); + } // 获取站点布局 $layout_config = (new CoreConfigService())->getConfig($data['site_id'], 'SITE_LAYOUT'); diff --git a/niucloud/app/service/admin/captcha/CaptchaService.php b/niucloud/app/service/admin/captcha/CaptchaService.php index 700d53afe..7d1c4d70d 100644 --- a/niucloud/app/service/admin/captcha/CaptchaService.php +++ b/niucloud/app/service/admin/captcha/CaptchaService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/channel/H5Service.php b/niucloud/app/service/admin/channel/H5Service.php index 88138af77..80d9c8183 100644 --- a/niucloud/app/service/admin/channel/H5Service.php +++ b/niucloud/app/service/admin/channel/H5Service.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/channel/PcService.php b/niucloud/app/service/admin/channel/PcService.php index 102f4602b..f0bc185cd 100644 --- a/niucloud/app/service/admin/channel/PcService.php +++ b/niucloud/app/service/admin/channel/PcService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/diy/DiyConfigService.php b/niucloud/app/service/admin/diy/DiyConfigService.php index 6520be56a..916db8e49 100644 --- a/niucloud/app/service/admin/diy/DiyConfigService.php +++ b/niucloud/app/service/admin/diy/DiyConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/diy/DiyRouteService.php b/niucloud/app/service/admin/diy/DiyRouteService.php index c09d30d73..72c2f2c7e 100644 --- a/niucloud/app/service/admin/diy/DiyRouteService.php +++ b/niucloud/app/service/admin/diy/DiyRouteService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/diy/DiyService.php b/niucloud/app/service/admin/diy/DiyService.php index 0cdc73334..79dc38ab6 100644 --- a/niucloud/app/service/admin/diy/DiyService.php +++ b/niucloud/app/service/admin/diy/DiyService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -48,7 +48,7 @@ class DiyService extends BaseAdminService public function getPage(array $where = []) { $where[] = [ 'site_id', '=', $this->site_id ]; - $field = 'id,site_id,title,name,template,type,mode,is_default,share,visit_count,create_time,update_time,value'; + $field = 'id,site_id,title,page_title,name,template,type,mode,is_default,share,visit_count,create_time,update_time,value'; $order = "update_time desc"; $search_model = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ "title", "type", 'mode', 'addon_name' ], $where)->field($field)->order($order)->append([ 'type_name', 'type_page', 'addon_name' ]); return $this->pageQuery($search_model); @@ -63,19 +63,19 @@ class DiyService extends BaseAdminService public function getPageByCarouselSearch(array $where = []) { $where[] = [ 'site_id', '=', $this->site_id ]; - $field = 'id,site_id,title,name,template,type,mode,is_default,share,visit_count,create_time,update_time,value'; + $field = 'id,site_id,title,page_title,name,template,type,mode,is_default,share,visit_count,create_time,update_time,value'; $order = "update_time desc"; $search_model = $this->model->whereOr([ [ [ 'type', '=', 'DIY_PAGE' ], [ 'site_id', '=', $this->site_id ], - [ 'value', 'not in', ['top_fixed','right_fixed','bottom_fixed','left_fixed','fixed'] ] + [ 'value', 'not in', [ 'top_fixed', 'right_fixed', 'bottom_fixed', 'left_fixed', 'fixed' ] ] ], [ [ 'type', '<>', 'DIY_PAGE' ], [ 'site_id', '=', $this->site_id ], [ 'is_default', '=', 0 ], - [ 'value', 'not in', ['top_fixed','right_fixed','bottom_fixed','left_fixed','fixed'] ] + [ 'value', 'not in', [ 'top_fixed', 'right_fixed', 'bottom_fixed', 'left_fixed', 'fixed' ] ] ] ])->field($field)->order($order)->append([ 'type_name', 'type_page', 'addon_name' ]); return $this->pageQuery($search_model); @@ -90,7 +90,7 @@ class DiyService extends BaseAdminService * @throws DbException * @throws ModelNotFoundException */ - public function getList(array $where = [], $field = 'id,title,name,template,type,mode,is_default,share,visit_count,create_time,update_time') + public function getList(array $where = [], $field = 'id,title,page_title,name,template,type,mode,is_default,share,visit_count,create_time,update_time') { $order = "update_time desc"; return $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ "title", "type", 'mode' ], $where)->field($field)->order($order)->select()->toArray(); @@ -103,13 +103,13 @@ class DiyService extends BaseAdminService */ public function getInfo(int $id) { - $field = 'id,site_id,title,name,template,type,mode,value,is_default,is_change,share,visit_count'; + $field = 'id,site_id,title,page_title,name,template,type,mode,value,is_default,is_change,share,visit_count'; return $this->model->field($field)->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->findOrEmpty()->toArray(); } public function getInfoByName(string $name) { - $field = 'id,site_id,title,name,template,type,mode,value,is_default,is_change,share,visit_count'; + $field = 'id,site_id,title,page_title,name,template,type,mode,value,is_default,is_change,share,visit_count'; return $this->model->field($field)->where([ [ 'name', '=', $name ], [ 'site_id', '=', $this->site_id ], [ 'is_default', '=', 1 ] ])->findOrEmpty()->toArray(); } @@ -131,7 +131,9 @@ class DiyService extends BaseAdminService */ public function add(array $data) { - $data[ 'site_id' ] = $this->site_id; + if (empty($data[ 'site_id' ])) { + $data[ 'site_id' ] = $this->site_id; + } $data[ 'create_time' ] = time(); $data[ 'update_time' ] = time(); @@ -149,7 +151,7 @@ class DiyService extends BaseAdminService } /** - * 自定义页面编辑 + * 编辑自定义页面 * @param int $id * @param array $data * @return bool @@ -240,19 +242,21 @@ class DiyService extends BaseAdminService } if (!empty($data)) { - // 编辑赋值 + // 编辑赋值 if (isset($template[ $data[ 'type' ] ])) { $page = $template[ $data[ 'type' ] ]; $data[ 'type_name' ] = $page[ 'title' ]; $data[ 'page' ] = $page[ 'page' ]; } + } else { // 新页面赋值 - $title = $params[ 'title' ] ? : '页面' . $time; + $page_title = $params[ 'title' ] ? : '页面' . $time; // 页面标题(用于前台展示) $type = $params[ 'type' ] ? : 'DIY_PAGE'; $name = $type == 'DIY_PAGE' ? 'DIY_PAGE_RANDOM_' . $time : $type; + $title = $page_title; $type_name = ''; $template_name = ''; // 页面模板名称 $page_route = ''; // 页面路径 @@ -265,7 +269,7 @@ class DiyService extends BaseAdminService $page = $template[ $params[ 'name' ] ]; $name = $params[ 'name' ]; $type = $params[ 'name' ]; - $title = $page[ 'title' ]; + $page_title = $page[ 'title' ]; $type_name = $page[ 'title' ]; $page_route = $page[ 'page' ]; @@ -290,9 +294,15 @@ class DiyService extends BaseAdminService } + // 页面标题(用于前台展示) + if ($type != 'DIY_PAGE') { + $title = $type_name; + } + $data = [ 'name' => $name, - 'title' => $title, + 'page_title' => $page_title, // 页面名称(用于后台展示) + 'title' => $title, // 页面标题(用于前台展示) 'type' => $type, 'type_name' => $type_name, 'template' => $template_name, @@ -360,7 +370,7 @@ class DiyService extends BaseAdminService // 查询自定义页面 if ($k == 'DIY_PAGE') { $order = "update_time desc"; - $field = 'id,title,name,template,type,mode,is_default,share,visit_count,create_time,update_time'; + $field = 'id,title,page_title,name,template,type,mode,is_default,share,visit_count,create_time,update_time'; $list = $this->model ->whereOr([ [ @@ -376,7 +386,7 @@ class DiyService extends BaseAdminService foreach ($list as $ck => $cv) { $link[ $k ][ 'child_list' ][] = [ 'name' => $cv[ 'name' ], - 'title' => $cv[ 'title' ], + 'title' => $cv[ 'page_title' ], 'url' => '/app/pages/index/diy?id=' . $cv[ 'id' ] ]; } diff --git a/niucloud/app/service/admin/generator/core/AdminApiRouteGenerator.php b/niucloud/app/service/admin/generator/core/AdminApiRouteGenerator.php index 308c0de46..b8159133a 100644 --- a/niucloud/app/service/admin/generator/core/AdminApiRouteGenerator.php +++ b/niucloud/app/service/admin/generator/core/AdminApiRouteGenerator.php @@ -318,8 +318,8 @@ use app\adminapi\middleware\AdminLog;"; foreach ($this->tableColumn as $column) { if (!empty($column['model'])) { $str = strripos($column['model'],'\\'); - $with = Str::camel(substr($column['model'],$str+1)); - $content.= PHP_EOL.' Route::get('."'".$with."'".','."'".$route_path.'get'.Str::studly($with).'All'."'".');'.PHP_EOL; + $with = Str::snake(substr($column['model'],$str+1)) . '_all'; + $content.= PHP_EOL.' Route::get('."'".$with."'".','."'".$route_path.'get'.Str::studly($with)."'".');'.PHP_EOL; } } return $content; diff --git a/niucloud/app/service/admin/generator/core/MenuSqlGenerator.php b/niucloud/app/service/admin/generator/core/MenuSqlGenerator.php index 037010bff..4e5503858 100644 --- a/niucloud/app/service/admin/generator/core/MenuSqlGenerator.php +++ b/niucloud/app/service/admin/generator/core/MenuSqlGenerator.php @@ -445,7 +445,7 @@ class MenuSqlGenerator extends BaseGenerator ]; $menu_model = new SysMenu(); - (new SysMenu())->where([['app_type', '=', 'site'],['menu_key','in', array_column($data, 'menu_key') ]])->select()->delete(); + Db::name("sys_menu")->where([['app_type', '=', 'site'],['menu_key','in', array_column($data, 'menu_key') ]])->delete(); (new $menu_model())->saveAll($data); $cache_tag_name = 'menu_cache'; diff --git a/niucloud/app/service/admin/generator/core/ModelGenerator.php b/niucloud/app/service/admin/generator/core/ModelGenerator.php index 30d86231d..9a008b430 100644 --- a/niucloud/app/service/admin/generator/core/ModelGenerator.php +++ b/niucloud/app/service/admin/generator/core/ModelGenerator.php @@ -308,16 +308,17 @@ class ModelGenerator extends BaseGenerator */ public function getSoftDeleteFunction() { - $data = []; + $data = [ + 'softDelete' => '', + 'deleteColumn' => '', + 'deleteColumnValue' => '', + ]; foreach ($this->tableColumn as $column) { - if ($column['is_delete'] == 0) { - $data['softDelete'] = ''; - $data['deleteColumn'] = ''; - $data['deleteColumnValue'] = ''; - }else{ + if ($column['is_delete']) { $data['softDelete'] = ' use SoftDelete;'; $data['deleteColumn'] = '/**'.PHP_EOL.' * 定义软删除标记字段.'.PHP_EOL.' * @var string'.PHP_EOL.' */'.PHP_EOL.' protected $deleteTime = '."'".$column['column_name']."';"; $data['deleteColumnValue'] = '/**'.PHP_EOL.' * 定义软删除字段的默认值.'.PHP_EOL.' * @var int'.PHP_EOL.' */'.PHP_EOL.' protected $defaultSoftDelete = 0;'; + break; } } return $data; diff --git a/niucloud/app/service/admin/generator/core/ServiceGenerator.php b/niucloud/app/service/admin/generator/core/ServiceGenerator.php index f8541b1e4..f467e6eb4 100644 --- a/niucloud/app/service/admin/generator/core/ServiceGenerator.php +++ b/niucloud/app/service/admin/generator/core/ServiceGenerator.php @@ -315,7 +315,7 @@ class ServiceGenerator extends BaseGenerator foreach ($this->tableColumn as $column) { if (!empty($column['model'])) { $str = strripos($column['model'],'\\'); - $with[] = Str::camel(substr($column['model'],$str+1)); + $with[] = "'" . Str::camel(substr($column['model'],$str+1)) . "'"; } if (!$column['is_search'] || $column['column_name'] == 'site_id') { continue; @@ -324,13 +324,14 @@ class ServiceGenerator extends BaseGenerator } $search_field = implode(',', $search_field); + if(empty($with)) { - $content.= '$this->model->where([ [' ." 'site_id' ". ',"=", $this->site_id ] ])->withSearch(["'.$search_field.'"], $where)->field('.'$field'.')->order('.'$order'.');'; + $content.= '$this->model->where([ [' ." 'site_id' ". ',"=", $this->site_id ] ])->withSearch(['.$search_field.'], $where)->field('.'$field'.')->order('.'$order'.');'; }else{ $with = implode(',', $with); - $content.= '$this->model->where([ [' ." 'site_id' ". ',"=", $this->site_id ] ])->withSearch(["'.$search_field.'"], $where)->with('."'$with'".')->field('.'$field'.')->order('.'$order'.');'; + $content.= '$this->model->where([ [' ." 'site_id' ". ',"=", $this->site_id ] ])->withSearch(['.$search_field.'], $where)->with(['.$with.'])->field('.'$field'.')->order('.'$order'.');'; } return $content; @@ -351,7 +352,7 @@ class ServiceGenerator extends BaseGenerator foreach ($this->tableColumn as $column) { if (!empty($column['model'])) { $str = strripos($column['model'],'\\'); - $with[] = Str::camel(substr($column['model'],$str+1)); + $with[] = "'" . Str::camel(substr($column['model'],$str+1)) . "'"; } if ($column['is_pk']) { $pk = $column['column_name'];} @@ -369,7 +370,7 @@ class ServiceGenerator extends BaseGenerator $content.= '$this->model->field($field)->where([['."'$pk'".', "=", $id]])->findOrEmpty()->toArray();'; }else{ $with = implode(',', $with); - $content.= '$this->model->field($field)->where([['."'$pk'".', "=", $id]])->with('."'$with'".')->findOrEmpty()->toArray();'; + $content.= '$this->model->field($field)->where([['."'$pk'".', "=", $id]])->with(['.$with.'])->findOrEmpty()->toArray();'; } if(!empty($col)) { diff --git a/niucloud/app/service/admin/generator/core/WebApiGenerator.php b/niucloud/app/service/admin/generator/core/WebApiGenerator.php index bb6948518..cc6ee9cc7 100644 --- a/niucloud/app/service/admin/generator/core/WebApiGenerator.php +++ b/niucloud/app/service/admin/generator/core/WebApiGenerator.php @@ -114,14 +114,12 @@ class WebApiGenerator extends BaseGenerator $content = file_get_contents($file); $code_begin = 'USER_CODE_BEGIN -- '.$this->getTableName() . PHP_EOL; - $code_end = 'USER_CODE_END -- '.$this->getTableName(). PHP_EOL; - + $code_end = 'USER_CODE_END -- '.$this->getTableName() . PHP_EOL; if(strpos($content,$code_begin) !== false && strpos($content,$code_end) !== false) { // 清除相应对应代码块 $pattern = "/\/\/\s+{$code_begin}[\S\s]+{$code_end}?/"; $import = preg_replace($pattern, '', $content); - }else{ $import = $content; } @@ -255,20 +253,14 @@ class WebApiGenerator extends BaseGenerator foreach ($this->tableColumn as $column) { if (!empty($column['model'])) { $str = strripos($column['model'],'\\'); - $with[] = Str::camel(substr($column['model'],$str+1)); + $with[] = Str::snake(substr($column['model'],$str+1)); } } if(!empty($with)) { -// $str = strripos($column['model'],'\\'); -// $with = Str::camel(substr($column['model'],$str+1)); -// $content.= ' get'.Str::studly($with).'List,'; -// export function getCompanyList(params: Record) { -// return request.get(`shop/delivery/company`, {params}) -// } $with = Str::camel(substr($column['model'],$str+1)); foreach ($with as $value) { - $content.= 'export function getWith'.Str::studly($value).'List(params: Record){'.PHP_EOL." return request.get('".$moduleName.'/'.$value."', {params})".PHP_EOL.'}'; + $content.= 'export function getWith'.Str::studly($value).'List(params: Record){'.PHP_EOL." return request.get('".$moduleName.'/'.$value."_all', {params})".PHP_EOL.'}'; } } return $content; diff --git a/niucloud/app/service/admin/generator/core/WebEditGenerator.php b/niucloud/app/service/admin/generator/core/WebEditGenerator.php index cd62c9e06..a92fa6399 100644 --- a/niucloud/app/service/admin/generator/core/WebEditGenerator.php +++ b/niucloud/app/service/admin/generator/core/WebEditGenerator.php @@ -98,7 +98,6 @@ class WebEditGenerator extends BaseGenerator } - /** * 获取表单内容 * @return string @@ -107,74 +106,54 @@ class WebEditGenerator extends BaseGenerator { $content = ''; foreach ($this->tableColumn as $column) { - if (!$column['is_insert'] || !$column['is_update'] || $column['is_pk'] || $column['column_name'] == 'site_id') { + if (!$column['is_insert'] || !$column['is_update'] || $column['is_pk']) { continue; } + $old = [ '{COLUMN_COMMENT}', '{COLUMN_NAME}', '{LCASE_COLUMN_NAME}', '{PROP}', '{DICT_TYPE}', - '{ITEM_LABEL}', - '{ITEM_VALUE}' - ]; - if(empty($column['dict_type'])) + $new = [ + $column['column_comment'], + $column['column_name'], + Str::camel($column['column_name']), + $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', + '' + ]; + $vmName = $column['view_type']; + + if($column['view_type'] == 'select' || $column['view_type'] == 'radio' || $column['view_type'] == 'checkbox') { - if($column['view_type'] == 'select' || $column['view_type'] == 'radio' || $column['view_type'] == 'checkbox') { - if (empty($column['model'])) - { - $new = [ - $column['column_comment'], - $column['column_name'], - Str::camel($column['column_name']), - $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', - '' - ]; - - $vmName = $column['view_type'].'3'; - - }else{ - $new = [ - $column['column_comment'], - $column['column_name'], - Str::camel($column['column_name']), - $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', - Str::camel($column['column_name']).'List', - $column['label_key'], - $column['value_key'] - ]; - $vmName = $column['view_type']; - } - - }else{ + // 当字段选择了字典 + if (!empty($column['dict_type'])) { $new = [ $column['column_comment'], $column['column_name'], Str::camel($column['column_name']), $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', - + $column['column_name'].'List', ]; - $vmName = $column['view_type']; + $vmName = $column['view_type'] . '2'; } - - }else{ - $new = [ - $column['column_comment'], - $column['column_name'], - Str::camel($column['column_name']), - $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', - $column['column_name'].'List', - ]; - if(empty($column['model'])) - { - $vmName = $column['view_type'].'3'; - }else{ - $vmName = $column['view_type']; + // 当字段选择了远程下拉 + if (!empty($column['model'])) { + $old[] = '{ITEM_LABEL}'; + $old[] = '{ITEM_VALUE}'; + $new = [ + $column['column_comment'], + $column['column_name'], + Str::camel($column['column_name']), + $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', + Str::camel($column['column_name']).'List', + $column['label_key'], + $column['value_key'] + ]; + $vmName = $column['view_type'] . '3'; } - - } $vmPath = $this->getvmPath('form/' . $vmName); @@ -191,8 +170,6 @@ class WebEditGenerator extends BaseGenerator } $old[] = '{ITEM_VALUE}'; $new[] = $vmItemValue; - $old[] = '{ITEM_VALUE}'; - $new[] = 'item.name'; } // 数字框处理 if ($column['view_type'] == 'number') { @@ -223,9 +200,11 @@ class WebEditGenerator extends BaseGenerator if (!empty($content)) { $content = substr($content, 0, -1); } + return $this->setBlankSpace($content, ' '); } + /** * 获取数据字典内容 * @return string @@ -555,12 +534,7 @@ class WebEditGenerator extends BaseGenerator $with = Str::camel(substr($column['model'],$str+1)); $content.= PHP_EOL.'const '. Str::camel($column['column_name']).'List = ref([] as any[])'.PHP_EOL; $content.= 'const set'.Str::studly($column['column_name']).'List = async () => {'.PHP_EOL.Str::camel($column['column_name']).'List.value = await (await getWith'.Str::studly($with).'List({})).data' .PHP_EOL.'}' - .PHP_EOL.'set'.Str::studly($column['column_name']).'List())'; - } - - if(!empty($content)) - { - $content = substr($content, 0, -1); + .PHP_EOL.'set'.Str::studly($column['column_name']).'List()'; } return $this->setBlankSpace($content, ' '); @@ -594,7 +568,7 @@ class WebEditGenerator extends BaseGenerator if (!empty($column['model'])) { $str = strripos($column['model'],'\\'); $with = Str::camel(substr($column['model'],$str+1)); - $content.= ' getWith'.Str::studly($with).'List,'; + $content.= ', getWith'.Str::studly($with).'List'; } } return $content; diff --git a/niucloud/app/service/admin/generator/core/WebEditPageGenerator.php b/niucloud/app/service/admin/generator/core/WebEditPageGenerator.php index 5e1504c6d..82d2ccb93 100644 --- a/niucloud/app/service/admin/generator/core/WebEditPageGenerator.php +++ b/niucloud/app/service/admin/generator/core/WebEditPageGenerator.php @@ -148,7 +148,6 @@ class WebEditPageGenerator extends BaseGenerator return $this->setBlankSpace($content, ' '); } - /** * 获取表单内容 * @return string @@ -156,9 +155,8 @@ class WebEditPageGenerator extends BaseGenerator public function getFormView() { $content = ''; - foreach ($this->tableColumn as $column) { - if (!$column['is_insert'] || !$column['is_update'] || $column['is_pk'] || $column['column_name'] == 'site_id') { + if (!$column['is_insert'] || !$column['is_update'] || $column['is_pk']) { continue; } @@ -168,39 +166,20 @@ class WebEditPageGenerator extends BaseGenerator '{LCASE_COLUMN_NAME}', '{PROP}', '{DICT_TYPE}', - '{ITEM_LABEL}', - '{ITEM_VALUE}' ]; - if(empty($column['dict_type'])) + $new = [ + $column['column_comment'], + $column['column_name'], + Str::camel($column['column_name']), + $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', + '' + ]; + $vmName = $column['view_type']; + + if($column['view_type'] == 'select' || $column['view_type'] == 'radio' || $column['view_type'] == 'checkbox') { - - if($column['view_type'] == 'select' || $column['view_type'] == 'radio' || $column['view_type'] == 'checkbox') - { - if(empty($column['model'])) - { - $new = [ - $column['column_comment'], - $column['column_name'], - Str::camel($column['column_name']), - $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', - '' - ]; - - $vmName = $column['view_type'].'3'; - }else{ - $new = [ - $column['column_comment'], - $column['column_name'], - Str::camel($column['column_name']), - $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', - Str::camel($column['column_name']).'List', - $column['label_key'], - $column['value_key'] - ]; - $vmName = $column['view_type']; - } - - }else{ + // 当字段选择了字典 + if (!empty($column['dict_type'])) { $new = [ $column['column_comment'], $column['column_name'], @@ -208,25 +187,22 @@ class WebEditPageGenerator extends BaseGenerator $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', $column['column_name'].'List', ]; - $vmName = $column['view_type']; - - - + $vmName = $column['view_type'] . '2'; } - }else{ - $new = [ - $column['column_comment'], - $column['column_name'], - Str::camel($column['column_name']), - $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', - $column['column_name'].'List', - '' - ]; - if(empty($column['model'])) - { - $vmName = $column['view_type'].'3'; - }else{ - $vmName = $column['view_type']; + // 当字段选择了远程下拉 + if (!empty($column['model'])) { + $old[] = '{ITEM_LABEL}'; + $old[] = '{ITEM_VALUE}'; + $new = [ + $column['column_comment'], + $column['column_name'], + Str::camel($column['column_name']), + $column['is_required'] ? 'prop="'.$column['column_name'].'"' : '', + Str::camel($column['column_name']).'List', + $column['label_key'], + $column['value_key'] + ]; + $vmName = $column['view_type'] . '3'; } } @@ -240,12 +216,10 @@ class WebEditPageGenerator extends BaseGenerator $vmItemValue = 'item.value'; $intFieldValue = ['tinyint', 'smallint', 'mediumint', 'int', 'integer', 'bigint']; if (in_array($column['column_type'], $intFieldValue)) { - $vmItemValue = 'item.value'; + $vmItemValue = 'parseInt(item.value)'; } $old[] = '{ITEM_VALUE}'; $new[] = $vmItemValue; -// $old[] = '{ITEM_VALUE}'; -// $new[] = 'item.name'; } // 数字框处理 if ($column['view_type'] == 'number') { @@ -254,31 +228,29 @@ class WebEditPageGenerator extends BaseGenerator $validate = json_decode($column['validate_type'],true); if($validate[0] == 'min') { - $rule = ':min = '."'".$validate[1][0]."'"; + $rule = ':min = "'.$validate[1][0].'"'; } if($validate[0] == 'max') { - $rule = ':max = '."'".$validate[1][0]."'"; + $rule = ':max = "'.$validate[1][0].'"'; } if($validate[0] == 'between') { - $rule = ':min = "'.$validate[1][0].'"'.' :max = "'.$validate[1][1].'"'; + $rule = ':min = "'.$validate[1][0].'"'.' max = "'.$validate[1][1].'"'; } - $old[] = '{RULE}'; - $new[] = $rule; }else{ - $old[] = '{RULE}'; - $new[] = ''; + $rule = ''; } - + $old[] = '{RULE}'; + $new[] = $rule; } $content .= $this->replaceFileText($old, $new, $vmPath) . PHP_EOL; } - if (!empty($content)) { $content = substr($content, 0, -1); } + return $this->setBlankSpace($content, ' '); } @@ -548,12 +520,7 @@ class WebEditPageGenerator extends BaseGenerator $with = Str::camel(substr($column['model'],$str+1)); $content.= PHP_EOL.'const '. Str::camel($column['column_name']).'List = ref([] as any[])'.PHP_EOL; $content.= 'const set'.Str::studly($column['column_name']).'List = async () => {'.PHP_EOL.Str::camel($column['column_name']).'List.value = await (await getWith'.Str::studly($with).'List({})).data' .PHP_EOL.'}' - .PHP_EOL.'set'.Str::studly($column['column_name']).'List())'; - } - - if(!empty($content)) - { - $content = substr($content, 0, -1); + .PHP_EOL.'set'.Str::studly($column['column_name']).'List()'; } return $this->setBlankSpace($content, ' '); @@ -570,7 +537,7 @@ class WebEditPageGenerator extends BaseGenerator if (!empty($column['model'])) { $str = strripos($column['model'],'\\'); $with = Str::camel(substr($column['model'],$str+1)); - $content.= ' getWith'.Str::studly($with).'List,'; + $content.= ', getWith'.Str::studly($with).'List'; } } return $content; diff --git a/niucloud/app/service/admin/generator/core/WebIndexGenerator.php b/niucloud/app/service/admin/generator/core/WebIndexGenerator.php index 7dd85d80a..78dc6e1ff 100644 --- a/niucloud/app/service/admin/generator/core/WebIndexGenerator.php +++ b/niucloud/app/service/admin/generator/core/WebIndexGenerator.php @@ -52,9 +52,7 @@ class WebIndexGenerator extends BaseGenerator '{API_PATH}', '{DICT_LIST}', '{WITH_API_PATH}', - '{MODEL_DATA}', - '{EDIT_WITH_API_PATH}' - + '{MODEL_DATA}' ]; $new = [ @@ -77,8 +75,7 @@ class WebIndexGenerator extends BaseGenerator // $this->getDictDataContent(), $this->getDictList(), $this->getWithApiPath(), - $this->getModelData(), - $this->getEditWithApiPath(), + $this->getModelData() ]; @@ -153,14 +150,10 @@ class WebIndexGenerator extends BaseGenerator */ public function getAddEvent() { - $class_name = $this->className ? '/'.Str::lower($this->className) : ''; if($this->table['edit_type'] == 2){ - $route = ''; - if (!empty($this->table['parent_menu'])) { - $route = '/' . (new CoreMenuService())->getRoutePathByMenuKey($this->table['parent_menu']); - } + $route = '/' . $this->moduleName.'/'.($this->className ? Str::lower($this->className) . '_edit' : 'edit'); //打开新页面 - $content = "router.push('".$route."/".$this->moduleName."/". Str::lower($this->className) ."_edit')"; + $content = "router.push('".$route."')"; }else{ $content = 'edit'.$this->getUCaseClassName().'Dialog.value.setFormData()'.PHP_EOL.'edit'.$this->getUCaseClassName().'Dialog.value.showDialog = true'; } @@ -175,13 +168,9 @@ class WebIndexGenerator extends BaseGenerator */ public function getEditEvent() { - $class_name = $this->className ? '/'.Str::lower($this->className) : ''; if($this->table['edit_type'] == 2){ - $route = ''; - if (!empty($this->table['parent_menu'])) { - $route = '/' . (new CoreMenuService())->getRoutePathByMenuKey($this->table['parent_menu']); - } - $content = "router.push('".$route."/".$this->moduleName."/". Str::lower($this->className) ."_edit?id='+data.".$this->getPk().")"; + $route = '/' . $this->moduleName.'/'.($this->className ? Str::lower($this->className) . '_edit' : 'edit') . "?id='+data.".$this->getPk(); + $content = "router.push('".$route.")"; }else{ $content = 'edit'.$this->getUCaseClassName().'Dialog.value.setFormData(data)'.PHP_EOL.'edit'.$this->getUCaseClassName().'Dialog.value.showDialog = true'; } @@ -560,7 +549,7 @@ class WebIndexGenerator extends BaseGenerator if (!empty($column['model'])) { $str = strripos($column['model'],'\\'); $with = Str::camel(substr($column['model'],$str+1)); - $content.= ' getWith'.Str::studly($with).'List,'; + $content.= ', getWith'.Str::studly($with).'List'; } } return $content; @@ -583,31 +572,10 @@ class WebIndexGenerator extends BaseGenerator $with = Str::camel(substr($column['model'],$str+1)); $content.= PHP_EOL.'const '. Str::camel($column['column_name']).'List = ref([])'.PHP_EOL; $content.= 'const set'.Str::studly($column['column_name']).'List = async () => {'.PHP_EOL.Str::camel($column['column_name']).'List.value = await (await getWith'.Str::studly($with).'List({})).data' .PHP_EOL.'}' - .PHP_EOL.'set'.Str::studly($column['column_name']).'List())'; - } - - if(!empty($content)) - { - $content = substr($content, 0, -1); + .PHP_EOL.'set'.Str::studly($column['column_name']).'List()'; } return $this->setBlankSpace($content, ' '); } - /** - * 编辑远程下拉方法 - * @return void - */ - public function getEditWithApiPath() - { - $content = ''; - foreach ($this->tableColumn as $column) { - if (!empty($column['model'])) { - $str = strripos($column['model'],'\\'); - $with = Str::camel(substr($column['model'],$str+1)); - $content.= ' getWith'.Str::studly($with).'List,'; - } - } - return $content; - } } diff --git a/niucloud/app/service/admin/generator/vm/form/checkbox.vm b/niucloud/app/service/admin/generator/vm/form/checkbox.vm index 4ac3d8a9a..b8f707745 100644 --- a/niucloud/app/service/admin/generator/vm/form/checkbox.vm +++ b/niucloud/app/service/admin/generator/vm/form/checkbox.vm @@ -1,10 +1,6 @@ - + - - {{ item.{ITEM_LABEL} }} - + 选项1 + 选项2 diff --git a/niucloud/app/service/admin/generator/vm/form/checkbox2.vm b/niucloud/app/service/admin/generator/vm/form/checkbox2.vm index b8f707745..6b7c8c14d 100644 --- a/niucloud/app/service/admin/generator/vm/form/checkbox2.vm +++ b/niucloud/app/service/admin/generator/vm/form/checkbox2.vm @@ -1,6 +1,10 @@ - 选项1 - 选项2 + + {{ item.name }} + diff --git a/niucloud/app/service/admin/generator/vm/form/checkbox3.vm b/niucloud/app/service/admin/generator/vm/form/checkbox3.vm index 401a65369..8b18ec87e 100644 --- a/niucloud/app/service/admin/generator/vm/form/checkbox3.vm +++ b/niucloud/app/service/admin/generator/vm/form/checkbox3.vm @@ -1,10 +1,10 @@ - + - {{ item.name }} + :label="item['{ITEM_VALUE}']"> + {{ item['{ITEM_LABEL}'] }} diff --git a/niucloud/app/service/admin/generator/vm/form/radio.vm b/niucloud/app/service/admin/generator/vm/form/radio.vm index 174754406..a23b76517 100644 --- a/niucloud/app/service/admin/generator/vm/form/radio.vm +++ b/niucloud/app/service/admin/generator/vm/form/radio.vm @@ -1,10 +1,10 @@ - - - - {{ item.{ITEM_LABEL} }} + + + 选项1 + + + 选项2 diff --git a/niucloud/app/service/admin/generator/vm/form/radio2.vm b/niucloud/app/service/admin/generator/vm/form/radio2.vm index 4ed61e986..2d85a649e 100644 --- a/niucloud/app/service/admin/generator/vm/form/radio2.vm +++ b/niucloud/app/service/admin/generator/vm/form/radio2.vm @@ -1,10 +1,9 @@ - - - 选项1 - - - 选项2 + + + {{ item.name }} diff --git a/niucloud/app/service/admin/generator/vm/form/radio3.vm b/niucloud/app/service/admin/generator/vm/form/radio3.vm index d6825d889..dd812360d 100644 --- a/niucloud/app/service/admin/generator/vm/form/radio3.vm +++ b/niucloud/app/service/admin/generator/vm/form/radio3.vm @@ -4,8 +4,8 @@ - {{ item.name }} + :label="item['{ITEM_VALUE}']"> + {{ item['{ITEM_LABEL}'] }} diff --git a/niucloud/app/service/admin/generator/vm/form/select.vm b/niucloud/app/service/admin/generator/vm/form/select.vm index 88930cb20..eed3db3ba 100644 --- a/niucloud/app/service/admin/generator/vm/form/select.vm +++ b/niucloud/app/service/admin/generator/vm/form/select.vm @@ -1,11 +1,12 @@ - - + + diff --git a/niucloud/app/service/admin/generator/vm/form/select2.vm b/niucloud/app/service/admin/generator/vm/form/select2.vm index eed3db3ba..9b39c4e57 100644 --- a/niucloud/app/service/admin/generator/vm/form/select2.vm +++ b/niucloud/app/service/admin/generator/vm/form/select2.vm @@ -1,12 +1,11 @@ - + + - diff --git a/niucloud/app/service/admin/generator/vm/form/select3.vm b/niucloud/app/service/admin/generator/vm/form/select3.vm index 98ea4884b..f21ab35d5 100644 --- a/niucloud/app/service/admin/generator/vm/form/select3.vm +++ b/niucloud/app/service/admin/generator/vm/form/select3.vm @@ -4,8 +4,8 @@ diff --git a/niucloud/app/service/admin/generator/vm/search/select2.vm b/niucloud/app/service/admin/generator/vm/search/select2.vm index cdaff9fc8..6e78d6fed 100644 --- a/niucloud/app/service/admin/generator/vm/search/select2.vm +++ b/niucloud/app/service/admin/generator/vm/search/select2.vm @@ -1,5 +1,5 @@ - + diff --git a/niucloud/app/service/admin/generator/vm/web_edit.vm b/niucloud/app/service/admin/generator/vm/web_edit.vm index 37127b8ca..3a2ceb881 100644 --- a/niucloud/app/service/admin/generator/vm/web_edit.vm +++ b/niucloud/app/service/admin/generator/vm/web_edit.vm @@ -21,8 +21,7 @@ import { ref, reactive, computed, watch } from 'vue' import { useDictionary } from '@/app/api/dict' import { t } from '@/lang' import type { FormInstance } from 'element-plus' - -import { add{UCASE_NAME}, edit{UCASE_NAME}, get{UCASE_NAME}Info,{WITH_API_PATH} } from '@/{API_PATH}' +import { add{UCASE_NAME}, edit{UCASE_NAME}, get{UCASE_NAME}Info{WITH_API_PATH} } from '@/{API_PATH}' let showDialog = ref(false) const loading = ref(false) diff --git a/niucloud/app/service/admin/generator/vm/web_edit_page.vm b/niucloud/app/service/admin/generator/vm/web_edit_page.vm index 313707dae..f971e4a6d 100644 --- a/niucloud/app/service/admin/generator/vm/web_edit_page.vm +++ b/niucloud/app/service/admin/generator/vm/web_edit_page.vm @@ -27,7 +27,7 @@ import { ref, reactive, computed, watch } from 'vue' import { t } from '@/lang' import { useDictionary } from '@/app/api/dict' import type { FormInstance } from 'element-plus' -import { get{UCASE_NAME}Info,add{UCASE_NAME},edit{UCASE_NAME},{WITH_API_PATH} } from '@/{API_PATH}'; +import { get{UCASE_NAME}Info,add{UCASE_NAME},edit{UCASE_NAME}{WITH_API_PATH} } from '@/{API_PATH}'; import { useRoute } from 'vue-router' const route = useRoute() diff --git a/niucloud/app/service/admin/generator/vm/web_index.vm b/niucloud/app/service/admin/generator/vm/web_index.vm index 6ba38622b..ef0a7b37d 100644 --- a/niucloud/app/service/admin/generator/vm/web_index.vm +++ b/niucloud/app/service/admin/generator/vm/web_index.vm @@ -49,7 +49,7 @@ import { reactive, ref, watch } from 'vue' import { t } from '@/lang' import { useDictionary } from '@/app/api/dict' -import { get{UCASE_NAME}List, delete{UCASE_NAME},{WITH_API_PATH} } from '@/{API_PATH}' +import { get{UCASE_NAME}List, delete{UCASE_NAME}{WITH_API_PATH} } from '@/{API_PATH}' import { img } from '@/utils/common' import { ElMessageBox,FormInstance } from 'element-plus' {EDIT_PATH} diff --git a/niucloud/app/service/admin/home/AuthSiteService.php b/niucloud/app/service/admin/home/AuthSiteService.php index dabbe443a..01341ac32 100644 --- a/niucloud/app/service/admin/home/AuthSiteService.php +++ b/niucloud/app/service/admin/home/AuthSiteService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/install/InstallArticleService.php b/niucloud/app/service/admin/install/InstallArticleService.php index 6f2ec419e..ba77f92e2 100644 --- a/niucloud/app/service/admin/install/InstallArticleService.php +++ b/niucloud/app/service/admin/install/InstallArticleService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/install/InstallSystemService.php b/niucloud/app/service/admin/install/InstallSystemService.php index 20f03392a..d58ac434f 100644 --- a/niucloud/app/service/admin/install/InstallSystemService.php +++ b/niucloud/app/service/admin/install/InstallSystemService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/member/MemberAccountService.php b/niucloud/app/service/admin/member/MemberAccountService.php index e12432433..9334e763e 100644 --- a/niucloud/app/service/admin/member/MemberAccountService.php +++ b/niucloud/app/service/admin/member/MemberAccountService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -115,7 +115,7 @@ class MemberAccountService extends BaseAdminService */ public function getMemberAccountInfo(int $member_id) { - $field = 'point, point_get, balance, balance_get, growth, growth_get, money, money_get, commission, commission_get'; + $field = 'point, point_get, balance, balance_get, growth, growth_get, money, money_get, commission, commission_get, commission_cash_outing'; return ( new Member() )->where([ [ 'member_id', '=', $member_id ], [ 'site_id', '=', $this->site_id ] ])->field($field)->findOrEmpty()->toArray(); } @@ -151,4 +151,4 @@ class MemberAccountService extends BaseAdminService return $this->model->where($condition)->sum('account_data'); } -} \ No newline at end of file +} diff --git a/niucloud/app/service/admin/member/MemberCashOutConfigService.php b/niucloud/app/service/admin/member/MemberCashOutConfigService.php index 064758b67..c10d26de8 100644 --- a/niucloud/app/service/admin/member/MemberCashOutConfigService.php +++ b/niucloud/app/service/admin/member/MemberCashOutConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/member/MemberCashOutService.php b/niucloud/app/service/admin/member/MemberCashOutService.php index 6ffb32212..7498170e3 100644 --- a/niucloud/app/service/admin/member/MemberCashOutService.php +++ b/niucloud/app/service/admin/member/MemberCashOutService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -41,7 +41,10 @@ class MemberCashOutService extends BaseAdminService { $member_where = [['member.member_no|member.nickname|member.mobile', '=', $where['keywords']]]; } - $search_model = $this->model->where([['member_cash_out.site_id', '=', $this->site_id]])->withSearch(['member_id','status', 'join_create_time' => 'create_time', 'audit_time', 'transfer_time', 'transfer_type', 'cash_out_no'],$where)->with(['transfer'])->withJoin(["member" => ['memeber_id', 'member_no', 'username', 'mobile', 'nickname', 'headimg']])->where($member_where)->field($field)->order('create_time desc')->append(['status_name', 'transfer_status_name', 'transfer_type_name', 'account_type_name']); + $search_model = $this->model->where([['member_cash_out.site_id', '=', $this->site_id]]) + ->withSearch(['member_id','status', 'join_create_time' => 'create_time', 'audit_time', 'transfer_time', 'transfer_type', 'cash_out_no'],$where)->with(['transfer']) + ->withJoin(["member" => ['member_id', 'member_no', 'username', 'mobile', 'nickname', 'headimg']])->where($member_where)->field($field) + ->order('create_time desc')->append(['status_name', 'transfer_status_name', 'transfer_type_name', 'account_type_name']); return $this->pageQuery($search_model); } diff --git a/niucloud/app/service/admin/member/MemberConfigService.php b/niucloud/app/service/admin/member/MemberConfigService.php index 9b6efbf2f..c64a120ff 100644 --- a/niucloud/app/service/admin/member/MemberConfigService.php +++ b/niucloud/app/service/admin/member/MemberConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -13,6 +13,7 @@ namespace app\service\admin\member; use app\model\sys\SysConfig; use app\service\core\member\CoreMemberConfigService; +use app\service\core\member\CoreMemberService; use core\base\BaseAdminService; use think\Model; @@ -71,4 +72,45 @@ class MemberConfigService extends BaseAdminService public function setMemberConfig(array $data){ return (new CoreMemberConfigService())->setMemberConfig($this->site_id, $data); } -} \ No newline at end of file + + /** + * 获取成长值规则配置 + */ + public function getGrowthRuleConfig(){ + $config = (new CoreMemberConfigService())->getGrowthRuleConfig($this->site_id); + if (!empty($config)) { + $config = CoreMemberService::getGrowthRuleContent($this->site_id, $config); + } + return $config; + } + + /** + * 配置成长值规则 + * @param array $data + * @return true + */ + public function setGrowthRuleConfig(array $data){ + return (new CoreMemberConfigService())->setGrowthRuleConfig($this->site_id, $data); + } + + /** + * 获取积分规则配置 + */ + public function getPointRuleConfig(){ + $config = (new CoreMemberConfigService())->getPointRuleConfig($this->site_id); + if (!empty($config)) { + if (isset($config['grant']) && !empty($config['grant'])) $config['grant'] = CoreMemberService::getPointGrantRuleContent($this->site_id, $config['grant']); + if (isset($config['consume']) && !empty($config['consume'])) $config['consume'] = CoreMemberService::getPointGrantRuleContent($this->site_id, $config['consume']); + } + return $config; + } + + /** + * 配置积分规则 + * @param array $data + * @return true + */ + public function setPointRuleConfig(array $data){ + return (new CoreMemberConfigService())->setPointRuleConfig($this->site_id, $data); + } +} diff --git a/niucloud/app/service/admin/member/MemberLabelService.php b/niucloud/app/service/admin/member/MemberLabelService.php index 6446c51f3..746fd2562 100644 --- a/niucloud/app/service/admin/member/MemberLabelService.php +++ b/niucloud/app/service/admin/member/MemberLabelService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/member/MemberLevelService.php b/niucloud/app/service/admin/member/MemberLevelService.php new file mode 100644 index 000000000..2d39cbe21 --- /dev/null +++ b/niucloud/app/service/admin/member/MemberLevelService.php @@ -0,0 +1,132 @@ +model = new MemberLevel(); + } + + /** + * 获取会员等级分页列表 + * @param array $where + * @param string $order + * @return array + */ + public function getPage(array $where = [], string $order = 'growth asc') + { + $field = 'level_id,site_id,level_name,growth,remark,create_time,update_time,level_benefits,level_gifts'; + $search_model = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ 'level_name' ], $where)->field($field)->append([ "member_num" ])->order($order); + return $this->pageQuery($search_model, function ($item) { + if (!empty($item['level_benefits'])) $item['level_benefits'] = CoreMemberService::getBenefitsContent($item['site_id'], $item['level_benefits']); + if (!empty($item['level_gifts'])) $item['level_gifts'] = CoreMemberService::getGiftContent($item['site_id'], $item['level_gifts']); + }); + } + + /** + * 获取会员等级列表 + * @param array $where + * @param string $field + * @return array + */ + public function getList(array $where = [], $field = 'level_id,site_id,level_name,growth,remark,create_time,update_time,level_benefits,level_gifts') + { + $order = 'growth asc'; + return $this->model->where([['site_id', '=', $this->site_id]])->withSearch([ "level_name" ], $where)->field($field)->order($order)->select()->toArray(); + } + + /** + * 获取会员等级信息 + * @param int $level_id + * @return array + */ + public function getInfo(int $level_id) + { + $field = 'level_id,site_id,level_name,growth,remark,create_time,update_time,level_benefits,level_gifts'; + return $this->model->field($field)->where([ [ 'level_id', '=', $level_id ], [ 'site_id', '=', $this->site_id ] ])->findOrEmpty()->toArray(); + } + + /** + * 获取等级 + * @return array + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + */ + public function getAll() + { + return ( new CoreMemberLevelService() )->getAll($this->site_id); + } + + /** + * 添加会员等级 + * @param array $data + * @return mixed + */ + public function add(array $data) + { + $count = $this->model->where([ ['site_id', '=', $this->site_id ] ])->count(); + if ($count >= 10) throw new CommonException('MEMBER_LEVEL_MAX'); + + $data[ 'site_id' ] = $this->site_id; + $res = $this->model->create($data); + ( new CoreMemberLevelService() )->clearCache($this->site_id); + return $res->level_id; + } + + /** + * 会员等级编辑 + * @param int $level_id + * @param array $data + * @return true + */ + public function edit(int $level_id, array $data) + { + $data[ 'update_time' ] = time(); + $this->model->update($data, [ [ 'level_id', '=', $level_id ], [ 'site_id', '=', $this->site_id ] ]); + ( new CoreMemberLevelService() )->clearCache($this->site_id); + return true; + } + + /** + * 删除会员等级 + * @param int $level_id + * @return bool + */ + public function del(int $level_id) + { + $level = $this->model->where([ [ 'level_id', '=', $level_id ], [ 'site_id', '=', $this->site_id ] ])->append(['member_num'])->findOrEmpty(); + if ($level['member_num'] > 0) throw new CommonException('LEVEL_NOT_ALLOWED_DELETE'); + $level->delete(); + ( new CoreMemberLevelService() )->clearCache($this->site_id); + return true; + } + +} diff --git a/niucloud/app/service/admin/member/MemberService.php b/niucloud/app/service/admin/member/MemberService.php index b394b363f..40a65f4c4 100644 --- a/niucloud/app/service/admin/member/MemberService.php +++ b/niucloud/app/service/admin/member/MemberService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -14,8 +14,11 @@ namespace app\service\admin\member; use app\dict\member\MemberRegisterChannelDict; use app\dict\member\MemberRegisterTypeDict; use app\model\member\Member; +use app\service\admin\sys\ExportService; use app\service\core\member\CoreMemberService; +use app\service\core\sys\CoreExportService; use core\base\BaseAdminService; +use core\dict\DictLoader; use core\exception\AdminException; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; @@ -43,7 +46,11 @@ class MemberService extends BaseAdminService { $field = 'member_id, member_no, site_id, username, mobile, password, register_channel, register_type, nickname, headimg, member_level, member_label, wx_openid, weapp_openid, wx_unionid, ali_openid, douyin_openid, login_ip, login_type, login_channel, login_count, login_time, create_time, last_visit_time, last_consum_time, sex, status, birthday, point, point_get, balance, balance_get, growth, growth_get, is_member, member_time, is_del, province_id, city_id, district_id, address, location, delete_time, money, money_get, commission, commission_get, commission_cash_outing'; - $search_model = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['keyword','register_type', 'create_time', 'is_del', 'member_label', 'register_channel'],$where)->field($field)->order('member_id desc')->append(['register_channel_name', 'register_type_name', 'sex_name', 'login_channel_name', 'login_type_name', 'status_name']); + $search_model = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['keyword','register_type', 'create_time', 'is_del', 'member_label', 'register_channel','member_level'],$where) + ->field($field) + ->order('member_id desc') + ->with('member_level_name_bind') + ->append(['register_channel_name', 'register_type_name', 'sex_name', 'login_channel_name', 'login_type_name', 'status_name']); return $this->pageQuery($search_model, function ($item, $key) { $item = $this->makeUp($item); }); @@ -70,7 +77,7 @@ class MemberService extends BaseAdminService public function getInfo(int $member_id) { $field = 'member_id,member_no, site_id, username, mobile, password, register_channel, register_type, nickname, headimg, member_level, member_label, wx_openid, weapp_openid, wx_unionid, ali_openid, douyin_openid, login_ip, login_type, login_channel, login_count, login_time, create_time, last_visit_time, last_consum_time, sex, status, birthday, point, point_get, balance, balance_get, growth, growth_get, is_member, member_time, is_del, province_id, city_id, district_id, address, location, delete_time, money, money_get, commission, commission_get, commission_cash_outing'; - return $this->makeUp($this->model->where([['member_id', '=', $member_id], ['site_id', '=', $this->site_id]])->field($field)->append(['register_channel_name', 'register_type_name', 'sex_name', 'login_channel_name', 'login_type_name', 'status_name'])->findOrEmpty()->toArray()); + return $this->makeUp($this->model->where([['member_id', '=', $member_id], ['site_id', '=', $this->site_id]])->field($field)->with('member_level_name_bind')->append(['register_channel_name', 'register_type_name', 'sex_name', 'login_channel_name', 'login_type_name', 'status_name'])->findOrEmpty()->toArray()); } /** @@ -220,4 +227,68 @@ class MemberService extends BaseAdminService return true; } -} \ No newline at end of file + /** + * 导出会员列表 + * @param array $where + * @return true + */ + public function exportMember(array $where = []) + { + $field = 'member_id, member_no, username, mobile, nickname, point, balance, money, growth, commission, register_channel, status, create_time, last_visit_time'; + //查询导出数据 + $data = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['keyword','register_type', 'create_time', 'is_del', 'member_label', 'register_channel'],$where)->field($field)->append(['register_channel_name', 'status_name'])->select()->toArray(); + //执行导出 + (new ExportService())->exportData('member', $data); + return true; + } + + /** + * 获取会员权益字典 + * @return mixed + */ + public function getMemberBenefitsDict() { + return (new DictLoader("MemberBenefits"))->load(); + } + + /** + * 获取会员礼包字典 + * @return array|null + */ + public function getMemberGiftDict() { + return (new DictLoader("MemberGift"))->load(); + } + + /** + * 获取成长值规则字典 + * @return array|null + */ + public function getGrowthRuleDict() { + return (new DictLoader("GrowthRule"))->load(); + } + + /** + * 获取积分规则字典 + * @return array|null + */ + public function getPointRuleDict() { + return (new DictLoader("PointRule"))->load(); + } + + /** + * 获取会员权益内容 + * @param array $benefits + * @return array|null + */ + public function getMemberBenefitsContent(array $benefits) { + return (new CoreMemberService())->getBenefitsContent($this->site_id, $benefits); + } + + /** + * 获取会员礼包内容 + * @param array $benefits + * @return array|null + */ + public function getMemberGiftsContent(array $gifts) { + return (new CoreMemberService())->getGiftContent($this->site_id, $gifts); + } +} diff --git a/niucloud/app/service/admin/member/MemberSignService.php b/niucloud/app/service/admin/member/MemberSignService.php new file mode 100644 index 000000000..f69738958 --- /dev/null +++ b/niucloud/app/service/admin/member/MemberSignService.php @@ -0,0 +1,114 @@ +model = new MemberSign(); + } + + /** + * 会员签到记录 + * @param array $where + * @return array + */ + public function getPage(array $where = []) + { + $member_where = []; + if(!empty($where['keywords'])) + { + $member_where = [['member.member_no|member.nickname|member.mobile', 'like', '%'.$where['keywords'].'%']]; + } + $field = 'sign_id, member_sign.site_id, member_sign.member_id, days, day_award, continue_award, continue_tag, member_sign.create_time, is_sign'; + $search_model = $this->model->withSearch(['create_time'],$where)->where($member_where)->where([['member_sign.site_id', '=', $this->site_id]])->withJoin(["member" => ['member_no', 'mobile', 'nickname', 'headimg']])->field($field)->append(['is_sign_name'])->order('member_sign.create_time desc'); + return $this->pageQuery($search_model, function ($item, $key) { + $item = $this->makeUp($item); + }); + } + + /** + * 组合整理数据 + * @param $data + */ + public function makeUp($data){ + //日签奖励 + if(!empty($data['day_award'])){ + $data['day_award'] = (new CoreMemberService())->getGiftContent($this->site_id, $data['day_award']); + } + //连签奖励 + if(!empty($data['continue_award'])){ + $gift = $data['continue_award']; + unset($gift['continue_sign'], $gift['continue_tag'], $gift['receive_limit'], $gift['receive_num']); + $data['continue_award'] = (new CoreMemberService())->getGiftContent($this->site_id, $gift); + } + return $data; + } + + /** + * 会员签到详情 + * @param int $sign_id + * @return array + */ + public function getInfo(int $sign_id) + { + $field = 'sign_id, site_id, member_id, days, day_award, continue_award, continue_tag, create_time, is_sign'; + return $this->model->where([['sign_id', '=', $sign_id], ['site_id', '=', $this->site_id]])->field($field)->append(['is_sign_name'])->findOrEmpty()->toArray(); + } + + /** + * 设置签到设置 + * @param array $value + * @return bool + */ + public function setSign(array $value) + { + $data = [ + 'is_use' => $value[ 'is_use' ], //是否开启 + 'sign_period' => $value[ 'sign_period' ], // 签到周期 + 'day_award' => $value[ 'day_award' ], // 日签奖励 + 'continue_award' => $value[ 'continue_award' ], // 连签奖励 + 'rule_explain' => $value[ 'rule_explain' ] // 规则说明 + ]; + return ( new CoreConfigService() )->setConfig($this->site_id, 'SIGN_CONFIG', $data); + } + + /** + * 获取签到设置 + */ + public function getSign() + { + $info = ( new CoreConfigService() )->getConfig($this->site_id, 'SIGN_CONFIG'); + if (empty($info)) { + $info = []; + $info[ 'value' ] = [ + 'is_use' => 0, + 'sign_period' => '', + 'day_award' => '', + 'continue_award' => [], + 'rule_explain' => '' + ]; + } + return $info[ 'value' ]; + } +} \ No newline at end of file diff --git a/niucloud/app/service/admin/niucloud/NiucloudService.php b/niucloud/app/service/admin/niucloud/NiucloudService.php index befe10b4f..9563a9c0e 100644 --- a/niucloud/app/service/admin/niucloud/NiucloudService.php +++ b/niucloud/app/service/admin/niucloud/NiucloudService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/notice/NoticeLogService.php b/niucloud/app/service/admin/notice/NoticeLogService.php index 75cde2023..0d98dcc87 100644 --- a/niucloud/app/service/admin/notice/NoticeLogService.php +++ b/niucloud/app/service/admin/notice/NoticeLogService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/notice/NoticeService.php b/niucloud/app/service/admin/notice/NoticeService.php index 5ede8e5c4..41ba39c2e 100644 --- a/niucloud/app/service/admin/notice/NoticeService.php +++ b/niucloud/app/service/admin/notice/NoticeService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/notice/NoticeSmsLogService.php b/niucloud/app/service/admin/notice/NoticeSmsLogService.php index ca0abac8b..282f75cd7 100644 --- a/niucloud/app/service/admin/notice/NoticeSmsLogService.php +++ b/niucloud/app/service/admin/notice/NoticeSmsLogService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/notice/SmsService.php b/niucloud/app/service/admin/notice/SmsService.php index ea43b3e7f..d6190fa50 100644 --- a/niucloud/app/service/admin/notice/SmsService.php +++ b/niucloud/app/service/admin/notice/SmsService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/pay/PayChannelService.php b/niucloud/app/service/admin/pay/PayChannelService.php index a4d98aecf..c4cce8d3a 100644 --- a/niucloud/app/service/admin/pay/PayChannelService.php +++ b/niucloud/app/service/admin/pay/PayChannelService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -46,7 +46,7 @@ class PayChannelService extends BaseAdminService */ public function set(string $channel, string $type, array $data) { - $where = array( + $where = array ( 'type' => $type, 'channel' => $channel ); @@ -56,13 +56,13 @@ class PayChannelService extends BaseAdminService } $pay_channel = $this->core_pay_channel_service->find($this->site_id, $where); if ($pay_channel->isEmpty()) { - $data['channel'] = $channel; - $data['type'] = $type; - $data['site_id'] = $this->site_id; - $data['config'] = $this->getConfigByPayType($data['config'], $type); + $data[ 'channel' ] = $channel; + $data[ 'type' ] = $type; + $data[ 'site_id' ] = $this->site_id; + $data[ 'config' ] = $this->getConfigByPayType($data[ 'config' ], $type); $res = $this->model->create($data); } else { - $data['config'] = $this->getConfigByPayType($data['config'], $type); + $data[ 'config' ] = $this->getConfigByPayType($data[ 'config' ], $type); $pay_channel->save($data); } return true; @@ -78,28 +78,28 @@ class PayChannelService extends BaseAdminService public function getChannelList() { $channel_list = PayChannelDict::getPayChannel(); - $where = array( - 'site_id' => $this->site_id, + $where = array ( + 'site_id' => $this->site_id ); $pay_channel_list_temp = $this->model->where($where)->field('type, channel, config, sort, status')->select()->toArray(); $pay_channel_list = []; foreach ($pay_channel_list_temp as $v) { - $pay_channel_list[$v['channel']][$v['type']] = $v; + $pay_channel_list[ $v[ 'channel' ] ][ $v[ 'type' ] ] = $v; } foreach ($channel_list as $k => $v) { - $temp_item = $pay_channel_list[$k] ?? []; - foreach ($v['pay_type'] as $item_k => $item_v) { - $temp_v_item = $temp_item[$item_k] ?? ['status' => 0, 'config' => ['name' => ''], 'sort' => 0]; - $item_v['config'] = $temp_v_item['config']; - $item_v['status'] = $temp_v_item['status']; - $item_v['sort'] = $temp_v_item['sort']; - $channel_list[$k]['pay_type'][$item_k] = $item_v; + $temp_item = $pay_channel_list[ $k ] ?? []; + foreach ($v[ 'pay_type' ] as $item_k => $item_v) { + $temp_v_item = $temp_item[ $item_k ] ?? [ 'status' => 0, 'config' => [ 'name' => '' ], 'sort' => 0 ]; + $item_v[ 'config' ] = $temp_v_item[ 'config' ]; + $item_v[ 'status' ] = $temp_v_item[ 'status' ]; + $item_v[ 'sort' ] = $temp_v_item[ 'sort' ]; + $channel_list[ $k ][ 'pay_type' ][ $item_k ] = $item_v; } - $temp_pay_type = array_values($channel_list[$k]['pay_type']); + $temp_pay_type = array_values($channel_list[ $k ][ 'pay_type' ]); $sort = array_column($temp_pay_type, 'sort'); array_multisort($sort, SORT_ASC, $temp_pay_type); - $channel_list[$k]['pay_type'] = $temp_pay_type; + $channel_list[ $k ][ 'pay_type' ] = $temp_pay_type; } return $channel_list; } @@ -114,7 +114,7 @@ class PayChannelService extends BaseAdminService */ public function getListByChannel(string $channel) { - $where = array( + $where = array ( 'site_id' => $this->site_id, 'channel' => $channel ); @@ -133,27 +133,27 @@ class PayChannelService extends BaseAdminService switch ($type) { case PayDict::WECHATPAY: $config = [ - 'mch_id' => $data['mch_id'] ?? '',//商户号 - 'mch_secret_key' => $data['mch_secret_key'] ?? '',//商户秘钥 现在默认认为是v3版 - 'mch_secret_cert' => $data['mch_secret_cert'] ?? '',//商户私钥 字符串或路径 - 'mch_public_cert_path' => $data['mch_public_cert_path'] ?? '',//商户公钥证书路径 + 'mch_id' => $data[ 'mch_id' ] ?? '',//商户号 + 'mch_secret_key' => $data[ 'mch_secret_key' ] ?? '',//商户秘钥 现在默认认为是v3版 + 'mch_secret_cert' => $data[ 'mch_secret_cert' ] ?? '',//商户私钥 字符串或路径 + 'mch_public_cert_path' => $data[ 'mch_public_cert_path' ] ?? '',//商户公钥证书路径 ]; break; case PayDict::ALIPAY: $config = [ - 'app_id' => $data['app_id'] ?? '',// 必填-支付宝分配的 app_id - 'app_secret_cert' => $data['app_secret_cert'] ?? '',// 必填-应用私钥 字符串或路径 - 'app_public_cert_path' => $data['app_public_cert_path'] ?? '',//必填-应用公钥证书 路径 - 'alipay_public_cert_path' => $data['alipay_public_cert_path'] ?? '',//必填-支付宝公钥证书 路径 - 'alipay_root_cert_path' => $data['alipay_root_cert_path'] ?? '',// 必填-支付宝根证书 路径 + 'app_id' => $data[ 'app_id' ] ?? '',// 必填-支付宝分配的 app_id + 'app_secret_cert' => $data[ 'app_secret_cert' ] ?? '',// 必填-应用私钥 字符串或路径 + 'app_public_cert_path' => $data[ 'app_public_cert_path' ] ?? '',//必填-应用公钥证书 路径 + 'alipay_public_cert_path' => $data[ 'alipay_public_cert_path' ] ?? '',//必填-支付宝公钥证书 路径 + 'alipay_root_cert_path' => $data[ 'alipay_root_cert_path' ] ?? '',// 必填-支付宝根证书 路径 ]; break; case PayDict::OFFLINEPAY: $config = [ - 'collection_name' => $data['collection_name'] ?? '',// 必填-收款账户名称 - 'collection_bank' => $data['collection_bank'] ?? '',//必填-收款银行 - 'collection_account' => $data['collection_account'] ?? '',//必填-收款账号 - 'collection_desc' => $data['collection_desc'] ?? '',// 必填-转账说明 + 'collection_name' => $data[ 'collection_name' ] ?? '',// 必填-收款账户名称 + 'collection_bank' => $data[ 'collection_bank' ] ?? '',//必填-收款银行 + 'collection_account' => $data[ 'collection_account' ] ?? '',//必填-收款账号 + 'collection_desc' => $data[ 'collection_desc' ] ?? '',// 必填-转账说明 ]; break; } @@ -167,8 +167,8 @@ class PayChannelService extends BaseAdminService */ public function setTransfer($data) { - $wechatpay_config = $data['wechatpay_config']; - $alipay_config = $data['alipay_config']; + $wechatpay_config = $data[ 'wechatpay_config' ]; + $alipay_config = $data[ 'alipay_config' ]; $this->set('transfer', PayDict::WECHATPAY, [ 'config' => $wechatpay_config, 'status' => 1, @@ -180,18 +180,32 @@ class PayChannelService extends BaseAdminService return true; } - public function setAll($data){ - foreach($data as $k => $v){ - $temp_v = $v['pay_type']; - foreach($temp_v as $item_k => $item){ - $this->set($k, $item['key'], [ - 'config' => $item['config'] ?? [], - 'status' => $item['status'] ?? 0, - 'sort' => $item['sort'] ?? 0, + public function setAll($data) + { + foreach ($data as $k => $v) { + $temp_v = $v[ 'pay_type' ]; + foreach ($temp_v as $item_k => $item) { + $this->set($k, $item[ 'key' ], [ + 'config' => $item[ 'config' ] ?? [], + 'status' => $item[ 'status' ] ?? 0, + 'sort' => $item[ 'sort' ] ?? 0, ]); } } return true; } + /** + * 查询信息 + * @param array $where + * @return mixed + */ + public function getInfo($where = []) + { + $where[ 'site_id' ] = $this->site_id; + $res = $this->model->where($where)->field('type, channel, config, sort, status')->findOrEmpty()->toArray(); + return $res; + + } + } diff --git a/niucloud/app/service/admin/pay/PayService.php b/niucloud/app/service/admin/pay/PayService.php index 4cdde9102..2497a1673 100644 --- a/niucloud/app/service/admin/pay/PayService.php +++ b/niucloud/app/service/admin/pay/PayService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/schedule/ScheduleService.php b/niucloud/app/service/admin/schedule/ScheduleService.php index de3734f0a..c1a6f18ed 100644 --- a/niucloud/app/service/admin/schedule/ScheduleService.php +++ b/niucloud/app/service/admin/schedule/ScheduleService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/site/SiteAccountLogService.php b/niucloud/app/service/admin/site/SiteAccountLogService.php index 56c1d3854..fc880f469 100644 --- a/niucloud/app/service/admin/site/SiteAccountLogService.php +++ b/niucloud/app/service/admin/site/SiteAccountLogService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/site/SiteGroupService.php b/niucloud/app/service/admin/site/SiteGroupService.php index 00af16919..e672b39d9 100644 --- a/niucloud/app/service/admin/site/SiteGroupService.php +++ b/niucloud/app/service/admin/site/SiteGroupService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -110,11 +110,13 @@ class SiteGroupService extends BaseAdminService $site_list = (new Site())->field('site_id,initalled_addon')->where([ ['group_id', '=', $group_id] ])->select()->toArray(); if (!empty($site_list)) { - foreach ($site_list as $site) { - if (count(array_diff($data['app'], $group['app'])) || count(array_diff($data['addon'], $group['addon']))) { + sort($data['app']); sort($group['app']); sort($data['addon']); sort($group['addon']); + + if (json_encode($data['app']) != json_encode($group['app']) || json_encode($data['addon']) != json_encode($group['addon'])) { + foreach ($site_list as $site) { $this->siteAddonsChange($site, $group, $data); + Cache::tag(CoreSiteService::$cache_tag_name . $site['site_id'])->clear(); } - Cache::tag(CoreSiteService::$cache_tag_name . $site['site_id'])->clear(); } } @@ -138,7 +140,7 @@ class SiteGroupService extends BaseAdminService event("AddSiteAfter", [ 'site_id' => $site_info['site_id'], 'main_app' => array_diff($new_group['app'], $initalled_addon) , 'site_addons' => array_diff($new_group['addon'], $initalled_addon) ]); $initalled_addon = array_values(array_unique(array_merge($initalled_addon, $new_group['app'], $new_group['addon']))); - (new Site())->update(['initalled_addon' => $initalled_addon], [ ['site_id', '=', $site_info['site_id'] ] ]); + (new Site())->update(['app' => $new_group['app'], 'initalled_addon' => $initalled_addon], [ ['site_id', '=', $site_info['site_id'] ] ]); } public function checkAddon($group_roles){ diff --git a/niucloud/app/service/admin/site/SiteService.php b/niucloud/app/service/admin/site/SiteService.php index 637f741d3..3176b7fa3 100644 --- a/niucloud/app/service/admin/site/SiteService.php +++ b/niucloud/app/service/admin/site/SiteService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -19,8 +19,10 @@ use app\model\site\Site; use app\model\site\SiteGroup; use app\model\sys\SysUserRole; use app\service\admin\addon\AddonService; +use app\service\admin\auth\AuthService; use app\service\admin\generator\GenerateService; 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; @@ -58,7 +60,7 @@ class SiteService extends BaseAdminService public function getPage(array $where = []) { - $field = 'site_id, site_name, front_end_name, front_end_logo, app_type, keywords, logo, icon, `desc`, status, latitude, longitude, province_id, city_id, + $field = 'site_id, site_name, front_end_name, front_end_logo, front_end_icon, 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, app, addons, site_domain'; $condition = [ [ 'app_type', '<>', 'admin' ] @@ -79,7 +81,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, + $field = 'site_id, site_name, front_end_name, front_end_logo, front_end_icon, 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, app, addons, site_domain'; $info = $this->model->where([ [ 'site_id', '=', $site_id ] ])->with([ 'groupName' ])->field($field)->append([ 'status_name' ])->findOrEmpty()->toArray(); if (!empty($info)) { @@ -264,18 +266,24 @@ class SiteService extends BaseAdminService if (empty($site_info)) return []; $app_type = $site_info[ 'app_type' ]; - if ($app_type == AppTypeDict::ADMIN) { - return ( new MenuService() )->getAllMenuList($app_type, $status, $is_tree, $is_button); + + if (AuthService::isSuperAdmin()) { + $is_admin = 1; } else { - $addons = ( new AddonService() )->getAddonKeysBySiteId($site_id); - $addons[] = ''; - if($addon != 'all'){ - $addons = [$addon]; - } - return ( new MenuService() )->getMenuListBySystem($this->app_type, $addons, $is_tree, $is_button, $status); + $user_role_info = (new AuthService())->getAuthRole($this->site_id); + if(empty($user_role_info)) + return []; + $is_admin = $user_role_info['is_admin'];//是否是超级管理员组 } - + if ($app_type == AppTypeDict::ADMIN || $is_admin) { + return ( new MenuService() )->getAllMenuList($app_type, $status, $is_tree, $is_button); + } else { + $user_role_ids = $user_role_info['role_ids']; + $role_service = new RoleService(); + $menu_keys = $role_service->getMenuIdsByRoleIds($this->site_id, $user_role_ids); + return ( new MenuService() )->getMenuListByMenuKeys($this->site_id, $menu_keys, $this->app_type, 1, is_button:$is_button); + } } /** @@ -340,4 +348,13 @@ class SiteService extends BaseAdminService $site_addon = (new CoreSiteService())->getAddonKeysBySiteId($this->site_id); return (new Addon())->where([['type', '=', AddonDict::ADDON], ['status', '=', AddonDict::ON], ['key', 'in', $site_addon ]])->withSearch(['title'], $where)->append(['status_name'])->field('title, icon, key, desc, status, type, support_app')->select()->toArray(); } + + /** + * 获取站点支持的应用插件 + * @return array + */ + public function getAddonKeysBySiteId() { + $site_addon = (new CoreSiteService())->getAddonKeysBySiteId($this->site_id); + return $site_addon; + } } diff --git a/niucloud/app/service/admin/site/SiteUserService.php b/niucloud/app/service/admin/site/SiteUserService.php index c84a5021c..f5a6e2dc3 100644 --- a/niucloud/app/service/admin/site/SiteUserService.php +++ b/niucloud/app/service/admin/site/SiteUserService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/site/UserLogService.php b/niucloud/app/service/admin/site/UserLogService.php index 2163c95d8..06f02e55e 100644 --- a/niucloud/app/service/admin/site/UserLogService.php +++ b/niucloud/app/service/admin/site/UserLogService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/stat/SiteStatService.php b/niucloud/app/service/admin/stat/SiteStatService.php index 2cd72258e..d9ccb53b8 100644 --- a/niucloud/app/service/admin/stat/SiteStatService.php +++ b/niucloud/app/service/admin/stat/SiteStatService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/stat/StatService.php b/niucloud/app/service/admin/stat/StatService.php index 2316b5939..9b919794a 100644 --- a/niucloud/app/service/admin/stat/StatService.php +++ b/niucloud/app/service/admin/stat/StatService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/sys/AgreementService.php b/niucloud/app/service/admin/sys/AgreementService.php index 8442a5e52..73be52c16 100644 --- a/niucloud/app/service/admin/sys/AgreementService.php +++ b/niucloud/app/service/admin/sys/AgreementService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/sys/AppService.php b/niucloud/app/service/admin/sys/AppService.php index 81b89b24a..47f8d1229 100644 --- a/niucloud/app/service/admin/sys/AppService.php +++ b/niucloud/app/service/admin/sys/AppService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/sys/AreaService.php b/niucloud/app/service/admin/sys/AreaService.php index 6ea60b597..3378c78e6 100644 --- a/niucloud/app/service/admin/sys/AreaService.php +++ b/niucloud/app/service/admin/sys/AreaService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/sys/AttachmentService.php b/niucloud/app/service/admin/sys/AttachmentService.php index ac71b7b74..4aabf68b3 100644 --- a/niucloud/app/service/admin/sys/AttachmentService.php +++ b/niucloud/app/service/admin/sys/AttachmentService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/sys/ConfigService.php b/niucloud/app/service/admin/sys/ConfigService.php index e32f69a12..41d6ea107 100644 --- a/niucloud/app/service/admin/sys/ConfigService.php +++ b/niucloud/app/service/admin/sys/ConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -41,7 +41,7 @@ class ConfigService extends BaseAdminService */ public function getCopyright() { - return (new CoreSysConfigService())->getCopyright($this->site_id); + return ( new CoreSysConfigService() )->getCopyright($this->site_id); } /** @@ -52,16 +52,16 @@ class ConfigService extends BaseAdminService public function setCopyright(array $value) { $data = [ - 'icp' => $value['icp'], - 'gov_record' => $value['gov_record'], - 'gov_url' => $value['gov_url'], - 'market_supervision_url' => $value['market_supervision_url'], - 'logo' => $value['logo'], - 'company_name' => $value['company_name'], - 'copyright_link' => $value['copyright_link'], - 'copyright_desc' => $value['copyright_desc'] + 'icp' => $value[ 'icp' ], + 'gov_record' => $value[ 'gov_record' ], + 'gov_url' => $value[ 'gov_url' ], + 'market_supervision_url' => $value[ 'market_supervision_url' ], + 'logo' => $value[ 'logo' ], + 'company_name' => $value[ 'company_name' ], + 'copyright_link' => $value[ 'copyright_link' ], + 'copyright_desc' => $value[ 'copyright_desc' ] ]; - return $this->core_config_service->setConfig($this->site_id,'COPYRIGHT', $data); + return $this->core_config_service->setConfig($this->site_id, 'COPYRIGHT', $data); } /** @@ -70,9 +70,10 @@ class ConfigService extends BaseAdminService */ public function getWebSite() { - return (new SiteService())->getInfo($this->site_id); + return ( new SiteService() )->getInfo($this->site_id); } + /** * 设置网站信息 * @return bool @@ -80,15 +81,17 @@ class ConfigService extends BaseAdminService public function setWebSite($data) { - return (new SiteService())->edit($this->site_id, $data); + return ( new SiteService() )->edit($this->site_id, $data); } + /** * 获取前端域名 * @return array|string[] */ - public function getSceneDomain(){ - return (new CoreSysConfigService())->getSceneDomain($this->site_id); + public function getSceneDomain() + { + return ( new CoreSysConfigService() )->getSceneDomain($this->site_id); } /** @@ -97,17 +100,16 @@ class ConfigService extends BaseAdminService */ public function getService() { - $info = (new CoreConfigService())->getConfig(0, 'SERVICE_INFO'); - if(empty($info)) - { + $info = ( new CoreConfigService() )->getConfig(0, 'SERVICE_INFO'); + if (empty($info)) { $info = []; - $info['value'] = [ + $info[ 'value' ] = [ 'wechat_code' => '', 'enterprise_wechat' => '', 'tel' => '', ]; } - return $info['value']; + return $info[ 'value' ]; } /** @@ -115,14 +117,14 @@ class ConfigService extends BaseAdminService * @param array $value * @return bool */ - public function setService (array $value) + public function setService(array $value) { $data = [ - "wechat_code" => $value['wechat_code'], - "enterprise_wechat" => $value['enterprise_wechat'], - "tel" => $value['tel'] + "wechat_code" => $value[ 'wechat_code' ], + "enterprise_wechat" => $value[ 'enterprise_wechat' ], + "tel" => $value[ 'tel' ] ]; - return $this->core_config_service->setConfig(0,'SERVICE_INFO', $data); + return $this->core_config_service->setConfig(0, 'SERVICE_INFO', $data); } /** @@ -133,12 +135,14 @@ class ConfigService extends BaseAdminService public function setMap(array $value) { $data = [ - 'key' => $value['key'], + 'key' => $value[ 'key' ], + 'is_open' => $value[ 'is_open' ], // 是否开启定位 + 'valid_time' => $value[ 'valid_time' ] // 定位有效期/分钟,过期后将重新获取定位信息,0为不过期 ]; if ($this->site_id == request()->defaultSiteId()) { - (new CoreH5Service())->mapKeyChange($value['key']); + ( new CoreH5Service() )->mapKeyChange($value[ 'key' ]); } - return $this->core_config_service->setConfig($this->site_id,'MAPKEY', $data); + return $this->core_config_service->setConfig($this->site_id, 'MAPKEY', $data); } /** @@ -146,102 +150,19 @@ class ConfigService extends BaseAdminService */ public function getMap() { - $info = (new CoreConfigService())->getConfig($this->site_id, 'MAPKEY'); - if(empty($info)) - { + $info = ( new CoreConfigService() )->getConfig($this->site_id, 'MAPKEY'); + if (empty($info)) { $info = []; - $info['value'] = [ + $info[ 'value' ] = [ 'key' => 'IZQBZ-3UHEU-WTCVD-2464U-I5N4V-ZFFU3', + 'is_open' => 1, // 是否开启定位 + 'valid_time' => 5 // 定位有效期/分钟,过期后将重新获取定位信息,0为不过期 ]; } - 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' - ]; - }else{ - $result = event("SiteIndex"); - $index_list = []; - foreach ($result as $v) - { - $index_list = empty($index_list) ? $v: array_merge($index_list, $v); - } - $tag = 0; - $view_path = $config['value']['view_path']; - foreach ($index_list as $v) - { - $v_view_path = $v['view_path'] ?? ''; - if($view_path == $v_view_path) - { - $tag = 1; - break; - } - } - if($tag == 0) - { - $config['value'] = [ - 'view_path' => 'index/site_index' - ]; - } - - } - return $config['value']['view_path']; - } - - /** - * 站点主页配置 - * @param $data - * @return true - */ - public function setSiteIndexConfig($data) - { - $config = [ - 'view_path' => $data['view_path'] , - ]; - //检测是否路劲一个异常 - $index_list = $this->getSiteIndexList(); - $check_tag = 0; - foreach($index_list as $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 $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; + $info[ 'value' ][ 'is_open' ] = $info[ 'value' ][ 'is_open' ] ?? 1; + $info[ 'value' ][ 'valid_time' ] = $info[ 'value' ][ 'valid_time' ] ?? 5; + return $info[ 'value' ]; } /** @@ -251,7 +172,7 @@ class ConfigService extends BaseAdminService */ public function setShortcutMenu($data) { - (new CoreConfigService())->setConfig($this->site_id, 'shortcut_menu', $data); + ( new CoreConfigService() )->setConfig($this->site_id, 'shortcut_menu', $data); return true; } @@ -261,110 +182,24 @@ class ConfigService extends BaseAdminService */ public function getShortcutMenu() { - $config = (new CoreConfigService())->getConfig($this->site_id, 'shortcut_menu'); - $menu = $config['value'] ?? []; - if(!empty($menu)){ + $config = ( new CoreConfigService() )->getConfig($this->site_id, 'shortcut_menu'); + $menu = $config[ 'value' ] ?? []; + if (!empty($menu)) { $menu_service = new MenuService(); - foreach($menu as $k => &$v){ - $menu_key = $v['menu_key'] ?? ''; - if($menu_key != ''){ + foreach ($menu as $k => &$v) { + $menu_key = $v[ 'menu_key' ] ?? ''; + if ($menu_key != '') { $item_router_path = $menu_service->getFullRouterPath($menu_key); - if(empty($item_router_path)){ - unset($v[$k]); - }else{ - $v['router_path'] = $item_router_path; + if (empty($item_router_path)) { + unset($v[ $k ]); + } else { + $v[ 'router_path' ] = $item_router_path; } } } } return $menu; } - /** - * 获取平台主页配置 - * @return mixed|string[] - */ - public function getAdminIndexConfig() - { - $config = (new CoreConfigService())->getConfig($this->site_id, "admin_index"); - if(empty($config)) - { - $config['value'] = [ - 'view_path' => 'index/index' - ]; - }else{ - $result = event("AdminIndex"); - $index_list = []; - foreach ($result as $v) - { - $index_list = empty($index_list) ? $v: array_merge($index_list, $v); - } - $tag = 0; - $view_path = $config['value']['view_path']; - foreach ($index_list as $v) - { - $v_view_path = $v['view_path'] ?? ''; - if($view_path == $v_view_path) - { - $tag = 1; - break; - } - } - if($tag == 0) - { - $config['value'] = [ - 'view_path' => 'index/index' - ]; - } - - } - return $config['value']['view_path']; - } - - /** - * 站点主页配置 - * @param $data - * @return true - */ - public function setAdminIndexConfig($data) - { - $config = [ - 'view_path' => $data['view_path'] , - ]; - //检测是否路劲一个异常 - $index_list = $this->getAdminIndexList(); - $check_tag = 0; - foreach($index_list as $v) - { - if($v['view_path'] == $data['view_path']) - { - $check_tag = 1; - } - } - if($check_tag == 0) throw new AdminException('ADMIN_INDEX_VIEW_PATH_NOT_EXIST'); - (new CoreConfigService())->setConfig($this->site_id, "admin_index", $config); - return true; - } - - /** - * 获取站点配置的首页列表 - * @return array - */ - public function getAdminIndexList() - { - $result = event("AdminIndex"); - $index_list = []; - foreach ($result as $v) - { - $index_list = empty($index_list) ? $v: array_merge($index_list, $v); - } - $view_path = $this->getAdminIndexConfig(); - 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; - } /** * 获取手机端首页列表 @@ -380,8 +215,9 @@ class ConfigService extends BaseAdminService * 获取开发者key * @return array */ - public function getDeveloperToken() { - return (new CoreConfigService())->getConfigValue(0, "DEVELOPER_TOKEN"); + public function getDeveloperToken() + { + return ( new CoreConfigService() )->getConfigValue(0, "DEVELOPER_TOKEN"); } /** @@ -389,7 +225,31 @@ class ConfigService extends BaseAdminService * @param array $data * @return array */ - public function setDeveloperToken(array $data) { - return (new CoreConfigService())->setConfig(0, "DEVELOPER_TOKEN", $data); + public function setDeveloperToken(array $data) + { + return ( new CoreConfigService() )->setConfig(0, "DEVELOPER_TOKEN", $data); } + + /** + * 获取开发者key + * @return array + */ + public function getLayout() + { + return ( new CoreConfigService() )->getConfigValue(0, "LAYOUT_SETTING"); + } + + /** + * 设置开发者key + * @param array $data + * @return array + */ + public function setLayout(array $data) + { + $config_service = new CoreConfigService(); + $config = $config_service->getConfigValue(0, "LAYOUT_SETTING"); + $config[ $data[ 'key' ] ] = $data[ 'value' ]; + return ( new CoreConfigService() )->setConfig(0, "LAYOUT_SETTING", $config); + } + } diff --git a/niucloud/app/service/admin/sys/ExportService.php b/niucloud/app/service/admin/sys/ExportService.php new file mode 100644 index 000000000..4aaed35e0 --- /dev/null +++ b/niucloud/app/service/admin/sys/ExportService.php @@ -0,0 +1,98 @@ +model = new SysExport(); + } + + /** + * 报表导出列表 + * @param array $where + * @return array + */ + public function getPage(array $where = []) + { + $field = 'id, export_key, export_num, file_path, file_size, export_status, create_time'; + $search_model = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['export_key', 'export_status', 'create_time'],$where)->append(['export_key_name', 'export_status_name'])->field($field)->order('id desc'); + return $this->pageQuery($search_model); + } + + /** + * 获取导出数据类型列表 + * @param string $type + */ + public function getExportDataType() + { + return (new CoreExportService())->getExportDataType(); + } + + /** + * 检查导出数据源是否为空 + * @param string $type + * @param array $where + * @return bool + */ + public function checkExportData(string $type, array $where) + { + $page = $this->request->params([ + ['page', 0], + ['limit', 0] + ]); + $data = (new CoreExportService())->getExportData($this->site_id, $type, $where, $page); + return count($data) > 0; + } + + /** + * 报表导出 + * @param string $type + * @param array $where + * @return bool + */ + public function exportData(string $type, array $where){ + $page = $this->request->params([ + ['page', 0], + ['limit', 0] + ]); + ExportJob::dispatch(['site_id' => $this->site_id, 'type' => $type, 'where' => $where, 'page' => $page]); + return true; + } + + /** + * 报表删除 + * @param int $id + * @return bool + */ + public function deleteExport(int $id) + { + $export = $this->model->where([['id', '=', $id], ['site_id', '=', $this->site_id]])->find(); + if (!empty($export->file_path)) (new CoreExportService())->deleteExportFile($export->file_path); + $res = $export->delete(); + return $res; + } +} diff --git a/niucloud/app/service/admin/sys/MenuService.php b/niucloud/app/service/admin/sys/MenuService.php index 2a7d3001b..83201de18 100644 --- a/niucloud/app/service/admin/sys/MenuService.php +++ b/niucloud/app/service/admin/sys/MenuService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -129,7 +129,7 @@ class MenuService extends BaseAdminService * @throws DbException * @throws ModelNotFoundException */ - public function getMenuListByMenuKeys(int $site_id, array $menu_keys, string $app_type, int $is_tree = 0, $addon = 'all') + public function getMenuListByMenuKeys(int $site_id, array $menu_keys, string $app_type, int $is_tree = 0, $addon = 'all', $is_button = 1) { sort($menu_keys); $cache_name = 'menu' . md5(implode("_", $menu_keys)) . $is_tree.$addon.$site_id; @@ -182,22 +182,9 @@ class MenuService extends BaseAdminService { $v['menu_name'] = $lang_menu_name; } - //首页加载 - if($v['menu_key'] == 'overview' && $v['app_type'] == 'site') - { - $view_path = (new ConfigService())->getSiteIndexConfig(); - $v['view_path'] = $view_path; - } - - if($v['menu_key'] == 'overview' && $v['app_type'] == 'admin') - { - $view_path = (new ConfigService())->getAdminIndexConfig(); - $v['view_path'] = $view_path; - } - } - return $is_tree ? $this->menuToTree($menu_list, 'menu_key', 'parent_key', 'children', 'auth', '', 1) : $menu_list; + return $is_tree ? $this->menuToTree($menu_list, 'menu_key', 'parent_key', 'children', 'auth', '', $is_button) : $menu_list; } @@ -230,19 +217,6 @@ class MenuService extends BaseAdminService { $v['menu_name'] = $lang_menu_name; } - //首页加载 - if($v['menu_key'] == 'overview' && $v['app_type'] == 'site') - { - $view_path = (new ConfigService())->getSiteIndexConfig(); - $v['view_path'] = $view_path; - } - - if($v['menu_key'] == 'overview' && $v['app_type'] == 'admin') - { - $view_path = (new ConfigService())->getAdminIndexConfig(); - $v['view_path'] = $view_path; - } - } return $is_tree ? $this->menuToTree($menu_list, 'menu_key', 'parent_key', 'children', 'auth', '', $is_button) : $menu_list; @@ -543,18 +517,6 @@ class MenuService extends BaseAdminService { $v['menu_name'] = $lang_menu_name; } - //首页加载 - if($v['menu_key'] == 'overview' && $v['app_type'] == 'site') - { - $view_path = (new ConfigService())->getSiteIndexConfig(); - $v['view_path'] = $view_path; - } - - if($v['menu_key'] == 'overview' && $v['app_type'] == 'admin') - { - $view_path = (new ConfigService())->getAdminIndexConfig(); - $v['view_path'] = $view_path; - } } return $is_tree ? $this->menuToTree($menu_list, 'menu_key', 'parent_key', 'children', 'auth', '', $is_button) : $menu_list; diff --git a/niucloud/app/service/admin/sys/PosterService.php b/niucloud/app/service/admin/sys/PosterService.php new file mode 100644 index 000000000..9783ce5fb --- /dev/null +++ b/niucloud/app/service/admin/sys/PosterService.php @@ -0,0 +1,241 @@ +model = new Poster(); + } + + /** + * 获取自定义海报分页列表 + * @param array $where + * @return array + * @throws DbException + */ + public function getPage(array $where = []) + { + $field = 'id, site_id, name, type, channel, value, status,is_default, create_time, update_time, addon'; + $order = "update_time desc"; + + $search_model = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ 'name', 'type' ], $where)->field($field)->order($order)->append([ 'type_name' ]); + return $this->pageQuery($search_model); + } + + /** + * 获取自定义海报列表 + * @param array $where + * @param string $field + * @return mixed + */ + public function getList(array $where = [], $field = 'id, site_id, name, type, channel, value, status,is_default, create_time, update_time, addon') + { + $order = "update_time desc"; + return $this->model->where([ [ 'site_id', "=", $this->site_id ] ])->withSearch([ "name", 'type' ], $where)->field($field)->order($order)->select()->toArray(); + } + + /** + * 获取自定义海报信息 + * @param int $id + * @param string $field + * @return mixed + */ + public function getInfo(int $id, $field = 'id, site_id, name, type, channel, value, status,is_default, create_time, update_time, addon') + { + return $this->model->field($field)->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->findOrEmpty()->toArray(); + } + + /** + * 添加自定义海报 + * @param array $data + * @return mixed + */ + public function add(array $data) + { + $data[ 'site_id' ] = $this->site_id; + $res = $this->model->create($data); + return $res->id; + } + + /** + * 编辑自定义海报 + * @param int $id + * @param array $data + * @return bool + */ + public function edit(int $id, array $data) + { + $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->update($data); + return true; + } + + /** + * 删除自定义海报 + * @param int $id + * @return bool + */ + public function del(int $id) + { + return $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->delete(); + } + + /** + * 修改自定义海报启用状态 + * @param $data + * @return mixed + */ + public function modifyStatus($data) + { + return $this->model->where([ + [ 'id', '=', $data[ 'id' ] ], + [ 'site_id', '=', $this->site_id ] + ])->update([ 'status' => $data[ 'status' ] ]); + } + + /** + * 将自定义海报修改为默认海报 + * @param $data + * @return mixed + */ + public function modifyDefault($data) + { + try { + $info = $this->getInfo($data[ 'id' ]); + if (empty($info)) { + return false; + } + Db::startTrans(); + $this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'type', '=', $info[ 'type' ] ] ])->update([ 'is_default' => 0 ]); + $this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'id', '=', $data[ 'id' ] ] ])->update([ 'is_default' => 1, 'update_time' => time() ]); + Db::commit(); + return true; + } catch (Exception $e) { + Db::rollback(); + throw new AdminException($e->getMessage()); + } + } + + /** + * 查询海报类型 + * @param string $type + * @return array + */ + public function getType($type = '') + { + return ( new CorePosterService() )->getType($type); + } + + /** + * 查询海报模板 + * @param string $addon + * @param string $type + * @return array|null + */ + public function getTemplateList($addon = '', $type = '') + { + return ( new CorePosterService() )->getTemplateList($addon, $type); + } + + /** + * 获取组件列表 + * @param array $params 查询指定条件的海报组件 + * @return array + */ + public function getComponentList($params = []) + { + $data = ComponentDict::getComponent(); + foreach ($data as $k => $v) { + + // 该分组下若没有组件则清空 + if (empty($v[ 'list' ])) { + unset($data[ $k ]); + continue; + } + + // 查询组件支持的页面 + if (!empty($v[ 'support' ])) { + if ($params[ 'type' ] != $k && !empty($params[ 'type' ]) && !empty($v[ 'support' ]) && !in_array($params[ 'type' ], $v[ 'support' ])) { + unset($data[ $k ]); + continue; + } + } + + $sort_arr = []; + foreach ($v[ 'list' ] as $ck => $cv) { + $sort_arr[] = $cv[ 'sort' ]; + unset($data[ $k ][ 'list' ][ $ck ][ 'sort' ]); + } + + array_multisort($sort_arr, SORT_ASC, $data[ $k ][ 'list' ]); //排序,根据 sort 排序 + } + + return $data; + } + + /** + * 页面加载初始化 + * @param array $params + * @return array + * @throws DbException + */ + public function getInit(array $params = []) + { + $data = [ + 'id' => 0, + 'name' => $params[ 'name' ], + 'type' => $params[ 'type' ], + 'channel' => '', + 'value' => '', + 'status' => 1, + 'is_default' => 0, + 'addon' => '' + ]; + + if (!empty($params[ 'id' ])) { + $field = 'id, name, type, channel, value, status,is_default, addon'; + $info = $this->getInfo($params[ 'id' ], $field); + if (!empty($info)) { + $data = $info; + } + } + + $data[ 'poster_type' ] = ( new CorePosterService() )->getType($data[ 'type' ]); + + if (empty($data[ 'addon' ])) { + $data[ 'addon' ] = $data[ 'poster_type' ][ 'addon' ]; + } + + $data[ 'component' ] = $this->getComponentList([ 'type' => $data[ 'type' ] ]); + + return $data; + } + +} \ 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 5be42ccc8..b09ae5801 100644 --- a/niucloud/app/service/admin/sys/RoleService.php +++ b/niucloud/app/service/admin/sys/RoleService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/sys/SystemService.php b/niucloud/app/service/admin/sys/SystemService.php index 53a0f43c7..d8723661c 100644 --- a/niucloud/app/service/admin/sys/SystemService.php +++ b/niucloud/app/service/admin/sys/SystemService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/upgrade/BackupService.php b/niucloud/app/service/admin/upgrade/BackupService.php index cd1f2feef..5417f9217 100644 --- a/niucloud/app/service/admin/upgrade/BackupService.php +++ b/niucloud/app/service/admin/upgrade/BackupService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -12,7 +12,9 @@ namespace app\service\admin\upgrade; use app\dict\addon\AddonDict; +use app\service\admin\generator\GenerateService; use core\util\DbBackup; +use core\util\niucloud\BaseNiucloudClient; /** * 框架及插件升级备份 @@ -80,19 +82,27 @@ class BackupService extends UpgradeService 'level' => 9 //数据库备份文件压缩级别 1普通 4 一般 9最高 ]); + $tables = []; $prefix = config('database.connections.'.config('database.default'))['prefix']; if ($this->upgrade_task['upgrade']['app_key'] == AddonDict::FRAMEWORK_KEY) { // 不需要备份的表 $noot_need_backup = ["{$prefix}sys_user_log", "{$prefix}jobs", "{$prefix}jobs_failed"]; - $tables = array_diff(array_column($db->dataList(), 'name'), $noot_need_backup); - } else { - $tables = []; - $table_prefix = "{$prefix}{$this->upgrade_task['upgrade']['app_key']}"; - foreach ($db->dataList() as $table) { - if (strpos($table['name'], $table_prefix) === 0) { - $tables[] = $table['name']; + $sys_models = (new GenerateService())->getModels(['addon' => 'system']); + foreach ($sys_models as $model) { + $name = "\\$model"; + $class = new $name(); + + if (!in_array($class->getTable(), $noot_need_backup)) { + $tables[] = $class->getTable(); } } + } else { + $addon_models = (new GenerateService())->getModels(['addon' => $this->upgrade_task['upgrade']['app_key']]); + foreach ($addon_models as $model) { + $name = "\\$model"; + $class = new $name(); + $tables[] = $class->getTable(); + } } foreach ($tables as $table) { diff --git a/niucloud/app/service/admin/upgrade/ExecuteSqlTrait.php b/niucloud/app/service/admin/upgrade/ExecuteSqlTrait.php index e99c23c25..d39c1795a 100644 --- a/niucloud/app/service/admin/upgrade/ExecuteSqlTrait.php +++ b/niucloud/app/service/admin/upgrade/ExecuteSqlTrait.php @@ -55,6 +55,8 @@ trait ExecuteSqlTrait $match_item = preg_match('/DELETE FROM [`]?(\\w+)[`]?/is', $sql, $match_data); } elseif (str_contains($sql, 'UPDATE')) { $match_item = preg_match('/UPDATE [`]?(\\w+)[`]?/is', $sql, $match_data); + } elseif (str_contains($sql, 'DROP TABLE IF EXISTS')) { + $match_item = preg_match('/DROP TABLE IF EXISTS [`]?(\\w+)[`]?/is', $sql, $match_data); } elseif (str_contains($sql, 'DROP TABLE')) { $match_item = preg_match('/DROP TABLE [`]?(\\w+)[`]?/is', $sql, $match_data); } else { diff --git a/niucloud/app/service/admin/upgrade/RestoreService.php b/niucloud/app/service/admin/upgrade/RestoreService.php index 1900ef47e..5197c0bf7 100644 --- a/niucloud/app/service/admin/upgrade/RestoreService.php +++ b/niucloud/app/service/admin/upgrade/RestoreService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -49,6 +49,7 @@ class RestoreService extends UpgradeService ]); $file_list = $db->fileList(); if (!empty($file_list)) { + $db->setSqlMode(); foreach ($file_list as $file) { $db->setFile($file)->import(0, $file['time']); } diff --git a/niucloud/app/service/admin/upgrade/UpgradeService.php b/niucloud/app/service/admin/upgrade/UpgradeService.php index 1cf7fb12a..144663e23 100644 --- a/niucloud/app/service/admin/upgrade/UpgradeService.php +++ b/niucloud/app/service/admin/upgrade/UpgradeService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/upload/StorageConfigService.php b/niucloud/app/service/admin/upload/StorageConfigService.php index 9117f3bb4..7f400cd47 100644 --- a/niucloud/app/service/admin/upload/StorageConfigService.php +++ b/niucloud/app/service/admin/upload/StorageConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/upload/UploadConfigService.php b/niucloud/app/service/admin/upload/UploadConfigService.php index 5af2842f8..05db234fa 100644 --- a/niucloud/app/service/admin/upload/UploadConfigService.php +++ b/niucloud/app/service/admin/upload/UploadConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/upload/UploadService.php b/niucloud/app/service/admin/upload/UploadService.php index 2eddf29df..daa36537d 100644 --- a/niucloud/app/service/admin/upload/UploadService.php +++ b/niucloud/app/service/admin/upload/UploadService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/user/UserRoleService.php b/niucloud/app/service/admin/user/UserRoleService.php index 93605960a..827e9ddb7 100644 --- a/niucloud/app/service/admin/user/UserRoleService.php +++ b/niucloud/app/service/admin/user/UserRoleService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/user/UserService.php b/niucloud/app/service/admin/user/UserService.php index dceb442b7..2e1392979 100644 --- a/niucloud/app/service/admin/user/UserService.php +++ b/niucloud/app/service/admin/user/UserService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/verify/VerifierService.php b/niucloud/app/service/admin/verify/VerifierService.php new file mode 100644 index 000000000..6364e9933 --- /dev/null +++ b/niucloud/app/service/admin/verify/VerifierService.php @@ -0,0 +1,97 @@ +model = new Verifier(); + } + + /** + * 获取核销员表列表 + * @param array $where + * @return array + */ + public function getPage(array $where = []) + { + $search_model = $this->model->where([ ['site_id', '=', $this->site_id] ])->with(['member' => function($query){ + $query->field('member_id, nickname, mobile, headimg'); + }])->field('*')->order('create_time desc'); + return $this->pageQuery($search_model, function ($item, $key) { + $item = $this->makeUp($item); + }); + } + + /** + * 组合整理数据 + * @param $data + */ + public function makeUp($data){ + //核销类型 + if(!empty($data['verify_type'])){ + $type = VerifyDict::getType(); + $type_array = []; + foreach ($data['verify_type'] as $key => $value) { + if (array_key_exists($value, $type)) { + $type_array[$key]['verify_type'] = $value; + $type_array[$key]['verify_type_name'] = $type[$value]['name']; + } + } + $data['verify_type_array'] = $type_array; + } + return $data; + } + + /** + * 添加核销员 + * @param array $data + * @return mixed + */ + public function add(array $data) + { + $member = (new Member())->where([ ['site_id', '=', $this->site_id], ['member_id', '=', $data['member_id'] ] ])->findOrEmpty(); + if ($member->isEmpty()) throw new CommonException('MEMBER_NOT_EXIST'); + + $model = $this->model->where([ ['site_id', '=', $this->site_id], ['member_id', '=', $data['member_id'] ] ])->findOrEmpty(); + if (!$model->isEmpty()) return $model->id; + + $data['create_time'] = time(); + $data['site_id'] = $this->site_id; + $res = $this->model->create($data); + return $res->id; + } + + /** + * 删除核销员 + * @param int $id + * @return bool + */ + public function del(int $id) + { + $res = $this->model->where([['id', '=', $id], ['site_id', '=', $this->site_id]])->delete(); + return $res; + } +} diff --git a/niucloud/app/service/admin/verify/VerifyService.php b/niucloud/app/service/admin/verify/VerifyService.php new file mode 100644 index 000000000..655f8f03c --- /dev/null +++ b/niucloud/app/service/admin/verify/VerifyService.php @@ -0,0 +1,60 @@ +model = new Verify(); + } + + /** + * 获取核销记录列表 + * @param array $where + * @return array + * @throws \think\db\exception\DbException + */ + public function getPage(array $where = []) { + $search_model = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['code', 'type', 'create_time'], $where) + ->with(['member' => function($query){ + $query->field('member_id, nickname, mobile, headimg'); + }])->field('*')->order('create_time desc')->append(['type_name']); + $list = $this->pageQuery($search_model); + return $list; + } + + /** + * 获取核销信息 + * @param string $verify_code + * @return array + */ + public function getDetail(string $verify_code) { + return $this->model->where([ + ['site_id', '=', $this->site_id], + ['code', '=', $verify_code] + ])->field('*') + ->with(['member' => function($query){ + $query->field('member_id, nickname, mobile, headimg'); + }])->append(['type_name'])->findOrEmpty()->toArray(); + } + +} diff --git a/niucloud/app/service/admin/weapp/WeappConfigService.php b/niucloud/app/service/admin/weapp/WeappConfigService.php index f4b255231..8026d66f3 100644 --- a/niucloud/app/service/admin/weapp/WeappConfigService.php +++ b/niucloud/app/service/admin/weapp/WeappConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -55,7 +55,7 @@ class WeappConfigService extends BaseAdminService 'socket_url' => "wss://".request()->host(), 'upload_url' => $domain, 'download_url' => $domain, - 'upload_ip' => '8.140.96.55' + 'upload_ip' => gethostbyname('oss.niucloud.com') ]; } } diff --git a/niucloud/app/service/admin/weapp/WeappDeliveryService.php b/niucloud/app/service/admin/weapp/WeappDeliveryService.php new file mode 100644 index 000000000..6782ab350 --- /dev/null +++ b/niucloud/app/service/admin/weapp/WeappDeliveryService.php @@ -0,0 +1,50 @@ +site_id; + $core_notice_service = new CoreWeappDeliveryService(); + $result = $core_notice_service->isTradeManaged($site_id); + if ($result[ 'errcode' ] == 0 && $result[ 'is_trade_managed' ]) { + return true; + } + return false; + } + +} \ No newline at end of file diff --git a/niucloud/app/service/admin/weapp/WeappPackageService.php b/niucloud/app/service/admin/weapp/WeappPackageService.php index fb12c5eaf..dbc9a1721 100644 --- a/niucloud/app/service/admin/weapp/WeappPackageService.php +++ b/niucloud/app/service/admin/weapp/WeappPackageService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/weapp/WeappTemplateService.php b/niucloud/app/service/admin/weapp/WeappTemplateService.php index 67c09b017..e88846c6d 100644 --- a/niucloud/app/service/admin/weapp/WeappTemplateService.php +++ b/niucloud/app/service/admin/weapp/WeappTemplateService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -38,12 +38,17 @@ class WeappTemplateService extends BaseAdminService { $site_id = $this->site_id; $core_notice_service = new CoreNoticeService(); - $list = $core_notice_service->getList($site_id); - $template = []; - foreach ($list as $k => $v){ - if(in_array(NoticeTypeDict::WEAPP, $v['support_type'])) $template[] = $v; + $addon_list = $core_notice_service->getAddonList($site_id); + + foreach ($addon_list as &$addon) { + foreach ($addon['notice'] as $k => $v) { + if (!in_array(NoticeTypeDict::WEAPP, $v[ 'support_type' ])) { + unset($addon['notice'][$k]); + } + } + $addon['notice'] = array_values($addon['notice']); } - return $template; + return $addon_list; } /** @@ -87,7 +92,7 @@ class WeappTemplateService extends BaseAdminService // $res = (new CoreWeappTemplateService())->addTemplate($this->site_id, $tid, $kid_list, $scene_desc); $res = $template_loader->addTemplate(['tid' => $tid, 'kid_list' => $kid_list, 'scene_desc' => $scene_desc ]); $notice_service = new NoticeService(); - if (isset($res[ 'errcode' ]) && $res[ 'errcode' ] == 0) { + if (isset($res[ 'errcode' ]) && in_array($res[ 'errcode' ], [0, 200022])) { //修改 $notice_service->modify($key, 'weapp_template_id', $res[ 'priTmplId' ]); } else { @@ -96,4 +101,4 @@ class WeappTemplateService extends BaseAdminService return true; } -} \ No newline at end of file +} diff --git a/niucloud/app/service/admin/wechat/WechatConfigService.php b/niucloud/app/service/admin/wechat/WechatConfigService.php index 5cdf30dd4..e795260a6 100644 --- a/niucloud/app/service/admin/wechat/WechatConfigService.php +++ b/niucloud/app/service/admin/wechat/WechatConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/wechat/WechatEventService.php b/niucloud/app/service/admin/wechat/WechatEventService.php index 2e495eb52..107c9c247 100644 --- a/niucloud/app/service/admin/wechat/WechatEventService.php +++ b/niucloud/app/service/admin/wechat/WechatEventService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/wechat/WechatFansService.php b/niucloud/app/service/admin/wechat/WechatFansService.php index ef735f856..205fa1406 100644 --- a/niucloud/app/service/admin/wechat/WechatFansService.php +++ b/niucloud/app/service/admin/wechat/WechatFansService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/wechat/WechatMediaService.php b/niucloud/app/service/admin/wechat/WechatMediaService.php index 1e7994021..c988d5f39 100644 --- a/niucloud/app/service/admin/wechat/WechatMediaService.php +++ b/niucloud/app/service/admin/wechat/WechatMediaService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -71,11 +71,11 @@ class WechatMediaService extends BaseAdminService public function addVideoMedia(array $data) { $dir = $this->root_path.'/'.'video'.'/'.$this->site_id.'/'.date('Ym').'/'.date('d'); $core_upload_service = new CoreUploadService(); - $upload_res = $core_upload_service->video($data['file'], $this->site_id, $dir, storage_type: StorageDict::LOCAL); + $upload_res = $core_upload_service->video($data['file'], $this->site_id, $dir, 0, storage_type: StorageDict::LOCAL); $data = [ 'site_id' => $this->site_id, - 'type' => WechatMediaDict::IMAGE, + 'type' => WechatMediaDict::VIDEO, 'file_path' => $upload_res['url'] ]; return (new CoreWechatMediaService())->addMedia($data); diff --git a/niucloud/app/service/admin/wechat/WechatMenuService.php b/niucloud/app/service/admin/wechat/WechatMenuService.php index 342da6f15..0160fca4b 100644 --- a/niucloud/app/service/admin/wechat/WechatMenuService.php +++ b/niucloud/app/service/admin/wechat/WechatMenuService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/wechat/WechatReplyService.php b/niucloud/app/service/admin/wechat/WechatReplyService.php index 59c24fbed..7945de3bc 100644 --- a/niucloud/app/service/admin/wechat/WechatReplyService.php +++ b/niucloud/app/service/admin/wechat/WechatReplyService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/admin/wechat/WechatTemplateService.php b/niucloud/app/service/admin/wechat/WechatTemplateService.php index 1a4bfee42..eca1d3b42 100644 --- a/niucloud/app/service/admin/wechat/WechatTemplateService.php +++ b/niucloud/app/service/admin/wechat/WechatTemplateService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -88,12 +88,17 @@ class WechatTemplateService extends BaseAdminService { $site_id = $this->site_id; $core_notice_service = new CoreNoticeService(); - $list = $core_notice_service->getList($site_id); - $template = []; - foreach ($list as $k => $v) { - if (in_array(NoticeTypeDict::WECHAT, $v[ 'support_type' ])) $template[] = $v; + $addon_list = $core_notice_service->getAddonList($site_id); + + foreach ($addon_list as &$addon) { + foreach ($addon['notice'] as $k => $v) { + if (!in_array(NoticeTypeDict::WECHAT, $v[ 'support_type' ])) { + unset($addon['notice'][$k]); + } + } + $addon['notice'] = array_values($addon['notice']); } - return $template; + return $addon_list; } -} \ No newline at end of file +} diff --git a/niucloud/app/service/api/addon/AddonService.php b/niucloud/app/service/api/addon/AddonService.php new file mode 100644 index 000000000..f74c2235a --- /dev/null +++ b/niucloud/app/service/api/addon/AddonService.php @@ -0,0 +1,33 @@ +getInstallAddonList(); + } + +} \ No newline at end of file diff --git a/niucloud/app/service/api/agreement/AgreementService.php b/niucloud/app/service/api/agreement/AgreementService.php index c04c1217f..d91201b98 100644 --- a/niucloud/app/service/api/agreement/AgreementService.php +++ b/niucloud/app/service/api/agreement/AgreementService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/captcha/CaptchaService.php b/niucloud/app/service/api/captcha/CaptchaService.php index 8c211846a..b6e3c44be 100644 --- a/niucloud/app/service/api/captcha/CaptchaService.php +++ b/niucloud/app/service/api/captcha/CaptchaService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/diy/DiyConfigService.php b/niucloud/app/service/api/diy/DiyConfigService.php index a9013c532..cfc97a330 100644 --- a/niucloud/app/service/api/diy/DiyConfigService.php +++ b/niucloud/app/service/api/diy/DiyConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/diy/DiyRouteService.php b/niucloud/app/service/api/diy/DiyRouteService.php index e60a7edc7..cda8eedc9 100644 --- a/niucloud/app/service/api/diy/DiyRouteService.php +++ b/niucloud/app/service/api/diy/DiyRouteService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/diy/DiyService.php b/niucloud/app/service/api/diy/DiyService.php index d5f96357a..1e640b14f 100644 --- a/niucloud/app/service/api/diy/DiyService.php +++ b/niucloud/app/service/api/diy/DiyService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -52,7 +52,7 @@ class DiyService extends BaseApiService } } - if (!empty($start_up_page) && !empty($page_template) && !empty($start_up_page[ 'page' ]) && $start_up_page[ 'page' ] != $page_template[ 'page' ]) { + if (empty($params[ 'id' ]) && empty($params[ 'name' ]) && !empty($start_up_page) && !empty($page_template) && !empty($start_up_page[ 'page' ]) && $start_up_page[ 'page' ] != $page_template[ 'page' ]) { $info = $start_up_page; return $info; } else { diff --git a/niucloud/app/service/api/login/AuthService.php b/niucloud/app/service/api/login/AuthService.php index 72628e01d..b940bd345 100644 --- a/niucloud/app/service/api/login/AuthService.php +++ b/niucloud/app/service/api/login/AuthService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/login/LoginService.php b/niucloud/app/service/api/login/LoginService.php index 2e4058a7a..7bb1e6305 100644 --- a/niucloud/app/service/api/login/LoginService.php +++ b/niucloud/app/service/api/login/LoginService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/login/RegisterService.php b/niucloud/app/service/api/login/RegisterService.php index 78d6ac0ce..d280d70cd 100644 --- a/niucloud/app/service/api/login/RegisterService.php +++ b/niucloud/app/service/api/login/RegisterService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/member/MemberAccountService.php b/niucloud/app/service/api/member/MemberAccountService.php index 9c01ad346..7b6e61b5b 100644 --- a/niucloud/app/service/api/member/MemberAccountService.php +++ b/niucloud/app/service/api/member/MemberAccountService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/member/MemberCashOutAccountService.php b/niucloud/app/service/api/member/MemberCashOutAccountService.php index 36ec0f203..a0f5db700 100644 --- a/niucloud/app/service/api/member/MemberCashOutAccountService.php +++ b/niucloud/app/service/api/member/MemberCashOutAccountService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/member/MemberCashOutService.php b/niucloud/app/service/api/member/MemberCashOutService.php index f7cf0ee20..7c2e074cc 100644 --- a/niucloud/app/service/api/member/MemberCashOutService.php +++ b/niucloud/app/service/api/member/MemberCashOutService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/member/MemberConfigService.php b/niucloud/app/service/api/member/MemberConfigService.php index 24026a02e..33a290ba4 100644 --- a/niucloud/app/service/api/member/MemberConfigService.php +++ b/niucloud/app/service/api/member/MemberConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/member/MemberLevelService.php b/niucloud/app/service/api/member/MemberLevelService.php new file mode 100644 index 000000000..706816b1d --- /dev/null +++ b/niucloud/app/service/api/member/MemberLevelService.php @@ -0,0 +1,66 @@ +where([ ['site_id', '=', $this->site_id] ])->field('level_id,site_id,level_name,growth,remark,level_benefits,level_gifts')->order('growth asc')->select()->toArray(); + if (!empty($list)) { + foreach ($list as $k => $item) { + if (!empty($item['level_benefits'])) $list[$k]['level_benefits'] = array_filter(array_map(function ($item){ + if ($item['content']) return $item; + }, CoreMemberService::getBenefitsContent($item['site_id'], $item['level_benefits'], 'member_level'))); + if (!empty($item['level_gifts'])) $list[$k]['level_gifts'] = CoreMemberService::getGiftContent($item['site_id'], $item['level_gifts'], 'member_level'); + + $filling = [ + 'benefits_one' => [ 'title' => "专属客服", 'desc' => '专业服务', 'icon' => '/static/resource/images/member/benefits/benefits_kefu.png' ], + 'benefits_two' => [ 'title' => "专属徽章", 'desc' => '专属徽章', 'icon' => '/static/resource/images/member/benefits/benefits_badge.png' ], + 'benefits_four' => [ 'title' => "经验累计", 'desc' => '经验累计', 'icon' => '/static/resource/images/member/benefits/benefits_experience.png' ], + 'benefits_three' => [ 'title' => "尊享客服", 'desc' => '尊享客服', 'icon' => '/static/resource/images/member/benefits/benefits_badge.png' ], + ]; + + $length = empty($item['level_benefits']) ? 0 : count($item['level_benefits']); + if ($length < 4) { + foreach ($filling as $key => $content) { + if (count($list[$k]['level_benefits']) == 4) break; + $list[$k]['level_benefits'][$key] = [ + 'content' => $content + ]; + } + } + + $list[$k]['level_bg'] = '/static/resource/images/member/level/bg_'. ($k % 8 + 1) .'.png'; + } + } + return $list; + } + +} diff --git a/niucloud/app/service/api/member/MemberLogService.php b/niucloud/app/service/api/member/MemberLogService.php index 87b3fedc0..8683dfa1f 100644 --- a/niucloud/app/service/api/member/MemberLogService.php +++ b/niucloud/app/service/api/member/MemberLogService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/member/MemberService.php b/niucloud/app/service/api/member/MemberService.php index f45dfea4c..4af435cd4 100644 --- a/niucloud/app/service/api/member/MemberService.php +++ b/niucloud/app/service/api/member/MemberService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -63,7 +63,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)->append(['sex_name'])->findOrEmpty()->toArray(); + return $this->model->where([['member_id', '=', $this->member_id]])->with(['member_level_name_bind'])->field($field)->append(['sex_name'])->findOrEmpty()->toArray(); } /** @@ -96,7 +96,9 @@ class MemberService extends BaseApiService //微信小程序openid if(!empty($data['weapp_openid'])) $where[] = ['weapp_openid', '=', $data['weapp_openid']]; - + // 微信unionid + if(!empty($data['wx_unionid'])) + $where[] = ['wx_unionid', '=', $data['wx_unionid']]; if(!empty($data['username|mobile'])) $where[] = ['username|mobile', '=', $data['username|mobile']]; if(empty($where)){ @@ -143,4 +145,4 @@ class MemberService extends BaseApiService $detail['verify_code_barcode'] = image_to_base64($barcode_path); return $detail; } -} \ No newline at end of file +} diff --git a/niucloud/app/service/api/member/MemberSignService.php b/niucloud/app/service/api/member/MemberSignService.php new file mode 100644 index 000000000..552c8d318 --- /dev/null +++ b/niucloud/app/service/api/member/MemberSignService.php @@ -0,0 +1,489 @@ +model = new MemberSign(); + } + + /** + * 会员签到记录 + * @param array $where + * @return array + */ + public function getPage(array $where = []) + { + $where['member_id'] = $this->member_id; + $where['site_id'] = $this->site_id; + $field = 'sign_id, site_id, member_id, days, day_award, continue_award, continue_tag, create_time, is_sign'; + $search_model = $this->model->where($where)->field($field)->append(['is_sign_name'])->order('create_time desc'); + return $this->pageQuery($search_model); + } + + /** + * 会员签到详情 + * @param int $sign_id + * @return array + */ + public function getInfo(int $sign_id) + { + $field = 'sign_id, site_id, member_id, days, day_award, continue_award, continue_tag, create_time, is_sign'; + return $this->model->where([['sign_id', '=', $sign_id], ['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id]])->field($field)->append(['is_sign_name'])->findOrEmpty()->toArray(); + } + + /** + * 签到 + * @return array + */ + public function sign() + { + + $sign_config = $this->getSign(); + if (!$sign_config['is_use']) throw new CommonException('SIGN_NOT_USE'); + if (empty($sign_config['sign_period']) || empty($sign_config['day_award'])) throw new CommonException('SIGN_NOT_SET'); + $sign_period = $sign_config['sign_period'];//签到周期 + $today = $this->model->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id]])->whereDay('create_time')->findOrEmpty()->toArray(); + if (!empty($today)) throw new CommonException('SIGNED_TODAY'); + Db::startTrans(); + + try { + $yesterday = $this->model->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id]])->whereDay('create_time', 'yesterday')->findOrEmpty()->toArray(); + if ($yesterday) { + $days = $yesterday['days']; + $days++; + if ($days > $sign_period) { //连签天数大于签到周期,连签天数重置为1 + $days = 1; + $data['start_time'] = time(); + } + if (!empty($sign_config['continue_award'])) { + $continue_signs = array_column($sign_config['continue_award'], 'continue_sign'); + //获取连签奖励最大天数 + $max_continue_sign = max($continue_signs); + if ($max_continue_sign < $sign_period && $days > $max_continue_sign) { //连签奖励最大天数 小于 签到周期 并且 连签天数 大于 连签奖励最大天数 连签天数重置为1 + $days = 1; + } + } + } else { //断签,连签天数重置为1 + $days = 1; + $data['start_time'] = time(); + } + + $awards = []; //奖励数组 + $continue_text = ''; //连签提示 + + //添加签到记录 + $data['site_id'] = $this->site_id; + $data['member_id'] = $this->member_id; + $data['days'] = $days; + $data['day_award'] = $sign_config['day_award']; + $data['is_sign'] = 1; + $data['create_time'] = time(); + $res = $this->model->create($data); + if ($res) { + //日签奖励发放 + $param = [ + 'from_type' => 'day_sign_award', + 'memo' => '日签奖励' + ]; + (new CoreMemberService())->memberGiftGrant($this->site_id, $this->member_id, $sign_config['day_award'], $param); + $awards['day_award'] = $sign_config['day_award']; + + //签到成功后判断连签天数是否满足连签奖励发放条件 + if (!empty($sign_config['continue_award'])) { + $param = [ + 'from_type' => 'continue_sign_award', + 'memo' => '连签奖励' + ]; + foreach ($sign_config['continue_award'] as $key => $value) { + $continue_sign = intval($value['continue_sign']);//连续签到天数要求 + //如果连签天数满足配置条件,发放连签奖励 + if ($res->days == $continue_sign) { + $gifts = $value; + unset($gifts['continue_sign'], $gifts['continue_tag'], $gifts['receive_limit'], $gifts['receive_num']); + + $continue_data['continue_award'] = $value; + $continue_data['continue_tag'] = $value['continue_tag'];//连签奖励标识 + if ($value['receive_limit'] == 2) {//receive_limit (1.不限制 2.每人限领 receive_num 次) + //周期开始时间 + $period_start_time = $this->model->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id], ['days', '=', 1], ['start_time', '>', 0]])->order('sign_id desc')->field('start_time')->limit(1)->value('start_time'); + //周期结束时间 + $period_end_time = strtotime("+$sign_period day", $period_start_time); + //查询领取次数 + $receive_count = $this->model + ->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id], ['continue_tag', '=', $value['continue_tag']]]) + ->whereBetweenTime('create_time', $period_start_time, $period_end_time)->count('sign_id'); + if ($receive_count < $value['receive_num']) { + //连签奖励发放 + (new CoreMemberService())->memberGiftGrant($this->site_id, $this->member_id, $gifts, $param); + $awards['continue_award'] = $gifts; + $continue_text = get_lang('CONTINUE_SIGN').$res->days.get_lang('DAYS'); + //更新连签发放记录 + $this->model->where([['sign_id', '=', $res->sign_id]])->update($continue_data); + } + } else { //不限制 + //连签奖励发放 + (new CoreMemberService())->memberGiftGrant($this->site_id, $this->member_id, $gifts, $param); + $awards['continue_award'] = $gifts; + $continue_text = get_lang('CONTINUE_SIGN').$res->days.get_lang('DAYS'); + //更新连签发放记录 + $this->model->where([['sign_id', '=', $res->sign_id]])->update($continue_data); + } + } + } + } + } + Db::commit(); + $awards_total = $this->getTotalAward($awards); + $result['title'] = get_lang('SIGN_SUCCESS'); + $result['info'] = $continue_text.get_lang('GET_AWARD'); + $result['awards'] = $awards_total; + return $result; + } catch (DbException $e) { + Db::rollback(); + throw new CommonException($e->getMessage()); + } + + } + + /** + * 获取月签到数据 + * @param int $year + * @param int $month + * @return array + */ + public function getSignInfo(int $year, int $month) + { + $data = []; + $info = $this->getSign(); + if ($info['is_use'] == 1) {//判断签到是否开启 + $model_result = $this->model->field('create_time')->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id]])->whereMonth('create_time', $year . '-' . sprintf("%02d", $month))->select(); + $days = []; + foreach ($model_result as $key => $value) { + $day = date('d', strtotime($value['create_time'])); + array_push($days, $day); + } + $data['days'] = $days; + if (!empty($info['sign_period']) && !empty($info['continue_award'])) {//判断签到周期和连签奖励是否设置 + $sign_period = $info['sign_period'];//签到周期 + + $continue_signs = array_column($info['continue_award'], 'continue_sign'); + //获取连签奖励最大天数 + $max_continue_sign = max($continue_signs); + //周期开始时间 + $period_start_time = $this->model->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id], ['days', '=', 1], ['start_time', '>', 0]])->order('sign_id desc')->field('start_time')->limit(1)->value('start_time'); + if (!empty($period_start_time)) { + //周期结束时间 + $period_end_time = strtotime("+$sign_period day", $period_start_time); + //获取两个时间戳之间的天数组 + $days_array = $this->getDaysArray($period_start_time, $period_end_time); + foreach ($days_array as $key => $value) { + $day = $key + 1; + foreach ($info['continue_award'] as $k => $v) { + if ($v['receive_limit'] == 1) {//不限制次数奖励添加 + $period_num = intdiv($sign_period, $max_continue_sign);//周期内可循环轮次 + for ($i = 0; $i < $period_num; $i++) { + if ($max_continue_sign * $i + $v['continue_sign'] == $day) { + $data['period'][$key]['award'] = true; + } + } + } else {//限制次数奖励添加 + for ($i = 0; $i < $v['receive_num']; $i++) { + if ($max_continue_sign * $i + $v['continue_sign'] == $day) { + $data['period'][$key]['award'] = true; + } + } + } + } + $data['period'][$key]['day'] = $value; + } + } else { + $data['period'] = []; + } + } else { + $data['period'] = []; + } + } + return $data; + } + + /** + * 获取日签到奖励 + * @param int $year + * @param int $month + * @param int $day + * @return array + */ + public function getDayAward(int $year, int $month, int $day) + { + $max_continue_sign = 1;//连签奖励最大天数 + + $time = $year.'-'.sprintf("%02d", $month).'-'.sprintf("%02d", $day); + $info = $this->getSign(); + if (!$info['is_use']) throw new CommonException('SIGN_NOT_USE'); + if (empty($info['sign_period']) || empty($info['day_award'])) throw new CommonException('SIGN_NOT_SET'); + $sign_period = $info['sign_period'];//签到周期 + if (!empty($info['continue_award'])) { + $continue_signs = array_column($info['continue_award'], 'continue_sign'); + //获取连签奖励最大天数 + $max_continue_sign = max($continue_signs); + } + //周期开始时间 + $period_start_time = $this->model->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id], ['days', '=', 1], ['start_time', '>', 0]])->order('sign_id desc')->field('start_time')->limit(1)->value('start_time'); + //周期结束时间 + $period_end_time = strtotime("+$sign_period day", $period_start_time); + //获取两个时间戳之间的天数组 + $days_array = $this->getDaysArray($period_start_time, $period_end_time); + $award = [];//当日奖励 + //判断查询日期是否在签到周期内 + if (in_array($time, $days_array)) { + foreach ($days_array as $key => $value) { + if ($value == $time) { + $award['day_award'] = $info['day_award']; + + if (!empty($info['continue_award'])) { + $day = $key + 1; + foreach ($info['continue_award'] as $k => $v) { + $gift = $v; + unset($gift['continue_sign'], $gift['continue_tag'], $gift['receive_limit'], $gift['receive_num']); + if ($v['receive_limit'] == 1) {//不限制次数奖励添加 + $period_num = intdiv($sign_period, $max_continue_sign);//周期内可循环轮次 + for ($i = 0; $i < $period_num; $i++) { + if ($max_continue_sign * $i + $v['continue_sign'] == $day) { + $award['continue_award'] = $gift; + } + } + } else {//限制次数奖励添加 + for ($i = 0; $i < $v['receive_num']; $i++) { + if ($max_continue_sign * $i + $v['continue_sign'] == $day) { + $award['continue_award'] = $gift; + } + } + } + } + } + + } + } + } else { + $day_result = $this->model->field('create_time')->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id]])->whereDay('create_time', $time)->findOrEmpty()->toArray(); + if (!empty($day_result)) { + $award['day_award'] = $day_result['day_award']; + $continue_award = $day_result['continue_award']; + if (!empty($continue_award)) { + unset($continue_award['continue_sign'], $continue_award['continue_tag'], $continue_award['receive_limit'], $continue_award['receive_num']); + $award['continue_award'] = $continue_award; + } + } + } + $awards_total = $this->getTotalAward($award); + return $awards_total; + } + + /** + * 获取合并奖励数据 + * @param $awards + * @return array|null + */ + private function getTotalAward($awards) + { + $total_point = 0; + $total_balance = 0; + $coupon_id = []; + $coupon_list = []; + + $is_use_point_day = false; + $is_use_point_continue = false; + + $is_use_balance_day = false; + $is_use_balance_continue = false; + + $is_use_coupon_day = false; + $is_use_coupon_continue = false; + + if (!empty($awards['day_award']['point'])) { + if ($awards['day_award']['point']['is_use'] == 1) { + $is_use_point_day = true; + $total_point += intval($awards['day_award']['point']['num']); + } + } + if (!empty($awards['day_award']['balance'])) { + if ($awards['day_award']['balance']['is_use'] == 1) { + $is_use_balance_day = true; + $total_balance += floatval($awards['day_award']['balance']['money']); + } + } + if (!empty($awards['day_award']['shop_coupon'])) { + if ($awards['day_award']['shop_coupon']['is_use'] == 1) { + $is_use_coupon_day = true; + $coupon_id = array_merge($coupon_id, $awards['day_award']['shop_coupon']['coupon_id']); + $coupon_list = $this->getArrayMerge($coupon_list, $awards['day_award']['shop_coupon']['coupon_list']); + } + } + if (!empty($awards['continue_award'])) { + if (!empty($awards['continue_award']['point'])) { + if ($awards['continue_award']['point']['is_use'] == 1) { + $is_use_point_continue = true; + $total_point += intval($awards['continue_award']['point']['num']); + } + } + if (!empty($awards['continue_award']['balance'])) { + if ($awards['continue_award']['balance']['is_use'] == 1) { + $is_use_balance_continue = true; + $total_balance += floatval($awards['continue_award']['balance']['money']); + } + } + if (!empty($awards['continue_award']['shop_coupon'])) { + if ($awards['continue_award']['shop_coupon']['is_use'] == 1) { + $is_use_coupon_continue = true; + $coupon_id = array_merge($coupon_id, $awards['continue_award']['shop_coupon']['coupon_id']); + $coupon_list = $this->getArrayMerge($coupon_list, $awards['continue_award']['shop_coupon']['coupon_list']); + } + } + } + $coupon_id = array_unique($coupon_id); + $is_use_point = ($is_use_point_day || $is_use_point_continue) ? 1 : 0; + $is_use_balance = ($is_use_balance_day || $is_use_balance_continue) ? 1 : 0; + $is_use_coupon = ($is_use_coupon_day || $is_use_coupon_continue) ? 1 : 0; + //相同奖励合并 + $awards_total = [ + 'point' => [ + 'is_use' => $is_use_point, + 'num' => $total_point, + ], + 'balance' => [ + 'is_use' => $is_use_balance, + 'money' => $total_balance, + ], + 'shop_coupon' => [ + 'is_use' => $is_use_coupon, + 'coupon_id' => $coupon_id, + 'coupon_list' => $coupon_list, + ] + ]; + return (new CoreMemberService())->getGiftContent($this->site_id, $awards_total); + } + + /** + * 获取用户签到设置 + * @return array + */ + public function getSignConfig() + { + $info = $this->getSign(); + $today = $this->model->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id]])->whereDay('create_time')->findOrEmpty()->toArray(); + $yesterday = $this->model->where([['site_id', '=', $this->site_id], ['member_id', '=', $this->member_id]])->whereDay('create_time', 'yesterday')->findOrEmpty()->toArray(); + if (!empty($info['day_award'])) { + $day_award = (new CoreMemberService())->getGiftContent($this->site_id, $info['day_award']); + $info['day_award'] = $day_award; + } + if (!empty($info['continue_award'])) { + foreach ($info['continue_award'] as $key => $value) { + $gift = $value; + unset($gift['continue_sign'], $gift['continue_tag'], $gift['receive_limit'], $gift['receive_num']); + $continue_award = (new CoreMemberService())->getGiftContent($this->site_id, $gift); + $continue_award['continue_sign'] = $value['continue_sign']; + $info['continue_award'][$key] = $continue_award; + } + } + $info['is_sign'] = empty($today) ? false : true;//是否签到 + if (empty($today)) { + $info['days'] = empty($yesterday) ? 0 : $yesterday['days'];//连签天数 + } else { + $info['days'] = $today['days'];//连签天数 + } + return $info; + } + + /** + * 获取站点签到设置 + */ + public function getSign() + { + $info = ( new CoreConfigService() )->getConfig($this->site_id, 'SIGN_CONFIG'); + if (empty($info)) { + $info = []; + $info[ 'value' ] = [ + 'is_use' => 0, + 'sign_period' => '', + 'day_award' => '', + 'continue_award' => [], + 'rule_explain' => '' + ]; + } + return $info[ 'value' ]; + } + + /** + * 获取两个时间戳之间的天数组 + * @param $start_timestamp + * @param $end_timestamp + * @return array + */ + private function getDaysArray($start_timestamp, $end_timestamp) { + $start = new DateTime("@$start_timestamp"); // 使用时间戳创建DateTime对象 + $end = new DateTime("@$end_timestamp"); // 同上 + $interval = new DateInterval('P1D'); // 每天的周期 + $period = new DatePeriod($start, $interval, $end); // 创建周期范围 + + $days_array = []; + foreach ($period as $day) { + $days_array[] = $day->format('Y-m-d'); // 格式化日期并添加到数组 + } + return $days_array; + } + + /** + * 合并数据,如果键值相等其值相加 + * @param $desc + * @param $json_wares + * @return array|false + */ + private static function getArrayMerge($desc, $json_wares) + { + if (is_array($desc) && is_array($json_wares)) { + $arrayMerge = array(); + foreach ($json_wares as $key=>$value) { + if (array_key_exists($key, $desc)) { + $arrayMerge[$key] = $value + $desc[$key]; + unset($desc[$key]); + } else { + $arrayMerge[$key] = $value; + } + } + return $arrayMerge+$desc; + } else { + return false; + } + } + +} \ No newline at end of file diff --git a/niucloud/app/service/api/notice/NoticeService.php b/niucloud/app/service/api/notice/NoticeService.php index 153d38a4c..0efdd9a0f 100644 --- a/niucloud/app/service/api/notice/NoticeService.php +++ b/niucloud/app/service/api/notice/NoticeService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/pay/PayService.php b/niucloud/app/service/api/pay/PayService.php index 6aa058813..aa7336cec 100644 --- a/niucloud/app/service/api/pay/PayService.php +++ b/niucloud/app/service/api/pay/PayService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/scan/ScanService.php b/niucloud/app/service/api/scan/ScanService.php index 93dfdbc99..c54fb0d80 100644 --- a/niucloud/app/service/api/scan/ScanService.php +++ b/niucloud/app/service/api/scan/ScanService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/site/SiteService.php b/niucloud/app/service/api/site/SiteService.php index c1af9c8b4..cd8db9b62 100644 --- a/niucloud/app/service/api/site/SiteService.php +++ b/niucloud/app/service/api/site/SiteService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/sys/AreaService.php b/niucloud/app/service/api/sys/AreaService.php index cafcc6169..6ef4996c3 100644 --- a/niucloud/app/service/api/sys/AreaService.php +++ b/niucloud/app/service/api/sys/AreaService.php @@ -109,11 +109,13 @@ class AreaService extends BaseApiService $url = 'https://apis.map.qq.com/ws/geocoder/v1/'; $map = ( new ConfigService() )->getMap(); - $post_data = array ( + $get_data = array ( 'location' => $params[ 'latlng' ], 'key' => $map[ 'key' ], 'get_poi' => 0,//是否返回周边POI列表:1.返回;0不返回(默认) ); + + $url = $url . '?' . http_build_query($get_data); $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, 0); @@ -121,8 +123,6 @@ class AreaService extends BaseApiService curl_setopt($curl, CURLOPT_TIMEOUT, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($curl, CURLOPT_POST, 1); - curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post_data)); $res = curl_exec($curl); $res = json_decode($res, true); @@ -136,7 +136,8 @@ class AreaService extends BaseApiService 'city' => $return_array[ 'city' ] ?? '', 'district' => $return_array[ 'district' ] ?? '', 'address' => $return_array[ 'street_number' ] ?? '', - 'full_address' => $res[ 'result' ][ 'address' ] ?? '' + 'full_address' => $res[ 'result' ][ 'address' ] ?? '', + 'formatted_addresses' => $res[ 'result' ][ 'formatted_addresses' ] ?? [] ); $province = ''; @@ -191,7 +192,9 @@ class AreaService extends BaseApiService 'district_id' => $district_id, 'district' => $district_name, - 'full_address' => $address_data[ 'full_address' ] + 'full_address' => $address_data[ 'full_address' ], + 'formatted_addresses' => $address_data[ 'formatted_addresses' ] + ]; } else { return $res[ 'message' ]; diff --git a/niucloud/app/service/api/sys/ConfigService.php b/niucloud/app/service/api/sys/ConfigService.php index 727cfeb0f..460295da2 100644 --- a/niucloud/app/service/api/sys/ConfigService.php +++ b/niucloud/app/service/api/sys/ConfigService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -27,7 +27,6 @@ class ConfigService extends BaseApiService public function __construct() { parent::__construct(); - } /** @@ -56,4 +55,9 @@ class ConfigService extends BaseApiService { return ( new CoreSysConfigService() )->getWapIndexList($data); } + + public function getMap(){ + return (new CoreSysConfigService())->getMap($this->site_id); + } + } diff --git a/niucloud/app/service/api/sys/TaskService.php b/niucloud/app/service/api/sys/TaskService.php new file mode 100644 index 000000000..623b09049 --- /dev/null +++ b/niucloud/app/service/api/sys/TaskService.php @@ -0,0 +1,65 @@ +getGrowthRuleConfig($this->site_id); + if (!empty($growth_config)) { + $growth_config = CoreMemberService::getGrowthRuleContent($this->site_id, $growth_config, 'task'); + $growth_config = array_values(array_filter(array_map(function ($item) { + if ($item['content']) return $item['content']; + }, $growth_config))); + } + return $growth_config; + } + + /** + * 获取积分任务 + * @param string $key + * @return mixed + */ + public function getPointTask() + { + $point_config = (new CoreMemberConfigService())->getPointRuleConfig($this->site_id)['grant'] ?? []; + + if (!empty($point_config)) { + $point_config = CoreMemberService::getPointGrantRuleContent($this->site_id, $point_config, 'task'); + $point_config = array_values(array_filter(array_map(function ($item) { + if ($item['content']) return $item['content']; + }, $point_config))); + } + return $point_config; + } +} diff --git a/niucloud/app/service/api/upload/Base64Service.php b/niucloud/app/service/api/upload/Base64Service.php index 6f9582fed..acdaee3b8 100644 --- a/niucloud/app/service/api/upload/Base64Service.php +++ b/niucloud/app/service/api/upload/Base64Service.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/upload/FetchService.php b/niucloud/app/service/api/upload/FetchService.php index 96dab57ff..81d0ce402 100644 --- a/niucloud/app/service/api/upload/FetchService.php +++ b/niucloud/app/service/api/upload/FetchService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/upload/UploadService.php b/niucloud/app/service/api/upload/UploadService.php index 6c1e23bb0..5deb6e493 100644 --- a/niucloud/app/service/api/upload/UploadService.php +++ b/niucloud/app/service/api/upload/UploadService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/api/verify/Verifier.php b/niucloud/app/service/api/verify/Verifier.php new file mode 100644 index 000000000..409b198b2 --- /dev/null +++ b/niucloud/app/service/api/verify/Verifier.php @@ -0,0 +1,4 @@ + , 'goods_id' => ] + * @return string + */ + public function getVerifyCode(string|int $type, array $data) + { + $list = (new CoreVerifyService())->create($this->site_id, $this->member_id, $type, $data); + $temp = []; + foreach($list as $item){ + $temp[] = [ + 'code' => $item, + 'qrcode' => qrcode($item, '', [], $this->site_id, outfile: false) + ]; + } + return $temp; + } + + /** + * 获取核销信息 + * @param $code + * @return bool + */ + public function getInfoByCode($code){ + return (new CoreVerifyService())->getInfoByCode($this->site_id, $code); + } + + /** + * 核销 + * @param $code + * @return bool + */ + public function verify($code){ + return (new CoreVerifyService())->verify($this->site_id, $code, $this->member_id); + } + + /** + * 校验是否是核销员 + * @return bool + */ + public function checkVerifier(){ + $verifier = (new Verifier())->where([['member_id', '=', $this->member_id], ['site_id', '=', $this->site_id]])->findOrEmpty(); + if(!$verifier->isEmpty()) return true; + return false; + } + + /** + * 获取核销员核销记录 + * @param $data + * @return array + * @throws \think\db\exception\DbException + */ + public function getRecordsPageByVerifier(array $data){ + $field = '*'; + $search_model = (new Verify())->where([ + ['site_id', '=', $this->site_id], + ['verifier_member_id', '=', $this->member_id] + ]) + ->withSearch(['code', 'type', 'create_time', 'relate_tag'], $data) + ->with([ + 'member' => function($query){ + $query->field('member_id, nickname, mobile, headimg'); + } + ]) + ->field($field) + ->order('create_time desc') + ->append(['type_name']); + return $this->pageQuery($search_model); + } + + /** + * 获取记录详情 + * @param int $id + * @return array + */ + public function getRecordsDetailByVerifier(string|int $code){ + $field = '*'; + return (new Verify())->where([ + ['site_id', '=', $this->site_id], + ['verifier_member_id', '=', $this->member_id], + ['code', '=', $code] + ]) + ->with([ + 'member' => function($query){ + $query->field('member_id, nickname, mobile, headimg'); + } + ]) + ->field($field) + ->append(['type_name'])->findOrEmpty()->toArray(); + } + +} \ No newline at end of file diff --git a/niucloud/app/service/api/weapp/WeappAuthService.php b/niucloud/app/service/api/weapp/WeappAuthService.php index 134357d66..1afeb7f5b 100644 --- a/niucloud/app/service/api/weapp/WeappAuthService.php +++ b/niucloud/app/service/api/weapp/WeappAuthService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -92,14 +92,20 @@ class WeappAuthService extends BaseApiService $member_service = new MemberService(); $member_info = $member_service->findMemberInfo(['weapp_openid' => $openid, 'site_id' => $this->site_id]); + if ($member_info->isEmpty() && !empty($unionid)) { + $member_info = $member_service->findMemberInfo(['wx_unionid' => $unionid, 'site_id' => $this->site_id]); + if (!$member_info->isEmpty()) { + $member_info->weapp_openid = $openid; + } + } if($member_info->isEmpty()){ $config = (new MemberConfigService())->getLoginConfig(); $is_bind_mobile = $config['is_bind_mobile']; $is_auth_register = $config['is_auth_register']; if($is_bind_mobile == 0 && $is_auth_register == 1){ - return $this->register($openid); + return $this->register($openid, wx_unionid: $unionid); }else{ - return ['openid' => $openid]; + return ['openid' => $openid, 'unionid' => $unionid]; } }else{ //可能会更新用户和粉丝表 @@ -122,7 +128,7 @@ class WeappAuthService extends BaseApiService * @throws InvalidConfigException * @throws ModelNotFoundException */ - public function register(string $openid, string $mobile = '', string $mobile_code = ''){ + public function register(string $openid, string $mobile = '', string $mobile_code = '', string $wx_unionid = ''){ if(empty($openid)) throw new AuthException('AUTH_LOGIN_TAG_NOT_EXIST'); //todo openid可能还需要合法性验证 @@ -142,12 +148,18 @@ class WeappAuthService extends BaseApiService } $member_service = new MemberService(); $member_info = $member_service->findMemberInfo(['weapp_openid' => $openid, 'site_id' => $this->site_id]); - if(!$member_info->isEmpty()) throw new AuthException('MEMBER_IS_EXIST');//账号已存在, 不能在注册 + + if (!empty($wx_unionid)) { + $member_info = $member_service->findMemberInfo(['wx_unionid' => $wx_unionid, 'site_id' => $this->site_id]); + if (!$member_info->isEmpty()) throw new AuthException('MEMBER_IS_EXIST');//账号已存在, 不能在注册 + } + $register_service = new RegisterService(); return $register_service->register($mobile ?? '', [ - 'weapp_openid' => $openid + 'weapp_openid' => $openid, + 'wx_unionid' => $wx_unionid ], MemberRegisterTypeDict::WEAPP, $is_verify_mobile ?? false @@ -155,4 +167,4 @@ class WeappAuthService extends BaseApiService } -} \ No newline at end of file +} diff --git a/niucloud/app/service/api/weapp/WeappDeliveryService.php b/niucloud/app/service/api/weapp/WeappDeliveryService.php new file mode 100644 index 000000000..e66b628b0 --- /dev/null +++ b/niucloud/app/service/api/weapp/WeappDeliveryService.php @@ -0,0 +1,78 @@ +core_weapp_deliver_service = new CoreWeappDeliveryService(); + } + + /** + * 查询小程序是否已开通发货信息管理服务 + * @return mixed + * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException + */ + public function getIsTradeManaged() + { + $result = $this->core_weapp_deliver_service->isTradeManaged($this->site_id); + if ($result[ 'errcode' ] == 0 && $result[ 'is_trade_managed' ]) { + return true; + } + return false; + } + + /** + * 通过外部交易号获取消息跳转路径 + * @param $out_trade_no + * @return string + */ + public function getMsgJumpPath($out_trade_no) + { + + $pay_model = new Pay(); + $where = array ( + [ 'site_id', '=', $this->site_id ], + [ 'out_trade_no', '=', $out_trade_no ] + ); + $pay_info = $pay_model->where($where)->field('out_trade_no,trade_type,trade_id')->findOrEmpty()->toArray(); + + // 未获取到交易信息 + if (empty($pay_info)) { + return ''; + } + + $order_detail_path = event('WapOrderDetailPath', $pay_info)[ 0 ] ?? ''; + // 未获取到订单详情路径 + if (empty($order_detail_path)) { + return ''; + } + + return $order_detail_path; + } + +} \ No newline at end of file diff --git a/niucloud/app/service/api/wechat/WechatAuthService.php b/niucloud/app/service/api/wechat/WechatAuthService.php index 953b50689..c06a7adf8 100644 --- a/niucloud/app/service/api/wechat/WechatAuthService.php +++ b/niucloud/app/service/api/wechat/WechatAuthService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -78,9 +78,10 @@ class WechatAuthService extends BaseApiService $nickname = $userinfo->getNickname();//对应微信的 nickname $avatar = $userinfo->getAvatar();//对应微信的 头像地址 } + $unionid = $userinfo->getRaw()['unionid'] ?? ''; if (empty($openid)) throw new ApiException('WECHAT_EMPOWER_NOT_EXIST'); //todo 这儿还可能会获取用户昵称 头像 性别 ....用以更新会员信息 - return [$avatar ?? '', $nickname ?? '', $openid]; + return [$avatar ?? '', $nickname ?? '', $openid, $unionid]; //todo 业务落地 } @@ -93,8 +94,8 @@ class WechatAuthService extends BaseApiService * @throws ModelNotFoundException */ public function loginByCode(string $code){ - [$avatar, $nickname, $openid] = $this->userFromCode($code); - return $this->login($openid, $nickname, $avatar); + [$avatar, $nickname, $openid, $unionid] = $this->userFromCode($code); + return $this->login($openid, $nickname, $avatar, $unionid); } /** @@ -107,19 +108,25 @@ class WechatAuthService extends BaseApiService * @throws DbException * @throws ModelNotFoundException */ - public function login(string $openid, string $nickname = '', string $avatar = '') + public function login(string $openid, string $nickname = '', string $avatar = '', string $unionid = '') { $member_service = new MemberService(); $member_info = $member_service->findMemberInfo(['wx_openid' => $openid, 'site_id' => $this->site_id]); + if ($member_info->isEmpty() && !empty($unionid)) { + $member_info = $member_service->findMemberInfo(['wx_unionid' => $unionid, 'site_id' => $this->site_id]); + if (!$member_info->isEmpty()) { + $member_info->wx_openid = $openid; + } + } if ($member_info->isEmpty()) { $config = (new MemberConfigService())->getLoginConfig(); $is_bind_mobile = $config['is_bind_mobile']; $is_auth_register = $config['is_auth_register']; if ($is_bind_mobile == 0 && $is_auth_register == 1) { - return $this->register($openid, '', $nickname, $avatar); + return $this->register($openid, '', $nickname, $avatar, $unionid); } else { - return ['avatar' => $avatar, 'nickname' => $nickname, 'openid' => $openid]; + return ['avatar' => $avatar, 'nickname' => $nickname, 'openid' => $openid, 'unionid' => $unionid]; } } else { //可能会更新用户和粉丝表 @@ -158,17 +165,22 @@ class WechatAuthService extends BaseApiService * @throws DbException * @throws ModelNotFoundException */ - public function register(string $openid, string $mobile = '', string $nickname = '', string $avatar = '') + public function register(string $openid, string $mobile = '', string $nickname = '', string $avatar = '', string $wx_unionid = '') { $member_service = new MemberService(); $member_info = $member_service->findMemberInfo(['wx_openid' => $openid, 'site_id' => $this->site_id]); if (!$member_info->isEmpty()) throw new AuthException('MEMBER_IS_EXIST');//账号已存在, 不能在注册 + if (!empty($wx_unionid)) { + $member_info = $member_service->findMemberInfo(['wx_unionid' => $wx_unionid, 'site_id' => $this->site_id]); + if (!$member_info->isEmpty()) throw new AuthException('MEMBER_IS_EXIST');//账号已存在, 不能在注册 + } $register_service = new RegisterService(); return $register_service->register($mobile, [ 'wx_openid' => $openid, 'nickname' => $nickname, - 'headimg' => $avatar + 'headimg' => $avatar, + 'wx_unionid' => $wx_unionid ], MemberRegisterTypeDict::WECHAT ); @@ -202,4 +214,4 @@ class WechatAuthService extends BaseApiService 'key' => $key ]; } -} \ No newline at end of file +} diff --git a/niucloud/app/service/api/wechat/WechatServeService.php b/niucloud/app/service/api/wechat/WechatServeService.php index b953794b1..0f7f18c5b 100644 --- a/niucloud/app/service/api/wechat/WechatServeService.php +++ b/niucloud/app/service/api/wechat/WechatServeService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/core/addon/CoreAddonBaseService.php b/niucloud/app/service/core/addon/CoreAddonBaseService.php index 41bcbe4f9..aa5472beb 100644 --- a/niucloud/app/service/core/addon/CoreAddonBaseService.php +++ b/niucloud/app/service/core/addon/CoreAddonBaseService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/core/addon/CoreAddonCloudService.php b/niucloud/app/service/core/addon/CoreAddonCloudService.php index f35556791..e6b835a8a 100644 --- a/niucloud/app/service/core/addon/CoreAddonCloudService.php +++ b/niucloud/app/service/core/addon/CoreAddonCloudService.php @@ -78,7 +78,7 @@ class CoreAddonCloudService extends CoreCloudBaseService 'filename' => 'build.zip' ] ], - 'timeout' => 50.0 + 'timeout' => 300.0 ]); if (isset($response['code']) && $response['code'] == 0) throw new CommonException($response['msg']); diff --git a/niucloud/app/service/core/addon/CoreAddonDevelopBuildService.php b/niucloud/app/service/core/addon/CoreAddonDevelopBuildService.php index ef5978297..c9695c87a 100644 --- a/niucloud/app/service/core/addon/CoreAddonDevelopBuildService.php +++ b/niucloud/app/service/core/addon/CoreAddonDevelopBuildService.php @@ -56,9 +56,15 @@ class CoreAddonDevelopBuildService extends BaseCoreService $this->menu('admin'); $this->menu('site'); + // 先拷贝 + dir_copy($this->addon_path, runtime_path() . $addon . DIRECTORY_SEPARATOR . $addon); + $zip_file = runtime_path() . $addon . '.zip'; if (file_exists($zip_file)) unlink($zip_file); - (new CoreAddonDevelopDownloadService(''))->compressToZip($this->addon_path, $zip_file); + + (new CoreAddonDevelopDownloadService(''))->compressToZip(runtime_path() . $addon, $zip_file); + + del_target_dir(runtime_path() . $addon, true); return true; } @@ -87,21 +93,71 @@ class CoreAddonDevelopBuildService extends BaseCoreService $field = 'menu_name,menu_key,menu_short_name,parent_key,menu_type,icon,api_url,router_path,view_path,methods,sort,status,is_show'; $menu = (new SysMenu())->where($where)->field($field)->order('sort', 'desc')->select()->toArray(); if (!empty($menu)) { - $menu = (new MenuService())->menuToTree($menu, 'menu_key', 'parent_key', 'children'); + $menu = $this->menuToTree($menu, 'menu_key', 'parent_key', 'children'); (new SysMenu())->where($where)->update(['source' => MenuDict::SYSTEM]); } $addon_dict = $this->addon_path . 'app' . DIRECTORY_SEPARATOR . 'dict' . DIRECTORY_SEPARATOR . 'menu' . DIRECTORY_SEPARATOR . $app_type . '.php'; + $delete = []; + if (file_exists($addon_dict)) { + $menus = include $addon_dict; + $delete = $menus['delete'] ?? []; + } + $content = 'arrayFormat($menu); + if (!empty($delete)) { + $delete = array_map(function ($item) { + return "'{$item}'"; + }, $delete); + $content .= " 'delete' => [". implode(',', $delete) ."]" . PHP_EOL; + } $content .= '];'; file_put_contents($addon_dict, $content); return true; } + /** + * 把返回的数据集转换成Tree(专属于) + * @param $list 要转换的数据集 + * @param string $pk + * @param string $pid + * @param string $child + * @param int $root + * @return array + */ + private function menuToTree($list, $pk = 'id', $pid = 'pid', $child = 'child', $root = '') + { + // 创建Tree + $tree = array(); + if (is_array($list)) { + // 创建基于主键的数组引用 + $refer = array(); + foreach ($list as $key => $data) { + $refer[$data[$pk]] =& $list[$key]; + } + foreach ($list as $key => $data) { + // 判断是否存在parent + $parent_id = $data[$pid]; + if ($root == $parent_id) { + $tree[] =& $list[$key]; + } else { + if (isset($refer[$parent_id])) { + $parent =& $refer[$parent_id]; + $parent[$child][] =& $list[$key]; + } else { + $tree[] =& $list[$key]; + } + } + } + } + return $tree; + + } + private function arrayFormat($array, $level = 1) { $tab = ''; for ($i = 0; $i < $level; $i++) { diff --git a/niucloud/app/service/core/addon/CoreAddonDownloadService.php b/niucloud/app/service/core/addon/CoreAddonDownloadService.php index d29bfa67a..d76c3b461 100644 --- a/niucloud/app/service/core/addon/CoreAddonDownloadService.php +++ b/niucloud/app/service/core/addon/CoreAddonDownloadService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/core/addon/CoreAddonLogService.php b/niucloud/app/service/core/addon/CoreAddonLogService.php index c28ecac00..ae08d0e05 100644 --- a/niucloud/app/service/core/addon/CoreAddonLogService.php +++ b/niucloud/app/service/core/addon/CoreAddonLogService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/core/addon/CoreAddonService.php b/niucloud/app/service/core/addon/CoreAddonService.php index 286166bba..986cbf46c 100644 --- a/niucloud/app/service/core/addon/CoreAddonService.php +++ b/niucloud/app/service/core/addon/CoreAddonService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- @@ -116,7 +116,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'); + $search_model = $this->model->withSearch(['title'], $where)->field($field)->order('id desc'); return $this->pageQuery($search_model); } @@ -209,7 +209,13 @@ class CoreAddonService extends CoreAddonBaseService * @return array */ public function getInstallAddonList(){ - return $this->model->where([['status', '=', AddonDict::ON]])->append(['status_name'])->column('title, icon, key, desc, status, type, support_app', 'key'); + $addon_list = $this->model->where([['status', '=', AddonDict::ON]])->append(['status_name'])->column('title, icon, key, desc, status, type, support_app', 'key'); + if (!empty($addon_list)) { + foreach ($addon_list as &$data) { + $data['icon'] = is_file($data['icon']) ? image_to_base64($data['icon']) : ''; + } + } + return $addon_list; } /** diff --git a/niucloud/app/service/core/addon/CoreDependService.php b/niucloud/app/service/core/addon/CoreDependService.php index f0ab13d6e..33f91de6a 100644 --- a/niucloud/app/service/core/addon/CoreDependService.php +++ b/niucloud/app/service/core/addon/CoreDependService.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | Niucloud-admin 企业快速开发的saas管理平台 // +---------------------------------------------------------------------- -// | 官方网址:https://www.niucloud-admin.com +// | 官方网址:https://www.niucloud.com // +---------------------------------------------------------------------- // | niucloud团队 版权所有 开源版本可自由商用 // +---------------------------------------------------------------------- diff --git a/niucloud/app/service/core/addon/WapTrait.php b/niucloud/app/service/core/addon/WapTrait.php index 1cad4d005..5266a9c1f 100644 --- a/niucloud/app/service/core/addon/WapTrait.php +++ b/niucloud/app/service/core/addon/WapTrait.php @@ -32,9 +32,13 @@ trait WapTrait { $content = "