Welcome Guest, Not a member yet? Register   Sign In
Soft delete doesn't work with like?
#5

(This post was last modified: 11-02-2019, 07:36 AM by edica.)

Sorry if I'm wrong with something. : /


PHP Code:
$list = ['title' => $q'slug' => $q'body' => $q];
$model->orLike($list)->paginate(5


Using orLike() with paginate() generate the sql below:
But shows deleted.


Code:
SELECT COUNT(*) AS `numrows`
FROM `news`
WHERE `title` LIKE '%test%' ESCAPE '!'
OR  `slug` LIKE '%test%' ESCAPE '!'
OR  `body` LIKE '%test%' ESCAPE '!'
AND `news`.`deleted_at` IS NULL


In parentheses, it would work well.  Undecided

WHERE (`title` LIKE '%teste%' ESCAPE '!'
OR  `slug` LIKE '%teste%' ESCAPE '!'
OR  `body` LIKE '%teste%' ESCAPE '!')
AND (`news`.`deleted_at` IS NULL)
Reply


Messages In This Thread
Soft delete doesn't work with like? - by edica - 10-29-2019, 07:51 AM
RE: Soft delete doesn't work with like? - by edica - 11-02-2019, 06:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB