鲜花2.0-文案调整
This commit is contained in:
parent
984132bfff
commit
863f78f73f
@ -52,13 +52,16 @@ class ShopsController extends Controller
|
||||
$validator = Validator::make($request->all(), [
|
||||
'name' => 'required|string|max:191|unique:shops,name',
|
||||
'plat_id' => 'required|integer',
|
||||
'ratio' => 'sometimes|default:*1',
|
||||
'ratio' => 'sometimes',
|
||||
]);
|
||||
if ($validator->fails()) {
|
||||
$this->setValidatorFailResponse($validator->getMessageBag()->getMessages());
|
||||
|
||||
return response($this->res, $this->res['httpCode']);
|
||||
}
|
||||
if(empty($request->ratio)){
|
||||
$request->ratio = "*1";
|
||||
}
|
||||
$operator = substr($request->ratio, 0, 1);
|
||||
if (!in_array($operator, ['+', '-', '*', '/'])) {
|
||||
$this->res->errorMessage = '运算符号仅允许+,-,*,/';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user