Exemple #1
0
        $data['province'] = trim($_GPC['reside']['province']) ? urlencode(trim($_GPC['reside']['province'])) : message('请选择门店所在省');
        $data['city'] = trim($_GPC['reside']['city']) ? urlencode(trim($_GPC['reside']['city'])) : message('请选择门店所在市');
        $data['district'] = trim($_GPC['reside']['district']) ? urlencode(trim($_GPC['reside']['district'])) : message('请选择门店所在区');
        $data['address'] = trim($_GPC['address']) ? urlencode(trim($_GPC['address'])) : message('门店详细地址不能为空');
        $data['longitude'] = trim($_GPC['baidumap']['lng']) ? trim($_GPC['baidumap']['lng']) : message('请选择门店所在地理位置经度');
        $data['latitude'] = trim($_GPC['baidumap']['lat']) ? trim($_GPC['baidumap']['lat']) : message('请选择门店所在地理位置维度');
        $data['telephone'] = trim($_GPC['telephone']) ? trim($_GPC['telephone']) : message('门店电话不能为空');
        $acid = intval($_GPC['acid']);
        load()->model('coupon');
        unset($data['acid']);
        $post[] = $data;
        $acc = new coupon($acid);
        $status = $acc->LocationBatchAdd($post);
        if (is_error($status)) {
            message($status['message'], referer(), 'error');
        }
        $data['acid'] = $acid;
        $data['uniacid'] = $_W['uniacid'];
        //插入数据库
        pdo_insert('coupon_location', $data);
        $id = pdo_insertid();
        message('添加门店成功', url('manage/location_list'), 'success');
    }
}
if ($do == 'display') {
    load()->model('coupon');
    $acid = 269;
    $acc = new coupon($acid);
    $status = $acc->GetColors($post);
}
template('wechat/location');
Exemple #2
0
$acid = intval($_GPC['__acid']);
if (!$acid || empty($accounts[$acid])) {
    message('公众号不存在', url('wechat/account'), 'error');
} else {
    isetcookie('__acid', $acid, 86400 * 3);
}
if ($do == 'location') {
    $location = pdo_fetchall('SELECT id,location_id, business_name, address FROM ' . tablename('coupon_location') . " WHERE acid = :acid AND status = :status AND location_id != ''", array(':acid' => $acid, ':status' => 1));
    template('wechat/location_model');
    exit;
}
$accdata = $accounts[$acid];
if (empty($_GPC['__color'])) {
    load()->classs('coupon');
    $acc = new coupon($acid);
    $status = $acc->GetColors();
    if (is_error($status)) {
        message($status['message'], referer(), 'error');
    }
    foreach ($status['colors'] as $val) {
        $colors[$val['name']] = $val;
    }
    $colors = base64_encode(iserializer($colors));
    isetcookie('__color', $colors, 86400 * 7);
}
$colors = iunserializer(base64_decode($_GPC['__color']));
load()->func('tpl');
load()->model('coupon');
load()->classs('coupon');
$setting = pdo_fetch('SELECT * FROM  ' . tablename('coupon_setting') . ' WHERE uniacid = :aid AND acid = :cid', array(':aid' => $_W['uniacid'], ':cid' => $acid));
$setting['logourl_'] = media2local($setting['logourl']);