3 Commits 4b56f00502 ... a98618ef94

Autor SHA1 Mensaje Fecha
  warrior a98618ef94 add 店铺数据 hace 5 meses
  warrior 7cfe394492 Merge branch 'master' of http://git.fmode.cn:3000/bin/tourism-wxapp hace 5 meses
  warrior b5fea9e4c2 add 店铺数据 hace 5 meses

+ 7 - 0
nova-tourism/components/homestay/index.js

@@ -1,5 +1,6 @@
 let Parse = getApp().Parse;
 const company = getApp().globalData.company
+const { getStores } = require(".././../service/request")
 Component({
     /**
      * 组件的属性列表
@@ -163,6 +164,12 @@ Component({
         },
         //获取店铺消息
         async gethomestar() {
+          let _data = await getStores({
+            uid:Parse.User.current().id,
+            skip:0,
+            limit:10
+          })
+          console.log('店铺数据=====>',_data);
             let ShopStore = new Parse.Query('ShopStore');
             ShopStore.equalTo('company', company);
             ShopStore.equalTo('type', "stay");

+ 37 - 0
nova-tourism/service/request.js

@@ -0,0 +1,37 @@
+const req = require('../../utils/request')
+// let Parse = getApp().Parse;
+const company = getApp().globalData.company
+
+async function getStores(params) {
+  let {
+    uid,
+    skip,
+    limit
+  } = params
+  let sql = `SELECT * ,
+  ("perCapita" * 1) price,
+  (SELECT room."price" FROM "ShopRoom" room 
+   WHERE room."shop" = store."objectId"
+   AND room."isDeleted" IS NOT TRUE
+   ORDER BY room."price" ASC LIMIT 1
+  ) "minPrice",
+  (SELECT clt."isCollect" FROM "DramaShopCollect" clt 
+   WHERE clt."homestayStore" = store."objectId" 
+   AND clt."isCollect" = TRUE
+   AND clt."isDeleted" IS NOT TRUE
+   AND clt."user" = '${uid}'
+   LIMIT 1 
+  ) "iscollect"
+  
+  FROM "ShopStore" store
+  WHERE "company" = '${company}'
+  AND "type" = 'stay'
+  AND "isDeleted" IS NOT TRUE
+  ORDER BY "iscollect"
+  OFFSET ${skip ?? 0} LIMIT ${limit ?? 10}`
+  let res = await req.customSQL(sql);
+  return res
+}
+module.exports = {
+  getStores
+};

+ 56 - 64
project.private.config.json

@@ -1,71 +1,63 @@
 {
-    "condition": {
-        "plugin": {
-            "list": []
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "民宿详细",
+          "pathName": "nova-tourism/pages/homestay/homestay-detail/index",
+          "query": "",
+          "scene": null
         },
-        "game": {
-            "list": []
+        {
+          "name": "卡卷包",
+          "pathName": "nova-tourism/pages/my/my-card/index",
+          "query": "",
+          "scene": null
         },
-        "gamePlugin": {
-            "list": []
+        {
+          "name": "商品详细",
+          "pathName": "nova-tourism/pages/collect/collect-detail/index",
+          "query": "",
+          "scene": null
         },
-        "miniprogram": {
-            "list": [
-                {
-                    "name": "民宿详细",
-                    "pathName": "nova-tourism/pages/homestay/homestay-detail/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "卡卷包",
-                    "pathName": "nova-tourism/pages/my/my-card/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "商品详细",
-                    "pathName": "nova-tourism/pages/collect/collect-detail/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "商户端首页",
-                    "pathName": "nova-tourism/pages/my/merchant/merchant-home/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "我的订单",
-                    "pathName": "nova-tourism/pages/my/my-order/index",
-                    "query": "active=0",
-                    "scene": null
-                },
-                {
-                    "name": "退款售后",
-                    "pathName": "nova-tourism/pages/my/my-order/my-refund/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "退款详细",
-                    "pathName": "nova-tourism/pages/my/my-order/my-refund/refund-detail/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "民宿订单",
-                    "pathName": "nova-tourism/pages/homestay/homestay-order2/index",
-                    "query": "objectId=vhyskK4oxw&date_start=Fri%2520Dec%252013%25202024%252016%253A28%253A58%2520GMT%252B0800%2520(%25E4%25B8%25AD%25E5%259B%25BD%25E6%25A0%2587%25E5%2587%2586%25E6%2597%25B6%25E9%2597%25B4)&date_end=Sat%2520Dec%252014%25202024%252016%253A28%253A58%2520GMT%252B0800%2520(%25E4%25B8%25AD%25E5%259B%25BD%25E6%25A0%2587%25E5%2587%2586%25E6%2597%25B6%25E9%2597%25B4)",
-                    "scene": null
-                },
-                {
-                    "name": "民宿订单",
-                    "pathName": "nova-tourism/pages/homestay/homestay-order2/index",
-                    "query": "objectId=vhyskK4oxw&date_start=Fri%2520Dec%252013%25202024%252016%253A28%253A58%2520GMT%252B0800%2520(%25E4%25B8%25AD%25E5%259B%25BD%25E6%25A0%2587%25E5%2587%2586%25E6%2597%25B6%25E9%2597%25B4)&date_end=Sat%2520Dec%252014%25202024%252016%253A28%253A58%2520GMT%252B0800%2520(%25E4%25B8%25AD%25E5%259B%25BD%25E6%25A0%2587%25E5%2587%2586%25E6%2597%25B6%25E9%2597%25B4)",
-                    "scene": null
-                }
-            ]
+        {
+          "name": "商户端首页",
+          "pathName": "nova-tourism/pages/my/merchant/merchant-home/index",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "我的订单",
+          "pathName": "nova-tourism/pages/my/my-order/index",
+          "query": "active=0",
+          "scene": null
+        },
+        {
+          "name": "退款售后",
+          "pathName": "nova-tourism/pages/my/my-order/my-refund/index",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "退款详细",
+          "pathName": "nova-tourism/pages/my/my-order/my-refund/refund-detail/index",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "民宿订单",
+          "pathName": "nova-tourism/pages/homestay/homestay-order2/index",
+          "query": "objectId=vhyskK4oxw&date_start=Fri%2520Dec%252013%25202024%252016%253A28%253A58%2520GMT%252B0800%2520(%25E4%25B8%25AD%25E5%259B%25BD%25E6%25A0%2587%25E5%2587%2586%25E6%2597%25B6%25E9%2597%25B4)&date_end=Sat%2520Dec%252014%25202024%252016%253A28%253A58%2520GMT%252B0800%2520(%25E4%25B8%25AD%25E5%259B%25BD%25E6%25A0%2587%25E5%2587%2586%25E6%2597%25B6%25E9%2597%25B4)",
+          "scene": null
+        },
+        {
+          "name": "民宿订单",
+          "pathName": "nova-tourism/pages/homestay/homestay-order2/index",
+          "query": "objectId=vhyskK4oxw&date_start=Fri%2520Dec%252013%25202024%252016%253A28%253A58%2520GMT%252B0800%2520(%25E4%25B8%25AD%25E5%259B%25BD%25E6%25A0%2587%25E5%2587%2586%25E6%2597%25B6%25E9%2597%25B4)&date_end=Sat%2520Dec%252014%25202024%252016%253A28%253A58%2520GMT%252B0800%2520(%25E4%25B8%25AD%25E5%259B%25BD%25E6%25A0%2587%25E5%2587%2586%25E6%2597%25B6%25E9%2597%25B4)",
+          "scene": null
         }
+      ]
     }
+  },
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
 }