Procházet zdrojové kódy

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

raojiaolong@163.com před 2 roky
rodič
revize
70e47c5475
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  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("code", 200);
             resultJson.put("data", hotelEto);
             resultJson.put("data", hotelEto);
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+        }else{
+            hotelEto.setHstatus(1);
+            hotelEto.setIsCanorder(1);
+            hotelEto.setIsOrder(1);
+            hotelEto.setIsCanorder(1);
         }
         }
         if(adminManager == null && hotel == null){
         if(adminManager == null && hotel == null){
             resultJson.put("message", "未查到数据请检查参数");
             resultJson.put("message", "未查到数据请检查参数");
             resultJson.put("code", 500);
             resultJson.put("code", 500);
-            resultJson.put("data", hotelEto);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
         }
         }
         resultJson.put("message", "查询成功");
         resultJson.put("message", "查询成功");
         resultJson.put("code", 200);
         resultJson.put("code", 200);