生クエリ///

This commit is contained in:
shibafu 2019-04-09 22:55:14 +09:00
parent 664448b9fc
commit c20a8066c9

View File

@ -5,6 +5,7 @@ namespace App;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
class Ejaculation extends Model class Ejaculation extends Model
{ {
@ -63,7 +64,7 @@ class Ejaculation extends Model
$query->where('is_protected', false); $query->where('is_protected', false);
}]) }])
->withCount('likes') ->withCount('likes')
->addSelect('0 as is_liked'); ->addSelect(DB::raw('0 as is_liked'));
} }
} }
} }