model Itemype added
This commit is contained in:
parent
adb2f60fef
commit
29c75d3d8d
|
@ -8,6 +8,7 @@
|
|||
<div><span translate>Category</span>: <b>{{$ctrl.item.category}}</b></div>
|
||||
<div><span translate>Description</span>: <b>{{$ctrl.item.description}}</b></div>
|
||||
<div><span translate>Size</span>: <b>{{$ctrl.item.size}}</b></div>
|
||||
<div><span translate>Type</span>: <b>{{$ctrl.item.itemType.name}}</b></div>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</a>
|
||||
|
|
|
@ -6,13 +6,13 @@ module.exports = Self => {
|
|||
where: {},
|
||||
skip: (params.page - 1) * params.size,
|
||||
limit: params.size,
|
||||
order: params.order || 'relevancy DESC'/* ,
|
||||
order: params.order || 'relevancy DESC',
|
||||
include: {
|
||||
relation: "greugeType",
|
||||
relation: "itemType",
|
||||
scope: {
|
||||
fields: ["id", "name"]
|
||||
}
|
||||
} */
|
||||
}
|
||||
};
|
||||
|
||||
return filter;
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "ItemType",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "itemType",
|
||||
"database": "vn"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"name": {
|
||||
"type": "String"
|
||||
},
|
||||
"life": {
|
||||
"type": "Number"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -40,5 +40,12 @@
|
|||
"image": {
|
||||
"type": "String"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"itemType": {
|
||||
"type": "belongsTo",
|
||||
"model": "ItemType",
|
||||
"foreignKey": "typeFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,6 +26,8 @@
|
|||
},
|
||||
"Item": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ItemType": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue