ConfigProvinceRepository.php 522 B

123456789101112131415161718192021
  1. <?php
  2. namespace App\Repositories;
  3. use App\Models\ConfigProvince;
  4. class ConfigProvinceRepository {
  5. public function __construct(ConfigProvince $configProvince) {
  6. $this->configProvince = $configProvince;
  7. }
  8. //省市区列表
  9. public function index($request)
  10. {
  11. $where = [];
  12. if(isset($request['id'])){
  13. $where[] = ['bjcity_id', '=', $request['bjcity_id']];
  14. }
  15. return $this->configProvince->where($where)->orderBy('bjcity_id', 'asc')->paginate(20);
  16. }
  17. }