quanwei
2025-11-27 4711bb8fb2fb16c4eb1cdf6c0314069d85e77a67
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
<?php
 
namespace app\api\controller\plus\team;
 
use app\api\controller\Controller;
use app\api\model\plus\team\Setting;
use app\api\model\plus\team\User as teamUserModel;
use app\api\model\plus\team\Cash as CashModel;
 
/**
 * 队长提现
 */
class Cash extends Controller
{
    private $user;
 
    private $team;
    private $setting;
 
    /**
     * 构造方法
     */
    public function initialize()
    {
        // 用户信息
        $this->user = $this->getUser();
        // 队长用户信息
        $this->team = teamUserModel::detail($this->user['user_id']);
        // 队长设置
        $this->setting = Setting::getAll();
    }
 
    /**
     * 提交提现申请
     */
    public function submit($data)
    {
        $formData = json_decode(htmlspecialchars_decode($data), true);
 
        $model = new CashModel;
        if ($model->submit($this->team, $formData)) {
            return $this->renderSuccess('申请提现成功');
        }
        return $this->renderError($model->getError() ?: '提交失败');
    }
 
    /**
     * 队长提现明细
     */
    public function lists($status = -1)
    {
 
        $model = new CashModel;
        return $this->renderSuccess('', [
            // 提现明细列表
            'list' => $model->getList($this->user['user_id'], (int)$status,$this->postData()),
            // 页面文字
            'words' => $this->setting['words']['values'],
        ]);
    }
 
}