donglong2856 2013-07-04 15:35
浏览 31

多租户申请中的注册和邀请?

I'm trying to create a multi-tenant application where there are Buyer and Seller companies, but having a hard time findig out how to store and associate companies with each other. This is a shared multi-tenant architecture having a single database and shared tables with "company_id" FK column in every table. I use PHP and mySQL, and would like to create this in Laravel 4 framework with Eloquent ORM. I'm new to Laravel.

  • Both Buyers and Sellers can can have many users. Both can invite each other to the application. After this, they can place order, and invoice the other party.
  • Both parties can add the other party on their own partner list before invitation. This way, for example Sellers can add orders and create invoice for Buyers that don't want to register and place order for themselves.
  • Also there will be occasional buyers that are not invited, and placing orders through Sellers' shopping cart (seller.myapp.com/products) that is connected to the application and lists the products of only that particular seller. So these buyers will register through this seller.

I'm confused how the invitation, registration, and adding companies manually can work together when it comes to storing and associating parties. For example when a Seller adds a Buyer to their own list and also invites buyer, buyer needs to login under that particular seller's account in order to see orders and invoices related to that seller. But Buyer can be added and invited by many Sellers. It creates a problem: How can buyer see all his orders from those different sellers together without login in to each seller's account?

Or if choose the approach where Buyer registers a new, separate account (not under inviter's account) after invitation, how can this new account be associated with his company data on Seller's side?

What is the best approach? I'm interested in the database-structure and how the relations should look like. This is not about party model.

Thank you

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?