| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- /**
- * @package merchant
- *
- * @author Qinii
- * @day 2020-07-18
- *
- *
- */
- namespace app\controller\admin\system\merchant;
- use app\common\repositories\merchant\apply\MerchantHaikeApplyRepository;
- use app\common\repositories\merchant\order\OrderMerchantRepository;
- use think\App;
- use crmeb\basic\BaseController;
- /**
- * 线下充值列表
- * Class OrderMerchant
- * @package app\controller\admin\system\merchant
- * @author php迷途小书童
- * @created 2021/2/3 13:38
- */
- class OrderMerchant extends BaseController
- {
- /**
- * @var OrderMerchantRepository
- */
- protected $repository;
- /**
- * MerchantIntention constructor.
- * @param App $app
- * @param OrderMerchantRepository $repository
- */
- public function __construct(App $app, OrderMerchantRepository $repository)
- {
- parent::__construct($app);
- $this->repository = $repository;
- }
- /**
- * 线下充值列表
- * @return mixed
- * @author php迷途小书童
- * @created 2021/2/3 13:38
- */
- public function lst()
- {
- [$page, $limit] = $this->getPage();
- $where = $this->request->params(['keyword', 'date']);
- return app('json')->success($this->repository->getList($where, $page, $limit));
- }
- /**
- * 发起退款
- * @return mixed
- * @author php迷途小书童
- * @created 2021/2/3 13:38
- */
- public function refund($id)
- {
- $detail = $this->repository->getOneById($id);
- if (!$detail)
- return app('json')->fail('数据不存在');
- try {
- $haikeRepository = app()->make(MerchantHaikeApplyRepository::class);
- $return = $haikeRepository->haikeRefundApply(['recharge_id' => $id]);
- if ($return['return_code'] != 200) {
- return app('json')->fail($return['return_msg']);
- }
- } catch (\Throwable $e) {
- return app('json')->fail($e->getMessage());
- }
- return app('json')->success('发起申请成功');
- }
- /**
- * 线下充值详情
- * @return mixed
- * @author php迷途小书童
- * @created 2021/2/3 13:37
- */
- public function detail($id){
- $detail = $this->repository->getOne($id);
- if (!$detail)
- return app('json')->fail('数据不存在');
- return app("json")->success("获取成功", $detail);
- }
- }
|