| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?php
- // +----------------------------------------------------------------------
- // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
- // +----------------------------------------------------------------------
- // | Author: CRMEB Team <admin@crmeb.com>
- // +----------------------------------------------------------------------
- namespace app\controller\admin\system\merchant;
- use app\common\repositories\system\CacheRepository;
- use think\App;
- use crmeb\basic\BaseController;
- use app\common\repositories\system\merchant\MerchantApplymentsRepository;
- /**
- * 商户分账账户申请
- */
- class MerchantApplyments extends BaseController
- {
- protected $repository;
- /**
- * MerchantApplyments constructor.
- * @param App $app
- * @param MerchantApplymentsRepository $repository
- */
- public function __construct(App $app, MerchantApplymentsRepository $repository)
- {
- parent::__construct($app);
- $this->repository = $repository;
- }
- /**
- * 列表
- * @return \think\response\Json
- * @author Qinii
- */
- public function lst()
- {
- [$page, $limit] = $this->getPage();
- $where = $this->request->params(['mer_name', 'status', 'date', 'mer_applyments_id', 'out_request_no', 'applyment_id', 'mer_id']);
- return app('json')->success($this->repository->getList($where, $page, $limit));
- }
- /**
- * 详情
- * @param $id
- * @return \think\response\Json
- * @author Qinii
- */
- public function detail($id)
- {
- $data = $this->repository->detail($id);
- if (empty($data)) return app('json')->fail('数据不存在');
- return app('json')->success($data);
- }
- /**
- * 审核
- * @param $id
- * @return \think\response\Json
- * @author Qinii
- */
- public function switchWithStatus($id)
- {
- $data = $this->request->params(['status', 'message']);
- if (!in_array($data['status'], [0, -1, 10])) return app('json')->fail('参数错误');
- if ($data['status'] == -1 && !$data['message']) return app('json')->fail('驳回理由为空');
- $this->repository->switchWithStatus($id, $data);
- return app('json')->success('审核成功');
- }
- /**
- * 商户信息
- * @param $id
- * @return \think\response\Json
- * @author Qinii
- */
- public function getMerchant($id)
- {
- $data = $this->repository->getMerchant($id);
- return app('json')->success($data);
- }
- /**
- * 备注表单
- * @param $id
- * @return \think\response\Json
- * @author Qinii
- */
- public function markForm($id)
- {
- return app('json')->success(formToData($this->repository->markForm($id)));
- }
- /**
- * 备注
- * @param $id
- * @return \think\response\Json
- * @author Qinii
- */
- public function mark($id)
- {
- if (!$this->repository->get($id))
- return app('json')->fail('数据不存在');
- $this->repository->update($id, ['mark' => $this->request->param('mark', '')]);
- return app('json')->success('备注成功');
- }
- }
|