<?php
|
|
namespace app\operations\controller\user;
|
|
use app\operations\controller\Controller;
|
use app\operations\model\settings\Setting as SettingModel;
|
use app\operations\model\user\Cash as CashModel;
|
|
/**
|
* 提现
|
*/
|
class Cash extends Controller
|
{
|
/**
|
* 提现记录列表
|
*/
|
public function index($user_id = null, $apply_status = -1, $pay_type = -1, $search = '')
|
{
|
$model = new CashModel;
|
$list = $model->getList($user_id, $apply_status, $pay_type, $search);
|
return $this->renderSuccess('', compact('list'));
|
}
|
|
/**
|
* 提现审核
|
*/
|
public function audit($id)
|
{
|
$model = CashModel::detail($id);
|
if ($model->submit($this->postData())) {
|
return $this->renderSuccess('操作成功');
|
}
|
return $this->renderError($model->getError() ?: '操作失败');
|
}
|
|
/**
|
* 确认打款
|
*/
|
public function money($id)
|
{
|
$model = CashModel::detail($id);
|
|
if ($model->money()) {
|
return $this->renderSuccess('操作成功');
|
}
|
return $this->renderError($model->getError() ?: '操作失败');
|
}
|
|
/**
|
* 余额提现:微信支付企业付款
|
*/
|
public function wxpay($id)
|
{
|
$model = CashModel::detail($id);
|
if ($model->wechatPay()) {
|
return $this->renderSuccess('操作成功');
|
}
|
return $this->renderError($model->getError() ?: '操作失败');
|
}
|
|
/**
|
* 订单导出
|
*/
|
public function export($user_id = null, $apply_status = -1, $pay_type = -1, $search = '')
|
{
|
$model = new CashModel();
|
return $model->exportList($user_id, $apply_status, $pay_type, $search);
|
}
|
|
/**
|
* 提现设置
|
*/
|
public function setting()
|
{
|
if ($this->request->isGet()) {
|
$values = SettingModel::getItem('balance_cash');
|
return $this->renderSuccess('', compact('values'));
|
}
|
$model = new SettingModel;
|
if ($model->edit('balance_cash', $this->postData())) {
|
return $this->renderSuccess('操作成功');
|
}
|
return $this->renderError($model->getError() ?: '操作失败');
|
}
|
}
|