Skip to content

Commit

Permalink
升级:发布9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
modstart committed Oct 29, 2024
1 parent d9875c0 commit 1c4f0ed
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Constant/AppConstant.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ class AppConstant
{
const APP = 'cms';
const APP_NAME = 'ModStartCMS';
const VERSION = '8.9.0';
const VERSION = '9.0.0';
}
1 change: 1 addition & 0 deletions module/Member/Admin/Controller/MemberController.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ protected function crud(AdminCRUDBuilder $builder)
$builder->datetime('vipExpire', 'VIP过期');
}
$builder->display('registerIp', '注册IP');
$builder->display('registerIpName', '注册IP定位');
$builder->display('created_at', '注册时间');
$builder->canBatchSelect(true);
$builder->batchOperatePrepend('<button class="btn" data-batch-confirm="确认禁用 %d 个用户?" data-batch-operate="' . modstart_admin_url('member/status_forbidden') . '"><i class="iconfont icon-warning"></i> 禁用</button>');
Expand Down
21 changes: 18 additions & 3 deletions module/Member/Core/ModuleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use ModStart\Admin\Widget\DashboardItem;
use ModStart\Admin\Widget\DashboardItemA;
use ModStart\Core\Util\ColorUtil;
use ModStart\Core\Util\StrUtil;
use ModStart\Data\Event\DataDeletedEvent;
use ModStart\Data\Event\DataUploadedEvent;
use ModStart\Data\Event\DataUploadingEvent;
Expand All @@ -33,6 +34,7 @@
use Module\Vendor\Admin\Widget\AdminWidgetDashboard;
use Module\Vendor\Admin\Widget\AdminWidgetLink;
use Module\Vendor\Job\MailSendJob;
use Module\Vendor\Provider\LBS\IpProvider;
use Module\Vendor\Provider\Schedule\ScheduleBiz;
use Module\Vendor\Provider\SmsTemplate\SmsTemplateProvider;
use Module\Voucher\Biz\VoucherBiz;
Expand Down Expand Up @@ -226,9 +228,9 @@ public function boot(Dispatcher $events)
}

Event::listen(MemberUserRegisteredEvent::class, function (MemberUserRegisteredEvent $e) {
$memberUser = MemberUtil::getCached($e->memberUserId);
// VIP赠送积分
if (ModuleManager::getModuleConfig('Member', 'creditEnable', false)) {
$memberUser = MemberUtil::getCached($e->memberUserId);
$vipSet = MemberVipUtil::get($memberUser['vipId']);
if ($vipSet['creditPresentEnable']) {
if ($vipSet['creditPresentValue']) {
Expand All @@ -239,20 +241,33 @@ public function boot(Dispatcher $events)
// 注册发送邮件
$message = modstart_config('Member_Registered_Message', '');
if ($message) {
$memberUser = MemberUtil::getCached($e->memberUserId);
$message = MemberParamUtil::replaceParam($message, $memberUser);
MemberMessageUtil::send($e->memberUserId, MemberParamUtil::replaceParam($message, $memberUser));
}
$emailContent = modstart_config('Member_Registered_Email', '');
$emailTitle = modstart_config('Member_Registered_EmailTitle', '');
if ($emailTitle && $emailContent) {
$memberUser = MemberUtil::getCached($e->memberUserId);
if (!empty($memberUser['email'])) {
$emailTitle = MemberParamUtil::replaceParam($emailTitle, $memberUser);
$emailContent = MemberParamUtil::replaceParam($emailContent, $memberUser);
MailSendJob::createHtml($memberUser['email'], $emailTitle, $emailContent);
}
}
// 注册信息更新
$registerIpNameRes = IpProvider::firstResponse($memberUser['registerIp']);
if (!empty($registerIpNameRes)) {
$name = join('', array_filter([
$registerIpNameRes->country,
$registerIpNameRes->province,
$registerIpNameRes->city,
$registerIpNameRes->district,
]));
if (!empty($name)) {
MemberUtil::update($memberUser['id'], [
'registerIpName' => StrUtil::mbLimit($name, 30),
]);
}
}
});

AdminMenu::register(function () {
Expand Down
1 change: 1 addition & 0 deletions module/Member/Docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- 新增:VIP 优惠券功能集成,支持折扣券
- 新增:可完全自定义上传功能定制的特性 UploadScript Hook
- 新增:用户登录传输用户密码加密
- 新增:用户注册增加注册IP定位,支持用户注册地理位置记录
- 优化:VIP 开通页面交互形式优化

---
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class MemberUserRegisterIpNameModify extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('member_user', function (Blueprint $table) {
$table->string('registerIpName', 30)->nullable()->comment('注册IP定位');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{

}
}

0 comments on commit 1c4f0ed

Please sign in to comment.