<?php
namespace app\store\controller\apps\dealer;
use app\store\controller\Controller;
use app\store\model\dealer\Withdraw as WithdrawModel;
class Withdraw extends Controller
{
public function index($user_id = null, $apply_status = -1, $pay_type = -1, $search = '')
{
$model = new WithdrawModel;
return $this->fetch('index', [
'list' => $model->getList($user_id, $apply_status, $pay_type, $search)
]);
}
public function submit($id)
{
$model = WithdrawModel::detail($id);
if ($model->submit($this->postData('withdraw'))) {
return $this->renderSuccess('操作成功');
}
return $this->renderError($model->getError() ?: '操作失败');
}
public function money($id)
{
$model = WithdrawModel::detail($id);
if ($model->money()) {
return $this->renderSuccess('操作成功');
}
return $this->renderError($model->getError() ?: '操作失败');
}
public function wechat_pay($id)
{
$model = WithdrawModel::detail($id);
if ($model->wechatPay()) {
return $this->renderSuccess('操作成功');
}
return $this->renderError($model->getError() ?: '操作失败');
}
}