shop.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. 'use strict';
  2. import mongoose from 'mongoose'
  3. const shopSchema = new mongoose.Schema({
  4. activities: [{
  5. description: String,
  6. icon_color: String,
  7. icon_name: String,
  8. id: Number,
  9. name: String,
  10. }],
  11. address: String,
  12. delivery_mode: {
  13. color: String,
  14. id: Number,
  15. is_solid: Boolean,
  16. text: String
  17. },
  18. description: { type: String, default: "" },
  19. order_lead_time: { type: String, default: "" },
  20. distance: { type: String, default: "" },
  21. location:{type:[Number],index: '2d'},
  22. float_delivery_fee: { type: Number, default: 0 },
  23. float_minimum_order_amount: { type: Number, default: 0 },
  24. id: Number,
  25. category: String,
  26. identification: {
  27. company_name: { type: String, default: "" },
  28. identificate_agency: { type: String, default: "" },
  29. identificate_date: { type: Date, default: Date.now },
  30. legal_person: { type: String, default: "" },
  31. licenses_date: { type: String, default: "" },
  32. licenses_number: { type: String, default: "" },
  33. licenses_scope: { type: String, default: "" },
  34. operation_period: { type: String, default: "" },
  35. registered_address: { type: String, default: "" },
  36. registered_number: { type: String, default: "" },
  37. },
  38. image_path: { type: String, default: "" },
  39. is_premium: { type: Boolean, default: false },
  40. is_new: { type: Boolean, default: false },
  41. latitude: Number,
  42. longitude: Number,
  43. license: {
  44. business_license_image: { type: String, default: "" },
  45. catering_service_license_image: { type: String, default: "" },
  46. },
  47. name: {
  48. type: String,
  49. required: true
  50. },
  51. opening_hours: { type: Array, default: ["08:30/20:30"] },
  52. phone: {
  53. type: String,
  54. required: true
  55. },
  56. piecewise_agent_fee: {
  57. tips: String
  58. },
  59. promotion_info: { type: String, default: "欢迎光临,用餐高峰请提前下单,谢谢" },
  60. rating: { type: Number, default: 0 },
  61. rating_count: { type: Number, default: 0 },
  62. recent_order_num: { type: Number, default: 0 },
  63. status: { type: Number, default: 0 },
  64. supports: [{
  65. description: String,
  66. icon_color: String,
  67. icon_name: String,
  68. id: Number,
  69. name: String
  70. }],
  71. });
  72. shopSchema.index({ id: 1 });
  73. const Shop = mongoose.model('Shop', shopSchema);
  74. export default Shop