quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
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\operations\controller\supplier;
 
use app\operations\controller\Controller;
use app\operations\model\supplier\Cash as SupplierCashModel;
use app\operations\model\supplier\Supplier as SupplierModel;
 
/**
 * 供应商提现控制器
 */
class Cash extends Controller
{
    /**
     * 提现列表
     */
    public function index()
    {
        //获取该角色管理的区域 by yj 2023.12.20
        $shop_supplier_ids = SupplierModel::getSupplierIdsByUser($this->store['user']);
        $model = new SupplierCashModel;
        $postData = $this->postData();
        if(!empty($shop_supplier_ids)){
            $postData["shop_supplier_ids"] = $shop_supplier_ids;
        }
        $list = $model->getList($postData);
        return $this->renderSuccess('', compact('list'));
    }
 
    /**
     * 提现审核
     */
    public function submit($id)
    {
        $model = SupplierCashModel::detail($id);
        if ($model->submit($this->postData())) {
            return $this->renderSuccess('操作成功');
        }
        return $this->renderError($model->getError() ?: '操作失败');
    }
 
    /**
     * 确认打款
     */
    public function money($id)
    {
        $model = SupplierCashModel::detail($id);
 
        if ($model->money()) {
            return $this->renderSuccess('操作成功');
        }
        return $this->renderError($model->getError() ?: '操作失败');
    }
}