BK
Size: a a a
BK
A
BK
BK
BK
module.exports = (sequelize, DataTypes) => {
return sequelize.define(
'sirket',
{
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true},
companyId: {
field: 'sirket_id',
type: DataTypes.STRING,
allowNull: false,
},
categoryId: {
field: 'kat_id',
type: DataTypes.INTEGER,
allowNull: false,
},
userId: {
field: 'kul_id',
type: DataTypes.INTEGER,
},
cityId: {
field: 'il_id',
type: DataTypes.INTEGER,
},
countyId: {
field: 'ilce_id',
type: DataTypes.INTEGER,
},
name: {
field: 'sirket_ad',
type: DataTypes.STRING,
allowNull: false,
},
lat: {
field: 'koor_x',
type: DataTypes.FLOAT,
allowNull: false},
long: {
field: 'koor_y',
type: DataTypes.FLOAT,
allowNull: false},
adress: {
field: 'sirket_adres',
type: DataTypes.STRING,
},
dealer: {
field: 'bayi',
type: DataTypes.INTEGER,
},
distance: {
type: DataTypes.VIRTUAL,
get: function (key, options) {
// const lat = this.getDataValue('lat');
//console.log("LONGITUDE, ", longitude)
//console.log(sequelize.getContext()),
console.log(this);
return ""
}
}
},
{
timestamps: false,
freezeTableName: true}
)
};BK
models.sirket.get({plain:true,apiVersion:2});
return models.sirket.findAll({
limit: parseInt(args.limit),
order: [["name", "desc"]],
})BK
BK
A
koor_x instead of lat in const lat = this.getDataValue('lat'); ?BK
BK
BK
models.sirket.findAll({
limit: parseInt(args.limit),
order: [["name", "desc"]],
})BK
BK
YZ
module.exports = (sequelize, DataTypes) => {
return sequelize.define(
'sirket',
{
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true},
companyId: {
field: 'sirket_id',
type: DataTypes.STRING,
allowNull: false,
},
categoryId: {
field: 'kat_id',
type: DataTypes.INTEGER,
allowNull: false,
},
userId: {
field: 'kul_id',
type: DataTypes.INTEGER,
},
cityId: {
field: 'il_id',
type: DataTypes.INTEGER,
},
countyId: {
field: 'ilce_id',
type: DataTypes.INTEGER,
},
name: {
field: 'sirket_ad',
type: DataTypes.STRING,
allowNull: false,
},
lat: {
field: 'koor_x',
type: DataTypes.FLOAT,
allowNull: false},
long: {
field: 'koor_y',
type: DataTypes.FLOAT,
allowNull: false},
adress: {
field: 'sirket_adres',
type: DataTypes.STRING,
},
dealer: {
field: 'bayi',
type: DataTypes.INTEGER,
},
distance: {
type: DataTypes.VIRTUAL,
get: function (key, options) {
// const lat = this.getDataValue('lat');
//console.log("LONGITUDE, ", longitude)
//console.log(sequelize.getContext()),
console.log(this);
return ""
}
}
},
{
timestamps: false,
freezeTableName: true}
)
};BK
BK
YZ
BK
YZ