Browse Source

wesmiler 报恩寺项目提交

wesmiler 4 năm trước cách đây
mục cha
commit
3d52949f20
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      app/Services/MotionService.php

+ 1 - 1
app/Services/MotionService.php

@@ -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('total','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());