..
This commit is contained in:
@@ -7,5 +7,5 @@ use Aether\Exception\AetherException;
|
||||
class CampusNotFound extends AetherException
|
||||
{
|
||||
protected $code = 404001;
|
||||
protected $message = '文章不存在';
|
||||
protected $message = '校区不存在或已禁用';
|
||||
}
|
||||
@@ -8,7 +8,8 @@ use Aether\Exception\AetherException;
|
||||
|
||||
class TeacherNotFound extends AetherException
|
||||
{
|
||||
protected $code = 40400;
|
||||
protected $code = 140401;
|
||||
|
||||
protected $message = '教师不存在或已禁用';
|
||||
|
||||
protected $message = '教师不存在';
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class DataService implements DataServiceInterface
|
||||
{
|
||||
$campus = $this->campusModel->find($id);
|
||||
if (! $campus || $campus->status != 1) {
|
||||
throw new CampusNotFound('校区不存在或已禁用');
|
||||
throw new CampusNotFound(9999, 'Campus not found', ['id' => $id]);
|
||||
}
|
||||
return $campus->toArray();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ class Campus extends AetherModel
|
||||
*/
|
||||
public function scopeProvince(Builder $query, string $province): Builder
|
||||
{
|
||||
return $query->where('province', $province);
|
||||
return $query->where('province', 'like', '%' . $province . '%');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,7 +91,7 @@ class Campus extends AetherModel
|
||||
*/
|
||||
public function scopeCity(Builder $query, string $city): Builder
|
||||
{
|
||||
return $query->where('city', $city);
|
||||
return $query->where('city', 'like', '%' . $city . '%');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user