Explorar el Código

SERVICE bug修复
车型录入限制

Zhouzhendong hace 4 años
padre
commit
9f285a635f

+ 3 - 5
app/Http/Controllers/CarTypesController.php

@@ -77,15 +77,13 @@ class CarTypesController extends Controller
         if ($id){$name=$id;}
         $validator=Validator::make($request->input(),[
             'CarType.name'=>['required','max:50',isset($name)?"unique:car_types,name,$name":'unique:car_types,name'],
-            'CarType.model'=>'nullable|alpha_dash|max:50',
-            'CarType.length'=>'nullable|numeric|min:0',
-            'CarType.load'=>'nullable|numeric|min:0',
+            'CarType.model'=>'nullable|max:50',
+            'CarType.length'=>'nullable|min:0',
+            'CarType.load'=>'nullable|min:0',
         ],[
             'required'=>':attribute 为必填项',
-            'alpha_dash'=>':attribute 应为字母,数字,下划线',
             'max'=>':attribute 字符过多或数值过大',
             'min'=>':attribute 不得为负',
-            'numeric'=>':attribute 应为数字',
             'unique'=>':attribute 已存在',
         ],[
             'CarType.name'=>'车辆名称',

+ 2 - 2
app/Services/PackageStatisticsService.php

@@ -26,8 +26,8 @@ class PackageStatisticsService
                 ->selectRaw('orders.owner_id,logistic_id');
 
         $columnQueryRules=[
-            'created_at_start' => ['alias' => 'order_packages.created_at','startDate' => ":00"],
-            'created_at_end' => ['alias' => 'order_packages.created_at','endDate' => ":59"],
+            'created_at_start' => ['alias' => 'created_at','startDate' => ":00"],
+            'created_at_end' => ['alias' => 'created_at','endDate' => ":59"],
             'logistic_id' => ['multi' => ','],
             'owner_id' => ['multi' => ','],
         ];