| 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\UserAwardRepository;
- 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 Award extends BaseController
- {
- /**
- * @var UserAwardRepository
- */
- protected $repository;
- /**
- * Config constructor.
- * @param App $app
- * @param UserAwardRepository $repository
- */
- public function __construct(App $app, UserAwardRepository $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()
- {
- $data = $this->request->param();
- $form = $this->repository->updateForm($data);
- return app('json')->success(formToData($form));
- }
- /**
- * @param int $key
- * @return mixed
- * @throws DbException
- * @author xaboy
- * @day 2020-03-27
- */
- public function update($key)
- {
- $data = $this->request->param();
- $this->repository->updateAward($key,$data);
- return app('json')->success('修改成功');
- }
- }
|