12345678910111213141516171819202122 |
- <?php
- namespace App\Repositories;
- use App\Models\ConfigProvince;
- class ConfigProvinceRepository {
- public function __construct(ConfigProvince $configProvince) {
- $this->configProvince = $configProvince;
- }
- //省市区列表
- 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($perPage);
- }
- }
|