Explorar o código

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

raojiaolong@163.com %!s(int64=3) %!d(string=hai) anos
pai
achega
70e47c5475
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  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);