123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?php
- namespace app\adminapi\controller\shop\admin;
- use app\dict\shop\ShopCashOutDict;
- use app\dict\shop\ShopTransferDict;
- use app\service\admin\shop\admin\ShopCashOutService;
- use app\service\admin\shop\admin\ShopConfigService;
- use core\base\BaseAdminController;
- class ShopCashOut extends BaseAdminController
- {
- /**
- * 店铺提现列表
- * @return \think\Response
- */
- public function lists()
- {
- $data = $this->request->params([
- [ 'cash_out_no', '' ],
- [ 'status', '' ],
- [ 'keyword', '' ],
- [ 'transfer_type', '' ],
- [ 'create_time', [] ],
- [ 'audit_time', [] ],
- [ 'transfer_time', [] ]
- ]);
- return success(( new ShopCashOutService() )->getPage($data));
- }
- /**
- * 店铺提现详情
- * @param int $id
- * @return \think\Response
- */
- public function info(int $id)
- {
- return success(( new ShopCashOutService() )->getInfo($id));
- }
- /**
- * 店铺提现审核
- * @return \think\Response
- */
- public function audit($id)
- {
- $data = $this->request->params([
- ['status', ''],
- ['refuse_reason', '']
- ]);
- $this->validate($data, 'app\validate\shop\ShopCashOut.audit');
- ( new ShopCashOutService() )->audit($id, $data);
- return success('AUDIT_SUCCESS');
- }
- /**
- * 店铺提现转账
- * @return \think\Response
- */
- public function transfer($id)
- {
- $data = $this->request->params([
- ['transfer_no', ''],
- ['transfer_voucher', '']
- ]);
- $this->validate($data, 'app\validate\shop\ShopCashOut.transfer');
- ( new ShopCashOutService() )->transfer($id, $data);
- return success('TRANSFER_SUCCESS');
- }
- /**
- * 获取店铺提现设置
- * @return \think\Response
- */
- public function getCashOutConfig()
- {
- return success((new ShopConfigService())->getCashOutConfig());
- }
- /**
- * 店铺提现设置
- * @return \think\Response
- */
- public function setCashOutConfig()
- {
- $data = $this->request->params([
- ['is_open', 1], //是否开启
- ['min', 0.01], //最低提现金额
- ['rate', 0], //提现手续费比率
- ['is_auto_verify', 0], //是否自动审核
- ['is_auto_transfer', 0], //是否自动转账
- ['transfer_type', []] //转账方式
- ]);
- $this->validate($data, 'app\validate\shop\CashOutConfig.set');
- (new ShopConfigService())->setCashOutConfig($data);
- return success('SET_SUCCESS');
- }
- /**
- * 转账方式
- * @return \think\Response
- */
- public function getTransferType()
- {
- return success(ShopTransferDict::getType());
- }
- /**
- * 提现状态
- * @return \think\Response
- */
- public function getStatus()
- {
- return success(ShopCashOutDict::getStatus());
- }
- /**
- * 查询提现统计数据
- * @return \think\Response
- */
- public function getWithdrawData()
- {
- return success(( new ShopCashOutService() )->getWithdrawData());
- }
- }
|