duqinya 6 роки тому
батько
коміт
1bb64ce7a5

+ 1 - 1
app/Http/Controllers/ConfigCityManagementController.php

@@ -60,7 +60,7 @@ class ConfigCityManagementController extends Controller
             'province_name' => 'required|string',
             'city_id' => 'required',
             'city_name' => 'required|string',
-            'express_type' => 'required'
+            'express_type' => 'required',
         ]);
         if ($validator->fails()) {
             return $this->response->error($validator->errors()->first(), 500);

+ 2 - 2
app/Repositories/ConfigCityManagementRepository.php

@@ -40,7 +40,7 @@ class ConfigCityManagementRepository {
             'city_id' => $request['city_id'],
             'city_name' => $request['city_name'],
             'express_type' => $request['express_type'],
-            'status' => 1,
+            'status' => $request['status']?$request['status']:0,
         ];
 
         if (!$this->configCityManagement->create($data)) {
@@ -58,7 +58,7 @@ class ConfigCityManagementRepository {
         $configCity->city_id = $request['city_id'];
         $configCity->city_name = $request['city_name'];
         $configCity->express_type = $request['express_type'];
-        $configCity->status = 1;
+        $configCity->status = $request['status']?$request['status']:0;
 
         DB::beginTransaction();
         try {

+ 2 - 1
app/Repositories/ConfigProvinceRepository.php

@@ -11,11 +11,12 @@ class ConfigProvinceRepository {
     //省市区列表
     public function index($request)
     {
+        $perPage = isset($request['per_page']) ? $request['per_page'] : env('PER_PAGE');
         $where = [];
         if(isset($request['id'])){
             $where[] = ['bjcity_id', '=', $request['bjcity_id']];
         }
 
-        return $this->configProvince->where($where)->orderBy('bjcity_id', 'asc')->paginate(20);
+        return $this->configProvince->where($where)->orderBy('bjcity_id', 'asc')->paginate($perPage);
     }
 }

+ 2 - 1
app/Repositories/ConfigStoreTypeRepository.php

@@ -14,11 +14,12 @@ class ConfigStoreTypeRepository {
     //列表
     public function index($request)
     {
+        $perPage = isset($request['per_page']) ? $request['per_page'] : env('PER_PAGE');
         $where = [];
         if(isset($request['id'])){
             $where[] = ['id', '=', $request['id']];
         }
 
-        return $this->configStoreType->where($where)->orderBy('id', 'asc')->paginate(20);
+        return $this->configStoreType->where($where)->orderBy('id', 'asc')->paginate($perPage);
     }
 }