{"id":9,"date":"2016-02-15T08:22:36","date_gmt":"2016-02-15T08:22:36","guid":{"rendered":"http:\/\/activities.plekhov.ru\/?p=9"},"modified":"2020-09-01T11:21:20","modified_gmt":"2020-09-01T11:21:20","slug":"%d0%bf%d0%be%d0%b8%d1%81%d0%ba-%d0%b1%d0%bb%d0%b8%d0%b6%d0%b0%d0%b9%d1%88%d0%b8%d1%85-%d1%82%d0%be%d1%87%d0%b5%d0%ba-%d0%bf%d0%be-%d0%ba%d0%be%d0%be%d1%80%d0%b4%d0%b8%d0%bd%d0%b0%d1%82%d0%b0%d0%bc","status":"publish","type":"post","link":"https:\/\/activities.plekhov.ru\/?p=9","title":{"rendered":"\u041f\u043e\u0438\u0441\u043a \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0442\u043e\u0447\u0435\u043a \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c"},"content":{"rendered":"<p><a href=\"http:\/\/zcentric.com\/2010\/03\/11\/calculate-distance-in-mysql-with-latitude-and-longitude\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/zcentric.com\/2010\/03\/11\/calculate-distance-in-mysql-with-latitude-and-longitude\/<\/a><\/p>\n<pre>SELECT office_address, office_coordinates, ((ACOS(SIN($lat * PI() \/ 180) * SIN(lat * PI() \/ 180) + COS($lat * PI() \/ 180) * COS(lat * PI() \/ 180) * COS(($lon - lon) * PI() \/ 180)) * 180 \/ PI()) * 60 * 1.1515) AS `distance` FROM `members` HAVING `distance`<=100 ORDER BY `distance` ASC<\/pre>\n<p>\u0432 yii2:<\/p>\n<pre>\r\n$query->select(\"*, ((ACOS(SIN({$params['lat']} * PI() \/ 180) * SIN(lat * PI() \/ 180) + COS({$params['lat']} * PI() \/ 180) * COS(lat * PI() \/ 180) * COS(({$params['lon']} - lon) * PI() \/ 180)) * 180 \/ PI()) * 60 * 1.1515) AS distance\")\r\n->having(\"distance <= {$params['radius']}\") ->orderBy(\"distance ASC\");<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/zcentric.com\/2010\/03\/11\/calculate-distance-in-mysql-with-latitude-and-longitude\/ SELECT office_address, office_coordinates, ((ACOS(SIN($lat * PI() \/ 180) * SIN(lat * PI() \/ 180) + COS($lat * PI() \/ 180) * COS(lat * PI() \/ 180) * COS(($lon &#8211; lon) * PI() \/ 180)) * 180 \/ PI()) * 60 * 1.1515) AS `distance` FROM `members` HAVING `distance`select(&#8220;*, ((ACOS(SIN({$params[&#8216;lat&#8217;]} * PI() \/ 180) * &hellip; <a href=\"https:\/\/activities.plekhov.ru\/?p=9\" class=\"more-link\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 <span class=\"screen-reader-text\">\u041f\u043e\u0438\u0441\u043a \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0442\u043e\u0447\u0435\u043a \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-aside","hentry","category-mysql","category-yii2","post_format-post-format-aside"],"_links":{"self":[{"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=\/wp\/v2\/posts\/9"}],"collection":[{"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9"}],"version-history":[{"count":7,"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":70,"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions\/70"}],"wp:attachment":[{"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/activities.plekhov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}