..
This commit is contained in:
@@ -119,9 +119,8 @@ abstract class AetherModel extends HyperfModel implements CacheableInterface
|
||||
{
|
||||
if (! static::query()->where('id', $id)->exists()) {
|
||||
throw new ModelNotFoundException(sprintf(
|
||||
'找不到ID为 %d 的 %s 记录',
|
||||
'找不到 ID 为 %d 的记录',
|
||||
$id,
|
||||
static::class
|
||||
));
|
||||
}
|
||||
return static::query()->where('id', $id)->delete() > 0;
|
||||
@@ -155,9 +154,8 @@ abstract class AetherModel extends HyperfModel implements CacheableInterface
|
||||
$record = static::query()->find($id);
|
||||
if (is_null($record)) {
|
||||
throw new ModelNotFoundException(sprintf(
|
||||
'找不到ID为 %d 的 %s 记录',
|
||||
$id,
|
||||
static::class
|
||||
'找不到 ID 为 %d 的记录',
|
||||
$id
|
||||
));
|
||||
}
|
||||
return $record; // static::query()->findOrFail($id);
|
||||
|
||||
Reference in New Issue
Block a user