Compare commits

..

8 Commits

Author SHA1 Message Date
zbuse
97e9f7297d
Merge fc6bb8cf34 into 3a05281a9f 2025-01-18 23:57:12 +08:00
Xboard
3a05281a9f
Update MigrateFromV2b.php
Some checks failed
Docker Build and Publish / build (push) Has been cancelled
2025-01-18 21:57:33 +08:00
Xboard
74d93691b9
Merge pull request #313 from elysias123/dev
Some checks failed
Docker Build and Publish / build (push) Has been cancelled
allow admin/staff unbind a user and better subscription domain names
2025-01-17 11:59:11 +08:00
Xboard
d743296392
Merge pull request #325 from rebecca554owen/patch-1
Some checks are pending
Docker Build and Publish / build (push) Waiting to run
Sync
2025-01-16 23:01:32 +08:00
rebecca554owen
024a9dfb54
fix update.sh 2025-01-16 22:44:10 +08:00
Elysia
a550fd1436
feat: Replace with a random string when the subscription domain contains *&Replace with the user uuid when the subscription domain contains {uuid} 2025-01-14 13:54:26 +08:00
Elysia
43bac89d3a
Merge branch 'cedar2025:dev' into dev 2025-01-13 21:35:45 +08:00
Elysia
e2262f1435
feat: allow admin/staff unbind a user 2025-01-12 15:31:51 +08:00
4 changed files with 26 additions and 10 deletions

View File

@ -51,15 +51,16 @@ class MigrateFromV2b extends Command
], ],
'1.7.3' => [ '1.7.3' => [
'ALTER TABLE `v2_stat_order` RENAME TO `v2_stat`;', 'ALTER TABLE `v2_stat_order` RENAME TO `v2_stat`;',
"ALTER TABLE `v2_stat` CHANGE COLUMN order_amount order_total INT COMMENT '订单合计';", "ALTER TABLE `v2_stat` CHANGE COLUMN order_amount paid_total INT COMMENT '订单合计';",
"ALTER TABLE `v2_stat` CHANGE COLUMN order_count paid_count INT COMMENT '邀请佣金';",
"ALTER TABLE `v2_stat` CHANGE COLUMN commission_amount commission_total INT COMMENT '佣金合计';", "ALTER TABLE `v2_stat` CHANGE COLUMN commission_amount commission_total INT COMMENT '佣金合计';",
"ALTER TABLE `v2_stat` "ALTER TABLE `v2_stat`
ADD COLUMN paid_count INT NULL, ADD COLUMN order_count INT NULL,
ADD COLUMN paid_total INT NULL, ADD COLUMN order_total INT NULL,
ADD COLUMN register_count INT NULL, ADD COLUMN register_count INT NULL,
ADD COLUMN invite_count INT NULL, ADD COLUMN invite_count INT NULL,
ADD COLUMN transfer_used_total VARCHAR(32) NULL; ADD COLUMN transfer_used_total VARCHAR(32) NULL;
", ",
"CREATE TABLE `v2_log` ( "CREATE TABLE `v2_log` (
`id` INT AUTO_INCREMENT PRIMARY KEY, `id` INT AUTO_INCREMENT PRIMARY KEY,
`title` TEXT NOT NULL, `title` TEXT NOT NULL,

View File

@ -12,11 +12,17 @@ class UnBind extends Telegram {
public function handle($message, $match = []) { public function handle($message, $match = []) {
if (!$message->is_private) return; if (!$message->is_private) return;
$user = User::where('telegram_id', $message->chat_id)->first(); if (!isset($message->args[0])) {
$telegramService = $this->telegramService; $user = User::where('telegram_id', $message->chat_id)->first();
if (!$user) { } else {
$telegramService->sendMessage($message->chat_id, '没有查询到您的用户信息,请先绑定账号', 'markdown'); $chat = User::where('telegram_id', $message->chat_id)->first();
return; if (!$chat) return;
if (!($chat->is_admin || $chat->is_staff)) return;
if (strpos($message->args[0], '@') !== true) {
$user = User::where('email', $message->args[0])->first();
} else {
$user = User::where('telegram_id', $message->args[0])->first();
}
} }
$user->telegram_id = NULL; $user->telegram_id = NULL;
if (!$user->save()) { if (!$user->save()) {

View File

@ -110,11 +110,20 @@ class Helper
public static function getSubscribeUrl(string $token, $subscribeUrl = null) public static function getSubscribeUrl(string $token, $subscribeUrl = null)
{ {
$strs = 'QWERTYUIOPASDFGHJKLZXCVBNM1234567890qwertyuiopasdfghjklzxcvbnm';
$randstr = substr(str_shuffle($strs), 0, rand(4,8));
$path = route('client.subscribe', ['token' => $token], false); $path = route('client.subscribe', ['token' => $token], false);
if(!$subscribeUrl){ if(!$subscribeUrl){
$subscribeUrls = explode(',', admin_setting('subscribe_url')); $subscribeUrls = explode(',', admin_setting('subscribe_url'));
$subscribeUrl = \Arr::random($subscribeUrls); $subscribeUrl = \Arr::random($subscribeUrls);
$subscribeUrl = self::replaceByPattern($subscribeUrl); $subscribeUrl = self::replaceByPattern($subscribeUrl);
if (strpos($subscribeUrl, "*") !== false) {
$subscribeUrl = str_replace("*", $randstr, $subscribeUrl);
} elseif (strpos($subscribeUrl, '{uuid}') !== false) {
$user = User::where('token', $token)->first();
$subscribeUrl = str_replace('{uuid}', $user->uuid, $subscribeUrl);
}
} }
return $subscribeUrl ? rtrim($subscribeUrl, '/') . $path : url($path); return $subscribeUrl ? rtrim($subscribeUrl, '/') . $path : url($path);
} }

View File

@ -11,7 +11,7 @@ if ! command -v git &> /dev/null; then
fi fi
git config --global --add safe.directory $(pwd) git config --global --add safe.directory $(pwd)
git fetch --all && git reset --hard origin/dev && git pull origin dev git fetch --all && git reset --hard origin/legacy && git pull origin legacy
rm -rf composer.lock composer.phar rm -rf composer.lock composer.phar
wget https://github.com/composer/composer/releases/latest/download/composer.phar -O composer.phar wget https://github.com/composer/composer/releases/latest/download/composer.phar -O composer.phar
php composer.phar update -vvv php composer.phar update -vvv