合并分支 'lyh-server' 到 'master'
变更数据 查看合并请求 !2864
正在显示
1 个修改的文件
包含
4 行增加
和
2 行删除
| @@ -50,8 +50,10 @@ class TicketUploadDataController extends BaseController | @@ -50,8 +50,10 @@ class TicketUploadDataController extends BaseController | ||
| 50 | 'project_id.required' => 'project_id不能为空', | 50 | 'project_id.required' => 'project_id不能为空', |
| 51 | ]); | 51 | ]); |
| 52 | $data = $this->model->lists($this->map, $this->page, $this->row, $this->order); | 52 | $data = $this->model->lists($this->map, $this->page, $this->row, $this->order); |
| 53 | - foreach ($data as &$item) { | ||
| 54 | - $item['text']['cate_name'] = $this->cateText($item['type'],$item['text']['category_id'] ?? []); | 53 | + if(!empty($data) && !empty($data['list'])){ |
| 54 | + foreach ($data['list'] as &$item) { | ||
| 55 | + $item['text']['cate_name'] = $this->cateText($item['type'],$item['text']['category_id'] ?? []); | ||
| 56 | + } | ||
| 55 | } | 57 | } |
| 56 | $this->response('success', Code::SUCCESS, $data); | 58 | $this->response('success', Code::SUCCESS, $data); |
| 57 | } | 59 | } |
-
请 注册 或 登录 后发表评论