T
T
teodor7teodor72017-12-26 16:50:12
WordPress
teodor7teodor7, 2017-12-26 16:50:12

What is the best way to organize a complex structure in Yii2?

It is necessary to make a complex filter and build a structure.
The structure includes excursions, region, type of belet (children, adults). What is the best way to do it, for example, a person chooses the type of excursion, the region of departure, then the type of ticket for children or adults, after which the price is formed.
What is the best way to structure. For example, through a linked table that will store the trip, region, ticket type and assigned cost with three values.
In turn, there will be several more tables that will store whether there is a particular ticket for a particular excursion.
How would you organize?
Is it possible to use nested sets ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Sobolev, 2019-10-18
@ivan99

Can.
If there is little skill in WP, look towards the Advanced Custom Fields (ACF) plugin .
If you are sure - write a CPT with "limited" support, and create a meta_box with the fields you need.
Example poured on codepen

A
Artem, 2017-12-26
@proudmore

EcHuF7YFvms.jpg
But there is no data about who bought the ticket, only the fact of purchase is stored. If it is necessary to store who bought the ticket, then the customers table is added, is_sold is removed from the ticket, and customer_id with a foreign key is added to the customers table.
The tables, of course, will still need to be supplemented, but here I won’t tell you anything without knowing the details of the task

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question