HouseDistrict.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\Db;
  6. class HouseDistrict extends Base
  7. {
  8. // 新增
  9. public function save(){
  10. model('HouseDistrict')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 删除
  14. public function del(){
  15. $id = input('id/d',0);
  16. model('HouseDistrict')->del($id);
  17. HelpHander::success([],'操作成功');
  18. }
  19. //列表
  20. public function list(){
  21. $page = input('page/d',1);
  22. $size = input('size/d',10);
  23. $title = input('title','','trim');
  24. $type = input('type/d',1);
  25. $ret = model('HouseDistrict')->lists($page,$size,$title,$this->orgId,$type);
  26. HelpHander::success($ret);
  27. }
  28. // 全部列表
  29. public function all(){
  30. $type = input('type/d',1);
  31. $ret = model('HouseDistrict')->all($this->orgId,$type);
  32. HelpHander::success($ret);
  33. }
  34. public function listAndChild(){
  35. $type = input('type/d',1);
  36. $cate = input('cate/d',2);
  37. $ret = model('HouseDistrict')->listAndChild($this->orgId,$type,$cate);
  38. HelpHander::success($ret);
  39. }
  40. }