本文整理匯總了PHP中coupon::CreateCard方法的典型用法代碼示例。如果您正苦於以下問題:PHP coupon::CreateCard方法的具體用法?PHP coupon::CreateCard怎麽用?PHP coupon::CreateCard使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類coupon
的用法示例。
在下文中一共展示了coupon::CreateCard方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: explode
}
$arr = explode('=', $da);
$post[$arr[0]] = trim($arr[1]);
}
$out['errno'] = 1;
$out['error'] = '';
$post['logo_url'] = empty($post['logo_url']) ? $setting['logourl'] : trim($post['logo_url']);
$base = new Card('GENERAL_COUPON', $post);
if (is_error($base->general_coupon->base_info)) {
$out['errno'] = 0;
$out['error'] = $base->general_coupon->base_info['message'];
exit(json_encode($out));
}
$base->get_card()->set_default_detail(urlencode(trim($post['default_detail'])));
$acc = new coupon($acid);
$status = $acc->CreateCard($base->toJson());
if (is_error($status)) {
$out['errno'] = 0;
$out['error'] = $status['message'];
exit(json_encode($out));
}
$post['card_id'] = $status['card_id'];
$post['date_info'] = array('time_type' => $post['time_type'], 'time_limit_start' => $post['time_limit[start]'], 'time_limit_end' => $post['time_limit[end]'], 'deadline' => $post['deadline'], 'limit' => $post['limit']);
$post['date_info'] = iserializer($post['date_info']);
if (!empty($post['location-select'])) {
$location = explode('-', $post['location-select']);
$post['location_id_list'] = iserializer($location);
} else {
$post['location_id_list'] = iserializer(array());
}
$post['uniacid'] = $_W['uniacid'];
示例2: exit
<?php
/**
* [WEIZAN System] Copyright (c) 2015 012WZ.COM
* WeiZan is NOT a free software, it under the license terms, visited http://www.012wz.com/ for more details.
*/
defined('IN_IA') or exit('Access Denied');
$dos = array('module', 'coupon', 'location', 'discount', 'display', 'del', 'sync', 'modifystock', 'toggle', 'qr', 'record', 'cash', 'gift', 'groupon', 'general_coupon');
$do = in_array($do, $dos) ? $do : 'post';
$op = trim($_GPC['op']) ? trim($_GPC['op']) : 'post';
$acid = intval($_W['acid']);
load()->classs('coupon');
if ($do == 'post') {
$data = array('card' => array('card_type' => 'MEMBER_CARD', 'member_card' => array('base_info' => array('logo_url' => urlencode('http://mmbiz.qpic.cn/mmbiz/qYicJhgpqsd37NCqJIqia4KF9o4fmq7NTgnQMd5vBSwn2ibBRQ4wCLr47ohUI6xicWUc7ibxoyJDubnNs3mxnfSXy2g/0'), 'brand_name' => urlencode('商家信息'), 'color' => 'Color080', 'title' => urlencode('折扣券標題'), 'sub_title' => urlencode('折扣券標題'), 'can_share' => true, 'can_give_friend' => true, 'code_type' => 'CODE_TYPE_TEXT', 'notice' => urlencode('操作提示操作提示'), 'description' => urlencode('使用須知使用須知'), 'service_phone' => urlencode('1000000'), 'get_limit' => 100, 'date_info' => array('type' => 'DATE_TYPE_FIX_TIME_RANGE', 'begin_timestamp' => '1439136000', 'end_timestamp' => '1444838400'), 'sku' => array('quantity' => 10000), 'custom_url_name' => urlencode('立即使用'), 'custom_url' => urlencode('http://bbs.012wz.com'), 'custom_url_sub_title' => urlencode('6個漢字tips'), 'promotion_url_name' => urlencode('營銷入口1'), 'promotion_url' => urlencode('http://www.012wz.com')), 'supply_bonus' => true, 'supply_balance' => false, 'prerogative' => urlencode('會員卡特權說明'), 'custom_field1' => array('name_type' => 'FIELD_NAME_TYPE_LEVEL', 'url' => urlencode('http://www.012wz.com')), 'activate_url' => urlencode('http://bbs.012wz.com'), 'custom_cell1' => array('name' => urlencode('使用入口2'), 'tips' => urlencode('激活後顯示'), 'url' => urlencode('http://bbs.012wz.com')))));
$acc = new coupon($acid);
$status = $acc->CreateCard(urldecode(json_encode($data)));
print_r($status);
}
if ($do == 'update') {
$data = array('init_bonus' => 100, 'init_balance' => 200, 'membership_number' => 12345678, 'code' => '', 'card_id' => 'pTKzFjtDm_SKwh2vbiLwD2cGO0Ik ', 'custom_field_value1' => '白金會員組');
}