正在显示
1 个修改的文件
包含
3 行增加
和
1 行删除
| @@ -786,6 +786,8 @@ class ProjectController extends BaseController | @@ -786,6 +786,8 @@ class ProjectController extends BaseController | ||
| 786 | $size = $this->param['page_size'] ?? 20; | 786 | $size = $this->param['page_size'] ?? 20; |
| 787 | $type = $this->param['type'] ?? ''; | 787 | $type = $this->param['type'] ?? ''; |
| 788 | $company = $this->param['company'] ?? ''; | 788 | $company = $this->param['company'] ?? ''; |
| 789 | + $order_by_field = trim($this->param['order_by_field']) ?? 'id'; | ||
| 790 | + $order_by_sort = trim($this->param['order_by_sort']) ?? 'desc'; | ||
| 789 | 791 | ||
| 790 | if(!$source_id && !$id){ | 792 | if(!$source_id && !$id){ |
| 791 | $this->response('参数异常',Code::SYSTEM_ERROR); | 793 | $this->response('参数异常',Code::SYSTEM_ERROR); |
| @@ -828,7 +830,7 @@ class ProjectController extends BaseController | @@ -828,7 +830,7 @@ class ProjectController extends BaseController | ||
| 828 | if ($notice_order_id) { | 830 | if ($notice_order_id) { |
| 829 | $query->whereIn('notice_order_id', $notice_order_id); | 831 | $query->whereIn('notice_order_id', $notice_order_id); |
| 830 | } | 832 | } |
| 831 | - })->orderBy('id', 'desc')->paginate($size)->toArray(); | 833 | + })->orderBy($order_by_field, $order_by_sort)->paginate($size)->toArray(); |
| 832 | $list = []; | 834 | $list = []; |
| 833 | foreach ($data['list'] as $item){ | 835 | foreach ($data['list'] as $item){ |
| 834 | $domain = ''; | 836 | $domain = ''; |
-
请 注册 或 登录 后发表评论