Browse Source

Companyuser,认证,修改

chen 5 years ago
parent
commit
93989dcaa3

+ 4 - 1
app/controller/.companyuser.js

@@ -3,7 +3,8 @@ module.exports = {
     requestBody: [
       '!phone',
       '!passwd',
-      '!company_name',
+      'company_name',
+      '!person',
       'institution_name',
       'roles'
     ]
@@ -18,6 +19,7 @@ module.exports = {
       'phone',
       'passwd',
       'company_name',
+      'person',
       'institution_name',
       'roles'
     ]
@@ -34,6 +36,7 @@ module.exports = {
         phone:'phone',
         passwd :'passwd',
         company_name :'%company_name%',
+        person :'%person%',
         institution_name:'institution_name',
         roles: 'roles'
       }

+ 1 - 1
app/model/companyidentify.js

@@ -15,7 +15,7 @@ const CompanyidentifySchema = {
   establish_date: { type: String, required: true, maxLength: 200 }, // 成立日期             必填
   valid_period: { type: String, required: true, maxLength: 200 }, //    公司营业期限终止日期      "长期"表示为"29991231"
   person: { type: String, required: true, maxLength: 200 }, //      法定代表人      必填
-  status: { type: String, required: false, maxLength: 200, default: '0' }, // 认证状态,0-认证中,1-认证通过,2-认证失败
+  status: { type: String, required: false, maxLength: 200, default: '1' }, // 认证状态,0-认证中,1-认证通过,2-认证失败  改为默认认证通过
 
   // business_license: { type: String, required: false, maxLength: 200 }, // 营业执照图片
   // establish_date: { type: String, required: false, maxLength: 200 }, // 成立日期

+ 2 - 1
app/model/companyuser.js

@@ -7,7 +7,8 @@ const { Secret } = require('naf-framework-mongoose/lib/model/schema');
 const CompanyuserSchema = {
   phone: { type: String, required: true, maxLength: 100 }, // 手机
   passwd: { type: { Secret }, select: false }, // 注册密码
-  company_name: { type: String, required: true, maxLength: 200 }, // 企业名称
+  company_name: { type: String, required: false, maxLength: 200 }, // 企业名称
+  person: { type: String, required: true, maxLength: 200 }, // 联系人姓名
   institution_name: { type: String, required: false, maxLength: 200 }, // 推荐单位名称
   roles: { type: String, required: false, maxLength: 200, default: '0' }, // 企业用户权限,0-注册(只可浏览),1-认证(可申请),2-上传财务信息(皆可)
 };

+ 2 - 2
app/service/companyuser.js

@@ -16,8 +16,8 @@ class CompanyuserService extends CrudService {
   }
   // 重写创建方法
   async create(data) {
-    const { phone, passwd, company_name, institution_name, roles } = data;
-    assert(company_name && phone && passwd, '缺少部分信息项');
+    const { phone, passwd, company_name, person, institution_name, roles } = data;
+    assert(person && phone && passwd, '缺少部分信息项');
     assert(/^\d{11}$/i.test(phone), 'phone无效');
     const user = await this.model.findOne({ phone });
     if (user) {

+ 1 - 12
app/service/intelligentDocking.js

@@ -199,6 +199,7 @@ class IntelligentDockingService extends CrudService {
             cid: { $toObjectId: '$cid' },
             uid: '$uid',
             xqId: { $toString: '$_id' },
+            time: '$meta.createdAt',
           },
       },
       { $lookup:
@@ -255,18 +256,6 @@ class IntelligentDockingService extends CrudService {
       { $unwind: '$dictionary' },
       { $unwind: { path: '$follow', preserveNullAndEmptyArrays: true } },
       { $unwind: { path: '$when', preserveNullAndEmptyArrays: true } },
-      // { $project:
-      //     {
-      //       id: '$_id',
-      //       jg_id: '$jg_id',
-      //       cid: '$cid',
-      //       uid: '$uid',
-      //       companyName: '$company.company_name',
-      //       institutionName: '$institution.name',
-      //       product: '$finance_claims.name',
-      //       time: '$meta.createdAt',
-      //     },
-      // },
       { $skip: (skip - 1) * limit },
       { $limit: limit },
       { $sort: { time: -1 } },