| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 | 
							
- /**
 
-  * Created by MyPC on 2019/11/5.
 
-  */
 
- 'use strict';
 
- const hash= require('../class/hash');
 
- const Sequelize = require('sequelize');
 
- const Op = Sequelize.Op;
 
- module.exports = (sequelize, DataTypes) => {
 
-     const clientStaff = sequelize.define('CLD_client_staff', {
 
-         csid  : {type: DataTypes.INTEGER(11), primaryKey: true, autoIncrement: true},
 
-         sid: DataTypes.INTEGER,
 
-         cid: DataTypes.INTEGER,
 
-     }, {});
 
-     /*
 
-      * 根据ID合集获得客户信息
 
-      * */
 
-     clientStaff.findByCid=async function(cid,attributes){
 
-         /*if(!hash.isNotANumber(cid)){
 
-             cid=hash.hashDecode(cid);
 
-             if(!hash.isNotANumber(cid)){
 
-                 return [];
 
-             }
 
-         }
 
-         if(hash.isExistence(attributes)){
 
-             condition.attributes=attributes;
 
-         }
 
-         var condition={
 
-             raw:true,
 
-             where: {
 
-                 cid: cid
 
-             }};
 
-         var detail = await this.findOne(condition);
 
-         if(!hash.isExistence(detail)){
 
-             return [];
 
-         }
 
-         detail.cid=hash.hashEncode(detail.cid.toString());
 
-         detail.sid=hash.hashEncode(detail.sid.toString());
 
-         detail.csid=hash.hashEncode(detail.csid.toString());
 
-         return detail;*/
 
-     };
 
-     /*
 
-      * 根据ID获得客户信息
 
-      * */
 
-     clientStaff.findById=async function(cid,attributes){
 
-         if(!hash.isNotANumber(cid)){
 
-             cid=hash.hashDecode(cid);
 
-             if(!hash.isNotANumber(cid)){
 
-                 return [];
 
-             }
 
-         }
 
-         if(hash.isExistence(attributes)){
 
-             condition.attributes=attributes;
 
-         }
 
-         var condition={
 
-             raw:true,
 
-             where: {
 
-                 cid: cid
 
-             }};
 
-         var detail = await this.findOne(condition);
 
-         if(!hash.isExistence(detail)){
 
-             return [];
 
-         }
 
-         detail.cidKey=hash.hashEncode(detail.cid.toString());
 
-         detail.cid=hash.hashEncode(detail.cid.toString());
 
-         return detail;
 
-     };
 
-     return clientStaff;
 
- };
 
 
  |