quanwei
2025-11-03 ef5d748e3e3331bd20d4065c33e7867c2637d1db
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
<?php
 
namespace app\api\controller\branch;
 
use app\api\controller\Controller;
use app\api\model\branch\ActivityUser as ActivityUserModel; // 报名会员
use app\common\service\qrcode\ExtractService;
use xin\helper\Func;
 
/**
 * 活动报名控制器
 */
class ActivityUser extends Controller
{
    /**
     * 活动报名列表
     */
    public function lists()
    {
        $user = $this->getUser();
        $model = new ActivityUserModel;
        $list = $model->getList($user['user_id'], $this->postData());
        return $this->renderSuccess('', compact('list'));
    }
 
    /**
     *报名详情
     */
    public function detail($order_id)
    {
        $detail = ActivityUserModel::detail($order_id, ['activity.image']);
        return $this->renderSuccess('', compact('detail'));
    }
 
    /**
     * 获取核销二维码(废弃)
     */
    public function qrcode($order_id, $source)
    {
        $user = $this->getUser();
        $Qrcode = new ExtractService(
            $this->app_id,
            $user,
            $order_id,
            $source,
            'activityUser-' . $order_id,
            'activityUser'
        );
        return $this->renderSuccess('',[
            'qrcode' => $Qrcode->getImage(),
        ]);
    }
 
    // 签到
    public function verify($activity_id)
    {
        $model = new ActivityUserModel;
        $user = $this->getUser();
        if ($model->onVerify($user, $activity_id)) {
            return $this->renderSuccess('签到成功');
        }
        return $this->renderError($model->getError() ?:'签到失败');
    }
}