Beispiel #1
0
<?php

require dirname(__FILE__) . '/api.class.php';
if (!$_SESSION['user_id']) {
    //$_SESSION['user_id'] = 15;
    echo json_encode(array('state' => 0, 'msg' => 'гКох╣гб╪'));
    exit;
}
$aid = intval($_GET['aid']);
$api = new weixinapi();
$arr = $api->doAward($aid);
echo json_encode($arr);
Beispiel #2
0
$weixinconfig = $db->getRow("SELECT * FROM " . $GLOBALS['ecs']->table('weixin_config') . " WHERE `id` = 1");
//多微信帐号支持
$id = intval($_GET['id']);
if ($id > 0) {
    $otherconfig = $db->getRow("SELECT * FROM " . $GLOBALS['ecs']->table('weixin_config') . " WHERE `id` = {$id}");
    if ($otherconfig) {
        $weixinconfig['token'] = $otherconfig['token'];
        $weixinconfig['appid'] = $otherconfig['appid'];
        $weixinconfig['appsecret'] = $otherconfig['appsecret'];
    }
}
$baseurl = $weburl = $_SERVER['SERVER_NAME'] ? "http://" . $_SERVER['SERVER_NAME'] . "/" : "http://" . $_SERVER['HTTP_HOST'] . "/";
//$weburl .= $weixinconfig['wap_url'] ? $weixinconfig['wap_url'] : "";
$weixin = new core_lib_wechat($weixinconfig);
$weixin->valid();
$api = new weixinapi();
$weburl .= $api->dir;
$type = $weixin->getRev()->getRevType();
$wxid = $weixin->getRev()->getRevFrom();
//上报地理信息
$loc = $weixin->getRev()->getUserLocation();
if ($loc) {
    $api->updatelocation($wxid, $loc);
}
$reMsg = "";
switch ($type) {
    case 'text':
        $content = $weixin->getRev()->getRevContent();
        break;
    case 'event':
        $event = $weixin->getRev()->getRevEvent();
Beispiel #3
0
<?php

require dirname(__FILE__) . '/api.class.php';
if (!$_SESSION['user_id']) {
    //$uid = 12;
    exit("您还没有绑定会员,请绑定后再来砸金蛋吧!");
}
$aid = intval($_GET['aid']);
$act = $db->getRow("SELECT * FROM " . $GLOBALS['ecs']->table('weixin_act') . " WHERE `aid` = {$aid} and isopen=1");
if (!$act) {
    exit("活动已经结束");
}
$actList = (array) $db->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('weixin_actlist') . " where aid={$aid} and isopen=1");
if (!$actList) {
    exit("活动未设置奖项");
}
$sql = "SELECT " . $GLOBALS['ecs']->table('weixin_actlog') . ".*," . $GLOBALS['ecs']->table('weixin_user') . ".nickname FROM " . $GLOBALS['ecs']->table('weixin_actlog') . " \n\t\tleft join " . $GLOBALS['ecs']->table('weixin_user') . " on " . $GLOBALS['ecs']->table('weixin_actlog') . ".uid=" . $GLOBALS['ecs']->table('weixin_user') . ".ecuid \n\t\twhere code!='' and aid={$aid} order by lid desc";
$award = $db->getAll($sql);
$uid = intval($_SESSION['user_id']);
$api = new weixinapi();
$awardNum = intval($api->getAwardNum($aid));
require "award_{$act['tpl']}.php";