|  | @@ -958,12 +958,12 @@ module.exports = app => {
 | 
	
		
			
				|  |  |           * @private
 | 
	
		
			
				|  |  |           */
 | 
	
		
			
				|  |  |          async _syncUplevelChildren(options, select, transaction = null) {
 | 
	
		
			
				|  |  | -            const children = await this.getDataByFullPath(options, select[this.setting.fullPath] + '-%');
 | 
	
		
			
				|  |  | -            if (this._.findIndex(children, function (item) {
 | 
	
		
			
				|  |  | -                return item.c_code;
 | 
	
		
			
				|  |  | -            }) !== -1) {
 | 
	
		
			
				|  |  | -                throw '存在合同节点不可升级';
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | +            // const children = await this.getDataByFullPath(options, select[this.setting.fullPath] + '-%');
 | 
	
		
			
				|  |  | +            // if (this._.findIndex(children, function (item) {
 | 
	
		
			
				|  |  | +            //     return item.c_code;
 | 
	
		
			
				|  |  | +            // }) !== -1) {
 | 
	
		
			
				|  |  | +            //     throw '存在合同节点不可升级';
 | 
	
		
			
				|  |  | +            // }
 | 
	
		
			
				|  |  |              // this.initSqlBuilder();
 | 
	
		
			
				|  |  |              // this.sqlBuilder.setAndWhere(this.setting.mid, {
 | 
	
		
			
				|  |  |              //     value: select[this.setting.mid],
 | 
	
	
		
			
				|  | @@ -987,6 +987,7 @@ module.exports = app => {
 | 
	
		
			
				|  |  |                  'WHERE ' + this.ctx.helper._getOptionsSql(options) + ' AND ' + this.setting.fullPath + ' LIKE ?';
 | 
	
		
			
				|  |  |              const sqlParam = [this.tableName, select[this.setting.fullPath] + '-%'];
 | 
	
		
			
				|  |  |              const data = transaction ? await transaction.query(sql, sqlParam) : await this.db.query(sql, sqlParam);
 | 
	
		
			
				|  |  | +            transaction ? await transaction.query(sql, [this.ctx.service.contract.tableName, select[this.setting.fullPath] + '-%']) : await this.db.query(sql, [this.ctx.service.contract.tableName, select[this.setting.fullPath] + '-%']);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              return data;
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -999,12 +1000,12 @@ module.exports = app => {
 | 
	
		
			
				|  |  |           * @private
 | 
	
		
			
				|  |  |           */
 | 
	
		
			
				|  |  |          async _syncDownlevelChildren(options, select, newFullPath, transaction = null) {
 | 
	
		
			
				|  |  | -            const children = await this.getDataByFullPath(options, select[this.setting.fullPath] + '-%');
 | 
	
		
			
				|  |  | -            if (this._.findIndex(children, function (item) {
 | 
	
		
			
				|  |  | -                return item.c_code;
 | 
	
		
			
				|  |  | -            }) !== -1) {
 | 
	
		
			
				|  |  | -                throw '存在合同节点不可降级';
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | +            // const children = await this.getDataByFullPath(options, select[this.setting.fullPath] + '-%');
 | 
	
		
			
				|  |  | +            // if (this._.findIndex(children, function (item) {
 | 
	
		
			
				|  |  | +            //     return item.c_code;
 | 
	
		
			
				|  |  | +            // }) !== -1) {
 | 
	
		
			
				|  |  | +            //     throw '存在合同节点不可降级';
 | 
	
		
			
				|  |  | +            // }
 | 
	
		
			
				|  |  |              // this.initSqlBuilder();
 | 
	
		
			
				|  |  |              // this.sqlBuilder.setAndWhere(this.setting.mid, {
 | 
	
		
			
				|  |  |              //     value: select[this.setting.mid],
 | 
	
	
		
			
				|  | @@ -1028,6 +1029,7 @@ module.exports = app => {
 | 
	
		
			
				|  |  |                  'WHERE ' + this.ctx.helper._getOptionsSql(options) + ' AND ' + this.setting.fullPath + ' LIKE ?';
 | 
	
		
			
				|  |  |              const sqlParam = [this.tableName, select[this.setting.fullPath] + '-%'];
 | 
	
		
			
				|  |  |              const data = transaction ? await transaction.query(sql, sqlParam) : await this.db.query(sql, sqlParam);
 | 
	
		
			
				|  |  | +            transaction ? await transaction.query(sql, [this.ctx.service.contract.tableName, select[this.setting.fullPath] + '-%']) : await this.db.query(sql, [this.ctx.service.contract.tableName, select[this.setting.fullPath] + '-%']);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              return data;
 | 
	
		
			
				|  |  |          }
 |