lrf 2 år sedan
förälder
incheckning
96bdf5d4a4

app/controller/system/config/.serviceContace.js → app/controller/system/config/.serviceContact.js


+ 0 - 13
app/controller/system/serviceContace.js

@@ -1,13 +0,0 @@
-'use strict';
-const meta = require('./config/.serviceContace.js');
-const Controller = require('egg').Controller;
-const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
-
-// 
-class ServiceContaceController extends Controller {
-  constructor(ctx) {
-    super(ctx);
-    this.service = this.ctx.service.system.serviceContace;
-  }
-}
-module.exports = CrudController(ServiceContaceController, meta);

+ 13 - 0
app/controller/system/serviceContact.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./config/.serviceContact.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
+
+//
+class ServiceContactController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.system.serviceContact;
+  }
+}
+module.exports = CrudController(ServiceContactController, meta);

app/model/system/serviceContace.js → app/model/system/serviceContact.js


+ 5 - 5
app/service/system/serviceContace.js

@@ -4,12 +4,12 @@ const { BusinessError, ErrorCode } = require('naf-core').Error;
 const _ = require('lodash');
 const assert = require('assert');
 
-// 
-class ServiceContaceService extends CrudService {
+//
+class ServiceContactService extends CrudService {
   constructor(ctx) {
-    super(ctx, 'servicecontace');
-    this.model = this.ctx.model.System.ServiceContace;
+    super(ctx, 'servicecontact');
+    this.model = this.ctx.model.System.ServiceContact;
   }
 }
 
-module.exports = ServiceContaceService;
+module.exports = ServiceContactService;

+ 0 - 14
app/service/view/shop.js

@@ -3,7 +3,6 @@ const { CrudService } = require('naf-framework-mongoose-free/lib/service');
 const { BusinessError, ErrorCode } = require('naf-core').Error;
 const _ = require('lodash');
 const assert = require('assert');
-const { pipeline } = require('stream');
 
 // 店铺类视图
 class ShopService extends CrudService {
@@ -14,19 +13,6 @@ class ShopService extends CrudService {
 
   // 微店页面查询
   async microIndex(condition, options) {
-    // const pipline = [{ $sort: { 'meta.createdAt': -1 } }];
-    // pipline.push({ $project: { name: 1, file: 1 } });
-    // pipline.push({ $addFields: { shop_id: { $toString: '$_id' } } });
-    // // 表关联
-    // pipline.push({
-    //   $lookup: {
-    //     from: 'goods',
-    //     localField: 'shop_id',
-    //     foreignField: 'shop',
-    //     as: 'goods',
-    //   },
-    // });
-    // const list = await this.model.aggregate(pipline);
     let list = await this.ctx.service.shop.shop.query(condition, { ...options, projection: [ 'name', 'logo' ] });
     list = JSON.parse(JSON.stringify(list));
     const arr = [];

+ 1 - 1
app/z_router/system/index.js

@@ -4,6 +4,6 @@
 module.exports = app => {
   require('./banner')(app); // 广告图
   require('./indexModule')(app); // 图标菜单
-  require('./serviceContace')(app); // 客服信息
+  require('./serviceContact')(app); // 客服信息
   require('./goodsTags')(app); // 商品标签
 };

+ 2 - 2
app/z_router/system/serviceContace.js

@@ -3,8 +3,8 @@
 const path = require('path');
 const regPath = path.resolve('app', 'public', 'routerRegister');
 const routerRegister = require(regPath);
-const rkey = 'serviceContace';
-const ckey = 'system.serviceContace';
+const rkey = 'serviceContact';
+const ckey = 'system.serviceContact';
 const keyZh = '客服信息';
 const routes = [
   { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },