I have a query:
public function upShops() {
DB:statement('update shops set position =
(SELECT FIND_IN_SET( CONCAT(points, '_', created_at),
(SELECT GROUP_CONCAT( CONCAT(points, '_', created_at) ORDER BY points desc, created_at desc ) FROM (select * from shops) as shop_rankings)))');
}
How I can this query translate to eloquent Laravel? I think that need do so:
Shop::update(['position' => '(SELECT FIND_IN_SET( CONCAT(points, '_',
created_at), (SELECT GROUP_CONCAT( CONCAT(points, '_', created_at)'])-
>orderByDesc('points')->orderByDesc('created_at');
But this does not work. I get an error in the update method. How I can do eloquently correctly?