diff --git a/app/controller/RotationChart.php b/app/controller/RotationChart.php index 1a83125..77029e7 100644 --- a/app/controller/RotationChart.php +++ b/app/controller/RotationChart.php @@ -111,20 +111,20 @@ class RotationChart extends BaseController try { $rule = [ 'image' => [ - 'fileSize:10240', // 文件大小不超过10M (10 * 1024 KB) + 'fileSize:10240000', // 文件大小不超过10M (10 * 1024 KB) 'fileExt:jpeg,jpg,png,gif', // 文件后缀只允许jpeg,png,jpg,gif - function ($value) { - // 验证图片宽度在350 - list($width, $height) = getimagesize($value->getPathName()); - - if ($width < 345 || $width > 355) { - return '图片宽度不能小于345,且不能大于355像素'; - } - if ($height < 145 || $height > 155) { - return '图片高度不能小于145,且不能大于155像素'; - } - return true; - } +// function ($value) { +// // 验证图片宽度在350 +// list($width, $height) = getimagesize($value->getPathName()); +// +// if ($width < 345 || $width > 355) { +// return '图片宽度不能小于345,且不能大于355像素'; +// } +// if ($height < 145 || $height > 155) { +// return '图片高度不能小于145,且不能大于155像素'; +// } +// return true; +// } ] ]; validate($rule)->check($file);