diff options
| author | Zach DeCook <zachdecook@librem.one> | 2023-01-10 13:00:40 +0000 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2023-01-10 13:00:40 +0000 |
| commit | 653a6c4db19efbbd72c39e7723b06d6ce8291f1a (patch) | |
| tree | a2b59780f7db4f1b52fa68a2f3843cc4d4944c04 /laravel/app | |
| parent | 8af58ae9f433f6d6d881e77f9128f77ea9deba19 (diff) | |
| download | prosongsa-653a6c4db19efbbd72c39e7723b06d6ce8291f1a.tar.gz | |
Song: Fix searching for "Psalms" => "Psalm"
Diffstat (limited to 'laravel/app')
| -rw-r--r-- | laravel/app/Song.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/laravel/app/Song.php b/laravel/app/Song.php index e2f2589..c4722a2 100644 --- a/laravel/app/Song.php +++ b/laravel/app/Song.php @@ -18,10 +18,8 @@ class Song extends Model $parser = new BiblePassageParser(); // Can throw an exception. $refs = $parser->parse($passage); - $book = (string)($refs[0]->from()->book()); - $chapter = $refs[0]->from()->chapter(); - - return Song::where('verse', 'LIKE', "$book $chapter:%")->orWhere('verse',"$book $chapter")->orWhere('verse', 'LIKE', "%; $book $chapter:%"); + $bc = explode(':', $refs[0])[0]; + return Song::where('verse', 'LIKE', "$bc:%")->orWhere('verse',"$bc")->orWhere('verse','like',$refs[0].";%")->orWhere('verse', 'LIKE', "%; $bc:%"); } public function textTranspose($key) { |
