修改原有框架中英文映射
This commit is contained in:
@@ -50,7 +50,7 @@ class CrontabLogic extends BaseLogic
|
||||
6 => "0 {$minute} {$hour} * * {$week}",
|
||||
7 => "0 {$minute} {$hour} {$day} * *",
|
||||
8 => "0 {$minute} {$hour} {$day} {$month} *",
|
||||
default => throw new ApiException("任务类型异常"),
|
||||
default => throw new ApiException('Invalid task type'),
|
||||
};
|
||||
|
||||
// 定时任务模型新增
|
||||
@@ -95,13 +95,13 @@ class CrontabLogic extends BaseLogic
|
||||
6 => "0 {$minute} {$hour} * * {$week}",
|
||||
7 => "0 {$minute} {$hour} {$day} * *",
|
||||
8 => "0 {$minute} {$hour} {$day} {$month} *",
|
||||
default => throw new ApiException("任务类型异常"),
|
||||
default => throw new ApiException('Invalid task type'),
|
||||
};
|
||||
|
||||
// 查询任务数据
|
||||
$model = $this->model->findOrEmpty($id);
|
||||
if ($model->isEmpty()) {
|
||||
throw new ApiException('数据不存在');
|
||||
throw new ApiException('Data not found');
|
||||
}
|
||||
|
||||
$result = $model->save([
|
||||
@@ -134,7 +134,7 @@ class CrontabLogic extends BaseLogic
|
||||
{
|
||||
if (is_array($ids)) {
|
||||
if (count($ids) > 1) {
|
||||
throw new ApiException('禁止批量删除操作');
|
||||
throw new ApiException('Batch delete is not allowed');
|
||||
}
|
||||
$ids = $ids[0];
|
||||
}
|
||||
@@ -157,7 +157,7 @@ class CrontabLogic extends BaseLogic
|
||||
{
|
||||
$model = $this->model->findOrEmpty($id);
|
||||
if ($model->isEmpty()) {
|
||||
throw new ApiException('数据不存在');
|
||||
throw new ApiException('Data not found');
|
||||
}
|
||||
$result = $model->save(['status' => $status]);
|
||||
if ($result) {
|
||||
|
||||
Reference in New Issue
Block a user