where('username|tel', 'like', '%' . $keyword . '%'); } if (!empty($create_time)) { $query->where('create_time', 'between', [strtotime($create_time[0]), strtotime($create_time[1])]); } $res = $query->order('id desc')->paginate(getpage())->toArray(); $data['data'] = $res; return $this->json($data); } /* * @Description 删除 */ function delete() { return $this->del(new Forhelp()); } /* * @Description 查看详情 */ function detail() { $id = $this->request->post('id', '', 'serach_in'); if (!$id) throw new ValidateException('参数错误'); $res = Forhelp::find($id); if (!empty($res)) { $res = $res->toArray(); } return $this->json(['data' => $res]); } }