dongyou5098 2019-02-18 11:52
浏览 57

需要在php中重建基于mysql的用户/组织/发布位置搜索目录。 Laravel是否适合这个?

I need to completely rebuild/refactor a small directory/info service I run for blind people; it's too complex to maintain having been built in 2013, based on a now-deprecated thing called php-mini, last updated in 2015.

As it's not a commercial project, there's no advertising and no charge for users, this needs to be as affordable and boilerplate/bootstrap/turnkey as possible. I'm thinking Laravel or something based on it? Or something I've missed? I'm comfortable with PHP and MySQL but I've spent the weekend trying to find the closest match and there are many choices, including a bewildering array of Laravel packages, but I feel I've missed something in my searching which might help. So...

Here's what my service currently looks like: https://find.talking-news.info. Yes, back in the day, that was REALLY good for people with screen readers. Now it's an embarrassment.

How it currently works

  • User types of town OR service name (one search box).
  • If it matches a service name, show the service and other services nearby.
  • If it matches a town name, then show service names within 20 miles.
  • Allow clicking on results to display organization and service details, via an accessible page.

What I need

  • Very simple CRUD backend that users log into and make changes - simple data plus a few toggles/tickboxes.
  • 2 users levels - admin or user.
  • Some JSON REST stuff to pull data from MYSQL RDB
  • A user can run multiple organisations, the organisations can have multiple publications.
  • Just 3 tables - users, publications and services - nothing more complex than users.userID <-> organisations.userID <-> publications.organisationID
  • A front end which consists off pulling a few DB queries and reading a couple of static files - currently, Twig 1 and Bootstrap 3 is used to render the output.
  • An enquiry form which sends emails - I currently use PHPMailer with a Gmail SMTP connection.

For search results, I used a jaro-winkler-similarity mysql routine so that someone typing "macnhester" would get "manchester" rather than no result. https://packagist.org/packages/fza/mysql-doctrine-jaro-winkler-function

For the "nearest" results, I use SELECT *, 69 * DEGREES( ACOS( COS( RADIANS( latpoint ) ) * COS( RADIANS( lat ) ) * COS( RADIANS( longpoint ) - RADIANS( lng ) ) + SIN( RADIANS( latpoint ) ) * SIN( RADIANS( lat ) ) ) ) AS distance_in_miles FROM services JOIN (SELECT :lat AS latpoint, :lng AS longpoint) AS p ORDER BY distance_in_miles LIMIT 10

This means geocoding everything and storing it in my DB.

Does a public API or SaaS already exist?

  • Where I could upload the service id and address (or just UK postcode or lat/long), and it would return a list of IDs and distance.
  • I could pull the remaining data from my DB based on the returned IDs.
  • Low usage, preferably free. 500 queries a day would be more than enough.

I would have thought Google Maps API would have this by now, but apparently not unless I'm missing something?

Finally, I see a lot of questions like this are closed with "not enough detail", or simply pointed to https://stackoverflow.com/questions/838028/choosing-the-right-php-framework and then closed. However, that page now doesn't exist and would be rather generic. Thanks!

  • 写回答

1条回答 默认 最新

  • douji9184 2019-02-18 12:04
    关注

    You can use almost any framework for every task (in PHP). Any of them has its own advantages and disadvantes.

    The ones I know are:

    • Laravel
    • Symfony
    • Slim
    • CakePHP
    • Codeiginiter

    And all will do the job.
    Symfony and Laravel have large community support and premade bundles components like admin panels, login etc. which can help you start your project.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度