quanwei
2025-11-28 3ea53e61cc23fdb3ddf8b38a199ca60a6da8c407
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
<?php
 
namespace app\shop\controller\branch;
 
use app\shop\controller\Controller;
use app\shop\model\branch\Cash as BranchCashModel;
use app\shop\model\branch\Branch as BranchModel;
 
/**
 * 供应商提现控制器
 */
class Cash extends Controller
{
    /**
     * 提现列表
     */
    public function index()
    {
        //获取该角色管理的区域 by yj 2023.12.20
        $branch_ids = BranchModel::getBranchIdsByUser($this->store['user']);
        $model = new BranchCashModel;
        $postData = $this->postData();
        if(!empty($branch_ids)){
            $postData["branch_ids"] = $branch_ids;
        }
        $list = $model->getList($postData);
        return $this->renderSuccess('', compact('list'));
    }
 
    /**
     * 提现审核
     */
    public function submit($id)
    {
        $model = BranchCashModel::detail($id);
        if ($model->submit($this->postData())) {
            return $this->renderSuccess('操作成功');
        }
        return $this->renderError($model->getError() ?: '操作失败');
    }
 
    /**
     * 确认打款
     */
    public function money($id)
    {
        $model = BranchCashModel::detail($id);
 
        if ($model->money()) {
            return $this->renderSuccess('操作成功');
        }
        return $this->renderError($model->getError() ?: '操作失败');
    }
}