/**
* 更改状态
* @param id
* @param status
*/
public void updateStatus(String sellerId,String status);
@Override
public void updateStatus(String sellerId, String status) {
TbSeller seller = sellerMapper.selectByPrimaryKey(sellerId);
seller.setStatus(status);
sellerMapper.updateByPrimaryKey(seller);
}
/**
* 更改状态
* @param sellerId 商家 ID
* @param status 状态
*/
@RequestMapping("/updateStatus")
public Result updateStatus(String sellerId, String status){
try {
sellerService.updateStatus(sellerId, status);
return new Result(true, "成功");
} catch (Exception e) {
e.printStackTrace();
return new Result(false, "失败");
}
}
//更改状态
this.updateStatus=function(sellerId,status){
return
$http.get('../seller/updateStatus.do?sellerId='+sellerId+'&status='+status);
}
$scope.updateStatus=function(sellerId,status){
sellerService.updateStatus(sellerId,status).success(
function(response){
if(response.success){
$scope.reloadList();//刷新列表
}else{
alert("失败");
}
}
);
}
<div class="modal-footer">
<button class="btn btn-success" data-dismiss="modal" aria-hidden="true"
ng-click="updateStatus(entity.sellerId,'1')">审核通过</button>
<button class="btn btn-danger" data-dismiss="modal" aria-hidden="true"
ng-click="updateStatus(entity.sellerId,'2')">审核未通过</button>
<button class="btn btn-danger" data-dismiss="modal" aria-hidden="true"
ng-click="updateStatus(entity.sellerId,'3')">关闭商家</button>
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">
关闭</button>
</div>
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |