将mySQL查询转换为sequelize模型查询

时间:2020-04-14 08:59:11

标签: mysql sequelize.js

我有一个mySQL查询:

SELECT * FROM (SELECT restaurant.id, restaurant.name, restaurant.address, restaurant.phone, restaurant.lat, restaurant.lng, restaurant.image, restaurant.payment_url, ROUND(111.045 * DEGREES(ACOS(COS(RADIANS(30.3298)) * COS(RADIANS(restaurant.lat)) * COS(RADIANS(-81.4860) - RADIANS(restaurant.lng)) + SIN(RADIANS(restaurant.lat)) * SIN(RADIANS(30.3298)))), 2) AS distance_in_km FROM restaurant) AS d WHERE d.distance_in_km < 10

我想将其转换为序列模型名称为Restaurant的序列模型查询

0 个答案:

没有答案