| | |
| | | |
| | | let _search = '' |
| | | |
| | | if (setting.queryType === 'statistics' && _dataresource) { // 统计数据源,内容替换 |
| | | if (_dataresource) { |
| | | if (setting.queryType === 'statistics') { // 统计数据源,内容替换 |
| | | regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | }) |
| | | } else if (_dataresource && !id) { |
| | | if (id) { |
| | | _dataresource = _dataresource + ` where ${setting.primaryKey || 'ID'}='${id}'` |
| | | } |
| | | } else if (!id) { |
| | | _search = Utils.joinMainSearchkey(search) |
| | | if (_search) { |
| | | _search = 'where ' + _search |
| | | } |
| | | } else if (_dataresource && id) { |
| | | } else if (id) { |
| | | _search = Utils.joinMainSearchkey(search) |
| | | _search = `where ${_search ? _search + ' AND ' : ''} ${setting.primaryKey || 'ID'}='${id}'` |
| | | } |
| | | } |
| | | |
| | | if (_customScript) { |
| | | regoptions.forEach(item => { |