repository = $repository; } /** * @return mixed * @throws DataNotFoundException * @throws DbException * @throws ModelNotFoundException * @author xaboy * @day 2020-03-31 */ public function lst() { $where = $this->request->params(['keyword']); [$page, $limit] = $this->getPage(); $lst = $this->repository->getList($where, $page, $limit); return app('json')->success($lst); } /** * @param int $id * @return mixed * @throws DataNotFoundException * @throws DbException * @throws ModelNotFoundException * @throws FormBuilderException * @author xaboy * @day 2020-03-31 */ public function updateTable($id) { if (!$this->repository->exists($id)) app('json')->fail('数据不存在'); $form = $this->repository->updateForm($id); return app('json')->success(formToData($form)); } /** * @param int $id * @return mixed * @throws DbException * @author xaboy * @day 2020-03-27 */ public function update($id) { $data = $this->request->params(['arrive_num_own', 'arrive_num_team']); $this->repository->update($id, $data); return app('json')->success('修改成功'); } }