Answer the question
In order to leave comments, you need to log in
Complex under the request, how to compose it correctly?
DB driver: PostgreSQL
->join('region as region', function ($join) use ($localLang, $userDetails) {
$join->on('songs.restriction_id', '=', 'region.relation_restriction_id')
->where('region.slug', 'ILIKE', '%global%')
->where('songs.restriction_type', '=', 1)
->orWhere('region.slug', 'ILIKE', '%' . $userDetails->region . '%')
->where('songs.restriction_type', '=', 1)
->orWhere('songs.restriction_type', '=', 2)
->where('region.slug', '!ILIKE', 2);????
})
->where('region.slug', 'ILIKE', '%global%')
->where('songs.restriction_type', '=', 1)
->orWhere('region.slug', 'ILIKE', '%' . $userDetails->region . '%')
->where('songs.restriction_type', '=', 1)
->orWhere('songs.restriction_type', '=', 2)
->where('region.slug', '!ILIKE', '%' . $userDetails->region . '%'); ?
->where('region.slug', 'NOT ILIKE', '%' . $userDetails->region . '%'); ?
->where('region.slug', 'NOT LIKE', '%' . $userDetails->region . '%'); ?
? // отфильтровать всю музыку которая запрещена для региона юзера
id | relation_restriction_id | lang | name | slug | descr | timestamps
row = 1 | 233 | en | Global | global-en | descritpion blah blah blah | timestamps
row = 2 | 233 | ru | Всемирная | global-ru | описание | timestamps
row = 3 | 234 | de | Hlobal | global-de | na nemezkom opisanie | timestamps
"SQLSTATE[0A000]: Feature not supported: 7 ERROR: FOR SHARE is not allowed with GROUP BY clause (SQL: select....
SELECT ... FOR UPDATE
or ->sharedLock()
which must also be used in the request. The search example is just an example. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question