mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-20 17:37:23 +08:00
exam recurring add daily + TorrentDeleted event
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class TorrentDeleted
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public int $torrentId;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(int $torrentId)
|
||||
{
|
||||
$this->torrentId = $torrentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
return new PrivateChannel('channel-name');
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,7 @@ class Exam extends NexusModel
|
||||
self::FILTER_USER_REGISTER_DAYS_RANGE => ['name' => 'User register days range'],
|
||||
];
|
||||
|
||||
const RECURRING_DAILY = "Daily";
|
||||
const RECURRING_WEEKLY = "Weekly";
|
||||
const RECURRING_MONTHLY = "Monthly";
|
||||
|
||||
@@ -93,6 +94,7 @@ class Exam extends NexusModel
|
||||
public static function listRecurringOptions(): array
|
||||
{
|
||||
return [
|
||||
self::RECURRING_DAILY => nexus_trans("exam.recurring_daily"),
|
||||
self::RECURRING_WEEKLY => nexus_trans("exam.recurring_weekly"),
|
||||
self::RECURRING_MONTHLY => nexus_trans("exam.recurring_monthly"),
|
||||
];
|
||||
@@ -215,6 +217,8 @@ class Exam extends NexusModel
|
||||
return $time->startOfWeek();
|
||||
} elseif ($recurring == self::RECURRING_MONTHLY) {
|
||||
return $time->startOfMonth();
|
||||
} elseif ($recurring == self::RECURRING_DAILY) {
|
||||
return $time->startOfDay();
|
||||
}
|
||||
throw new \RuntimeException("Invalid recurring: $recurring");
|
||||
}
|
||||
@@ -226,6 +230,8 @@ class Exam extends NexusModel
|
||||
return $time->endOfWeek();
|
||||
} elseif ($recurring == self::RECURRING_MONTHLY) {
|
||||
return $time->endOfMonth();
|
||||
} elseif ($recurring == self::RECURRING_DAILY) {
|
||||
return $time->endOfDay();
|
||||
}
|
||||
throw new \RuntimeException("Invalid recurring: $recurring");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.12');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-04-13');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-04-24');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -34,6 +34,7 @@ return [
|
||||
]
|
||||
],
|
||||
'recurring' => 'recurring',
|
||||
'recurring_daily' => 'once a day',
|
||||
'recurring_weekly' => 'once a week',
|
||||
'recurring_monthly' => 'once a month',
|
||||
'recurring_help' => 'If specified as periodic, the appraisal start time is the start time of the current cycle, and the end time is the end time of the current cycle, which is said to be the natural week/month. At the end of each cycle, if the user still meets the screening criteria, the user will be automatically assigned to the next cycle.' ,
|
||||
|
||||
@@ -34,6 +34,7 @@ return [
|
||||
]
|
||||
],
|
||||
'recurring' => '周期性',
|
||||
'recurring_daily' => '每天一次',
|
||||
'recurring_weekly' => '每周一次',
|
||||
'recurring_monthly' => '每月一次',
|
||||
'recurring_help' => '如果指定为周期性,考核开始时间为当前周期的开始时间,结束时间为当前周期的结束时间,这里说的都是自然周/月。每个周期结束后,如果用户仍然满足筛选条件,会自动为用户分配下个周期的任务。',
|
||||
|
||||
@@ -34,6 +34,7 @@ return [
|
||||
]
|
||||
],
|
||||
'recurring' => '周期性',
|
||||
'recurring_daily' => '每天一次',
|
||||
'recurring_weekly' => '每周一次',
|
||||
'recurring_monthly' => '每月一次',
|
||||
'recurring_help' => '如果指定為周期性,考核開始時間為當前周期的開始時間,結束時間為當前周期的結束時間,這裏說的都是自然周/月。每個周期結束後,如果用戶仍然滿足篩選條件,會自動為用戶分配下個周期的任務。',
|
||||
|
||||
Reference in New Issue
Block a user