12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\Db;
- class House extends Base
- {
- // 新增/编辑
- public function save(){
- model('House')->add();
- HelpHander::success([],'操作成功');
- }
- // 详情
- public function detail(){
- $id = input('id/d',0);
- $ret = model('House')->info($id);
- HelpHander::success($ret);
- }
- // 删除
- public function del(){
- $id = input('id/d',0);
- model('House')->del($id);
- HelpHander::success([],'操作成功');
- }
- //列表
- public function list(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $title = input('title','','trim');
- $floorId = input('floorId/d',0);
- $ret = model('House')->lists($page,$size,$title,$this->userId,$this->orgId,$floorId);
- HelpHander::success($ret);
- }
- public function all(){
- $ret = model('House')->all($this->userId,$this->orgId);
- HelpHander::success($ret);
- }
- public function houseList(){
- $floorId = input('floorId/d',0);
- $title = input('title','','trim');
- $ret = model('House')->houseList($floorId,$title,$this->orgId,$this->userId);
- HelpHander::success($ret);
- }
- public function houseDetail(){
- $id = input('id/d',0);
- $ret = model('House')->houseDetail($id,$this->orgId);
- }
- }
|