| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- /**
- * @package merchant
- *
- * @author xaboy
- * @day 2020-03-24
- *
- *
- */
- namespace app\controller\admin\system\config;
- use crmeb\basic\BaseController;
- use app\common\repositories\user\UserIdentityRepository;
- use FormBuilder\Exception\FormBuilderException;
- use think\App;
- use think\db\exception\DataNotFoundException;
- use think\db\exception\DbException;
- use think\db\exception\ModelNotFoundException;
- /**
- * Class Config
- * @package app\controller\admin\system\config
- * @author xaboy
- * @day 2020-03-27
- */
- class Identity extends BaseController
- {
- /**
- * @var UserIdentityRepository
- */
- protected $repository;
- /**
- * Config constructor.
- * @param App $app
- * @param UserIdentityRepository $repository
- */
- public function __construct(App $app, UserIdentityRepository $repository)
- {
- parent::__construct($app);
- $this->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('修改成功');
- }
- }
|