|
@@ -54,6 +54,11 @@ class BannerRepository
|
|
|
if (!is_int($request['link_content_id'])){
|
|
|
throw new HttpException(500, '链接内容必须是数字');
|
|
|
}
|
|
|
+ $strlen = mb_strlen($request['name'], "utf-8");
|
|
|
+ if ($strlen > 20) {
|
|
|
+ throw new HttpException(500, '名称不能超过20字');
|
|
|
+ }
|
|
|
+
|
|
|
$banner = [
|
|
|
'name' => $request['name'],
|
|
|
'link_content_id' => $request['link_content_id'],
|
|
@@ -107,6 +112,11 @@ class BannerRepository
|
|
|
if (!is_int($request['link_content_id'])){
|
|
|
throw new HttpException(500, '链接内容必须是数字');
|
|
|
}
|
|
|
+ $strlen = mb_strlen($request['name'], "utf-8");
|
|
|
+ if ($strlen > 20) {
|
|
|
+ throw new HttpException(500, '名称不能超过20字');
|
|
|
+ }
|
|
|
+
|
|
|
$banner->name = $request['name'];
|
|
|
$banner->link_content_id = $request['link_content_id'];
|
|
|
$banner->image = $request['image'];
|