|
|
@ -2378,7 +2378,7 @@ class BaseModelSqlv2 { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async bulkUpdateAll( |
|
|
|
async bulkUpdateAll( |
|
|
|
args: { where?: string; filterArr?: Filter[] } = {}, |
|
|
|
args: { where?: string; filterArr?: Filter[]; viewId?: string } = {}, |
|
|
|
data, |
|
|
|
data, |
|
|
|
{ cookie }: { cookie?: any } = {}, |
|
|
|
{ cookie }: { cookie?: any } = {}, |
|
|
|
) { |
|
|
|
) { |
|
|
@ -2400,22 +2400,30 @@ class BaseModelSqlv2 { |
|
|
|
const aliasColObjMap = await this.model.getAliasColObjMap(); |
|
|
|
const aliasColObjMap = await this.model.getAliasColObjMap(); |
|
|
|
const filterObj = extractFilterFromXwhere(where, aliasColObjMap); |
|
|
|
const filterObj = extractFilterFromXwhere(where, aliasColObjMap); |
|
|
|
|
|
|
|
|
|
|
|
await conditionV2( |
|
|
|
const conditionObj = [ |
|
|
|
[ |
|
|
|
new Filter({ |
|
|
|
new Filter({ |
|
|
|
children: args.filterArr || [], |
|
|
|
children: args.filterArr || [], |
|
|
|
is_group: true, |
|
|
|
is_group: true, |
|
|
|
logical_op: 'and', |
|
|
|
logical_op: 'and', |
|
|
|
}), |
|
|
|
}), |
|
|
|
new Filter({ |
|
|
|
|
|
|
|
children: filterObj, |
|
|
|
|
|
|
|
is_group: true, |
|
|
|
|
|
|
|
logical_op: 'and', |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (args.viewId) { |
|
|
|
|
|
|
|
conditionObj.push( |
|
|
|
new Filter({ |
|
|
|
new Filter({ |
|
|
|
children: filterObj, |
|
|
|
children: |
|
|
|
|
|
|
|
(await Filter.rootFilterList({ viewId: args.viewId })) || [], |
|
|
|
is_group: true, |
|
|
|
is_group: true, |
|
|
|
logical_op: 'and', |
|
|
|
|
|
|
|
}), |
|
|
|
}), |
|
|
|
], |
|
|
|
); |
|
|
|
qb, |
|
|
|
} |
|
|
|
this.dbDriver, |
|
|
|
|
|
|
|
); |
|
|
|
await conditionV2(conditionObj, qb, this.dbDriver); |
|
|
|
|
|
|
|
|
|
|
|
qb.update(updateData); |
|
|
|
qb.update(updateData); |
|
|
|
|
|
|
|
|
|
|
|