Ejemplo n.º 1
0
Archivo: admin.php Proyecto: kemao/php
    } else {
        $data = [];
        $data['status'] = -1;
        $data['data'] = '未授权';
    }
    header('Content-type: application/json');
    echo json_encode($data);
    exit;
}
authcode();
if ($action == 'queryCode') {
    $code = isset($_GET['code']) ? $_GET['code'] : 0;
    $gift = new gift();
    $data = [];
    $data['status'] = 1;
    $data['data'] = $gift->getGiftByCode($code);
    if ($data['data'] == false) {
        $data['status'] = -1;
        $data['data'] = "未找到相关兑奖码";
    }
    header('Content-type: application/json');
    echo json_encode($data);
}
if ($action == 'updateCode') {
    $code = isset($_GET['code']) ? $_GET['code'] : 0;
    $gift = new gift();
    $data = [];
    $data['status'] = 1;
    $data['data'] = $gift->setGiftByCode($code);
    header('Content-type: application/json');
    echo json_encode($data);