M
M
My joy2018-03-14 18:24:40
Yii
My joy, 2018-03-14 18:24:40

How to search by calculated fields?

Hi friends.
there is a table with orders:

id, date, fio, phone
================
10, ...., Иванов, +7929...

and there is a table with an order basket:
id, order_id, sku, amount
====================
1, 10, esenin, 2
2, 10, pushkin, 1
3, 11, orwell, 5

in GridView it looks like this:
ID, ФИО, ЗАКАЗ
==============
10, Иванов, 2esenin 1pushkin

those. Ivanov has 3 items in his cart, including 2 books by Yesenin and 1 book by Pushkin.
Question: how can I implement a search by the ORDER field if it is a text field, and the data is actually stored in different rows of a separate table? After all, the usual like here, unfortunately, will not work.
How to make the search for the phrase "pushkin" or "5esenin" work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-03-14
@webinar

www.yiiframework.com/wiki/621/filter-sort-by-calcu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question