|
@@ -30,7 +30,7 @@ module.exports = async (dbName='shop') => {
|
|
|
|
|
|
static get relations(){
|
|
static get relations(){
|
|
return {
|
|
return {
|
|
- categories: "goods",
|
|
|
|
|
|
+ categories: ["goods"],
|
|
orderGoods: "good",
|
|
orderGoods: "good",
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -45,7 +45,7 @@ module.exports = async (dbName='shop') => {
|
|
|
|
|
|
static get relations(){
|
|
static get relations(){
|
|
return {
|
|
return {
|
|
- goods: "categories",
|
|
|
|
|
|
+ goods: ["categories"],
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -54,7 +54,7 @@ module.exports = async (dbName='shop') => {
|
|
class Order extends SlicedSavable {
|
|
class Order extends SlicedSavable {
|
|
constructor(...params){
|
|
constructor(...params){
|
|
super(...params)
|
|
super(...params)
|
|
- this.orderGoods = this.orderGoods instanceof Array ? this.orderGoods : (this.orderGoods ? [this.orderGoods] : [])
|
|
|
|
|
|
+ this.orderGoods = Savable.arrize(this.orderGoods)
|
|
}
|
|
}
|
|
|
|
|
|
get total(){
|
|
get total(){
|
|
@@ -63,7 +63,7 @@ module.exports = async (dbName='shop') => {
|
|
|
|
|
|
static get relations(){
|
|
static get relations(){
|
|
return {
|
|
return {
|
|
- user: "orders",
|
|
|
|
|
|
+ user: ["orders"],
|
|
orderGoods: "order"
|
|
orderGoods: "order"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -81,8 +81,8 @@ module.exports = async (dbName='shop') => {
|
|
|
|
|
|
static get relations(){
|
|
static get relations(){
|
|
return {
|
|
return {
|
|
- good: "orderGoods",
|
|
|
|
- order: "orderGoods"
|
|
|
|
|
|
+ good: ["orderGoods"],
|
|
|
|
+ order: ["orderGoods"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|