|
|
@@ -154,7 +154,7 @@ class MotionService extends BaseService
|
|
|
$model = $this->model::from(\DB::raw(env('DB_PREFIX').'motions as m,(select (@rank:=0)) as rank'))
|
|
|
->where(['mark'=> 1,'status'=> 1])
|
|
|
->groupBy('user_id')
|
|
|
- ->orderBy(\DB::raw('count(id)'), 'desc')
|
|
|
+ ->orderBy(\DB::raw('count(id) desc'))
|
|
|
->select([\DB::raw('count(id) as total'),'days','user_id',\DB::raw('(@rank:=@rank+1) as rank')]);
|
|
|
$binds = $model->getBindings();
|
|
|
$sql = str_replace('?', '%s', $model->toSql());
|