You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
560 B

7 years ago
7 years ago
7 years ago
7 years ago
  1. <?php
  2. namespace App\Http\Model;
  3. class Region extends BaseModel
  4. {
  5. //地区
  6. protected $table = 'region';
  7. public $timestamps = false;
  8. public static function getRegionName($id)
  9. {
  10. if(empty($id) || $id==0){return '';}
  11. return self::where('id', $id)->value('name');
  12. }
  13. public static function getList($parent_id=86)
  14. {
  15. return self::where('parent_id', $parent_id)->get();
  16. }
  17. public static function getOne($id)
  18. {
  19. return self::where('id', $id)->first();
  20. }
  21. }