Browse Source

民宿查询第一次未维护时添加默认值

raojiaolong@163.com 2 years atrás
parent
commit
70e47c5475
1 changed files with 7 additions and 1 deletions
  1. 7 1
      mhotel/src/com/happy/action/hotelAction.java

+ 7 - 1
mhotel/src/com/happy/action/hotelAction.java

@@ -185,11 +185,17 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
             resultJson.put("code", 200);
             resultJson.put("data", hotelEto);
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+        }else{
+            hotelEto.setHstatus(1);
+            hotelEto.setIsCanorder(1);
+            hotelEto.setIsOrder(1);
+            hotelEto.setIsCanorder(1);
         }
         if(adminManager == null && hotel == null){
             resultJson.put("message", "未查到数据请检查参数");
             resultJson.put("code", 500);
-            resultJson.put("data", hotelEto);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
         }
         resultJson.put("message", "查询成功");
         resultJson.put("code", 200);