model = new \app\common\model\ShopAddress(); } public function add(){ $model = $this->model; $ret=$model->add($this->userId); if(!$ret){ HelpHander::error($model->getError()); } HelpHander::success([],'添加成功'); } public function update(){ $id=input('id/d',0); $model = $this->model; $ret=$model->updates($id,$this->userId); if(!$ret){ HelpHander::error($model->getError()); } HelpHander::success([],'修改成功'); } public function lists(){ $model = $this->model; $ret=$model->lists($this->userId); HelpHander::success($ret); } public function detail(){ $id=input('id/d',0); $model = $this->model; $ret=$model->detail($id); if(!$ret){ HelpHander::error('数据不存在'); } HelpHander::success($ret); } public function del(){ $id=input('id/d',0); $model = $this->model; $ret=$model->del($id); if($ret == 0){ HelpHander::error('删除失败'); } HelpHander::success([],'删除成功'); } //获取默认地址 public function addressOne(){ $model = $this->model; $ret = $model->finds($this->userId); HelpHander::success($ret); } }