提交 8b45e0b0 编写于 作者: d-u-a's avatar d-u-a

update: <unicloud-db> 增加属性 groupby,group-field,distinct

上级 3f22f744
......@@ -29,7 +29,10 @@ const attrs = [
'field',
'getcount',
'orderby',
'where'
'where',
'groupby',
'groupField',
'distinct'
]
export default {
......@@ -96,6 +99,18 @@ export default {
manual: {
type: Boolean,
default: false
},
groupby: {
type: String,
default: ''
},
groupField: {
type: String,
default: ''
},
distinct: {
type: [Boolean, String],
default: false
}
},
data () {
......@@ -380,6 +395,15 @@ export default {
if (this.field) {
db = db.field(this.field)
}
if (this.groupby) {
db = db.groupby(this.groupby)
}
if (this.groupField) {
db = db.groupField(this.groupField)
}
if (this.distinct === true) {
db = db.distinct()
}
if (this.orderby) {
db = db.orderBy(this.orderby)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册