1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
 
namespace app\supplier\controller\plus\release;
 
use app\supplier\controller\Controller;
use app\shop\model\plus\release\Cash as CashModel;
use app\supplier\model\supplier\Supplier as SupplierModel;
 
/**
 * 提现申请制器
 */
class Cash extends Controller
{
    /**
     * 提现记录列表
     */
    public function index($user_id = null, $apply_status = -1, $pay_type = -1, $search = '')
    {
        $supplier = SupplierModel::detail($this->getSupplierId());
        if(empty($supplier["is_release"])){
            return $this->renderError('没有权限');
        }
        $model = new CashModel;
        $list = $model->getList($user_id, $apply_status, $pay_type, $search);
        return $this->renderSuccess('', compact('list'));
    }
 
    /**
     * 提现审核
     */
    public function submit($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 wechat_pay($id)
    {
        $model = CashModel::detail($id);
        if ($model->wechatPay()) {
            return $this->renderSuccess('操作成功');
        }
        return $this->renderError($model->getError() ?: '操作失败');
    }
 
    /**
     * 分销商提现:分账功能 by yj
     */
    public function fb_pay($id)
    {
        $model = CashModel::detail($id);
        if ($model->fbPay()) {
            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);
    }
}