本文整理汇总了PHP中rm_auto_cache函数的典型用法代码示例。如果您正苦于以下问题:PHP rm_auto_cache函数的具体用法?PHP rm_auto_cache怎么用?PHP rm_auto_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rm_auto_cache函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save()
{
if (trim($_REQUEST['consignee']) == '') {
showErr($GLOBALS['lang']['FILL_CORRECT_CONSIGNEE']);
}
if (trim($_REQUEST['address']) == '') {
showErr($GLOBALS['lang']['FILL_CORRECT_ADDRESS']);
}
if (trim($_REQUEST['zip']) == '') {
showErr($GLOBALS['lang']['FILL_CORRECT_ZIP']);
}
if (trim($_REQUEST['mobile']) == '') {
showErr($GLOBALS['lang']['FILL_MOBILE_PHONE']);
}
if (!check_mobile($_REQUEST['mobile'])) {
showErr($GLOBALS['lang']['FILL_CORRECT_MOBILE_PHONE']);
}
$consignee_data['user_id'] = $GLOBALS['user_info']['id'];
$consignee_data['region_lv1'] = intval($_REQUEST['region_lv1']);
$consignee_data['region_lv2'] = intval($_REQUEST['region_lv2']);
$consignee_data['region_lv3'] = intval($_REQUEST['region_lv3']);
$consignee_data['region_lv4'] = intval($_REQUEST['region_lv4']);
$consignee_data['address'] = addslashes(trim(htmlspecialchars($_REQUEST['address'])));
$consignee_data['mobile'] = addslashes(trim(htmlspecialchars($_REQUEST['mobile'])));
$consignee_data['consignee'] = addslashes(trim(htmlspecialchars($_REQUEST['consignee'])));
$consignee_data['zip'] = addslashes(trim(htmlspecialchars($_REQUEST['zip'])));
$consignee_id = intval($_REQUEST['id']);
if ($consignee_id == 0) {
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $consignee_data);
} else {
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $consignee_data, "UPDATE", "id=" . $consignee_id);
}
rm_auto_cache("consignee_info", array("consignee_id" => intval($consignee_id)));
showSuccess($GLOBALS['lang']['UPDATE_SUCCESS']);
}
示例2: set_effect
public function set_effect()
{
$id = intval($_REQUEST['id']);
$ajax = intval($_REQUEST['ajax']);
$info = M(MODULE_NAME)->where("id=" . $id)->getField("name");
$c_is_effect = M(MODULE_NAME)->where("id=" . $id)->getField("status");
//当前状态
$n_is_effect = $c_is_effect == 0 ? 1 : 0;
//需设置的状态
M(MODULE_NAME)->where("id=" . $id)->setField("status", $n_is_effect);
save_log($info . l("SET_EFFECT_" . $n_is_effect), 1);
rm_auto_cache("cache_nav_list");
$this->ajaxReturn($n_is_effect, l("SET_EFFECT_" . $n_is_effect), 1);
}
示例3: done
//.........这里部分代码省略.........
$order['payment_fee'] = $data['payment_fee'];
$order['bank_id'] = htmlspecialchars(addslashes(trim($_REQUEST['bank_id'])));
foreach ($data['promote_description'] as $promote_item) {
$order['promote_description'] .= $promote_item . "<br />";
}
//更新来路
$order['referer'] = $GLOBALS['referer'];
$user_info = es_session::get("user_info");
$order['user_name'] = $user_info['user_name'];
$coupon_mobile = htmlspecialchars(addslashes(trim($_REQUEST['coupon_mobile'])));
if ($coupon_mobile != '') {
$GLOBALS['db']->query("update " . DB_PREFIX . "user set mobile = '" . $coupon_mobile . "' where id = " . intval($user_info['id']));
}
do {
$order['order_sn'] = to_date(get_gmtime(), "Ymdhis") . rand(10, 99);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order", $order, 'INSERT', '', 'SILENT');
$order_id = intval($GLOBALS['db']->insert_id());
} while ($order_id == 0);
//生成订单商品
foreach ($goods_list as $k => $v) {
$deal_info = load_auto_cache("cache_deal_cart", array("id" => $v['deal_id']));
$goods_item = array();
$goods_item['deal_id'] = $v['deal_id'];
$goods_item['number'] = $v['number'];
$goods_item['unit_price'] = $v['unit_price'];
$goods_item['total_price'] = $v['total_price'];
$goods_item['name'] = addslashes($v['name']);
$goods_item['sub_name'] = addslashes($v['sub_name']);
$goods_item['attr'] = $v['attr'];
$goods_item['verify_code'] = $v['verify_code'];
$goods_item['order_id'] = $order_id;
$goods_item['return_score'] = $v['return_score'];
$goods_item['return_total_score'] = $v['return_total_score'];
$goods_item['return_money'] = $v['return_money'];
$goods_item['return_total_money'] = $v['return_total_money'];
$goods_item['buy_type'] = $v['buy_type'];
$goods_item['attr_str'] = $v['attr_str'];
$goods_item['balance_unit_price'] = $deal_info['balance_price'];
$goods_item['balance_total_price'] = $deal_info['balance_price'] * $v['number'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order_item", $goods_item, 'INSERT', '', 'SILENT');
}
//开始更新订单表的deal_ids
$deal_ids = $GLOBALS['db']->getOne("select group_concat(deal_id) from " . DB_PREFIX . "deal_order_item where order_id = " . $order_id);
$GLOBALS['db']->query("update " . DB_PREFIX . "deal_order set deal_ids = '" . $deal_ids . "' where id = " . $order_id);
$GLOBALS['db']->query("delete from " . DB_PREFIX . "deal_cart where session_id = '" . $session_id . "' and user_id = " . $user_id);
if ($data['is_delivery'] == 1) {
//保存收款人
$user_consignee = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_consignee where user_id = " . $user_id . " order by id desc");
$user_consignee['region_lv1'] = intval($_REQUEST['region_lv1']);
$user_consignee['region_lv2'] = intval($_REQUEST['region_lv2']);
$user_consignee['region_lv3'] = intval($_REQUEST['region_lv3']);
$user_consignee['region_lv4'] = intval($_REQUEST['region_lv4']);
$user_consignee['address'] = htmlspecialchars(addslashes(trim($_REQUEST['address'])));
$user_consignee['mobile'] = htmlspecialchars(addslashes(trim($_REQUEST['mobile'])));
$user_consignee['consignee'] = htmlspecialchars(addslashes(trim($_REQUEST['consignee'])));
$user_consignee['zip'] = htmlspecialchars(addslashes(trim($_REQUEST['zip'])));
$user_consignee['user_id'] = $user_id;
if (intval($user_consignee['id']) == 0) {
//新增
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $user_consignee, 'INSERT', '', 'SILENT');
} else {
//更新
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $user_consignee, 'UPDATE', 'id=' . $user_consignee['id'], 'SILENT');
rm_auto_cache("consignee_info", array("consignee_id" => intval($user_consignee['id'])));
}
}
//生成order_id 后
//1. 代金券支付
$ecv_data = $data['ecv_data'];
if ($ecv_data) {
$ecv_payment_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "payment where class_name = 'Voucher'");
$payment_notice_id = make_payment_notice($ecv_data['money'], $order_id, $ecv_payment_id);
require_once APP_ROOT_PATH . "system/payment/Voucher_payment.php";
$voucher_payment = new Voucher_payment();
$voucher_payment->direct_pay($ecv_data['sn'], $ecv_data['password'], $payment_notice_id);
}
//2. 余额支付
$account_money = $data['account_money'];
if (floatval($account_money) > 0) {
$account_payment_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "payment where class_name = 'Account'");
$payment_notice_id = make_payment_notice($account_money, $order_id, $account_payment_id);
require_once APP_ROOT_PATH . "system/payment/Account_payment.php";
$account_payment = new Account_payment();
$account_payment->get_payment_code($payment_notice_id);
}
//3. 相应的支付接口
$payment_info = $data['payment_info'];
if ($payment_info && $data['pay_price'] > 0) {
$payment_notice_id = make_payment_notice($data['pay_price'], $order_id, $payment_info['id']);
//创建支付接口的付款单
}
$rs = order_paid($order_id);
save_debug_log('cart done', 'order_paid rs:' . $rs . 'order_id:' . $order_id);
if ($rs) {
app_redirect(url("shop", "payment#done", array("id" => $order_id)));
//支付成功
} else {
app_redirect(url("shop", "payment#pay", array("id" => $payment_notice_id)));
}
}
示例4: youhui_update
//.........这里部分代码省略.........
if ($data['cate_id'] == 0) {
$this->error(L("DEAL_YOUHUI_CATE_EMPTY_TIP"));
}
if ($data['city_id'] == 0) {
$this->error(L("DEAL_YOUHUI_CITY_EMPTY_TIP"));
}
if ($data['max_bought'] < 0) {
$this->error(L("DEAL_YOUHUI_MAX_BOUGHT_ERROR_TIP"));
}
if ($data['user_min_bought'] < 0) {
$this->error(L("DEAL_USER_MIN_BOUGHT_ERROR_TIP"));
}
if ($data['user_max_bought'] < 0) {
$this->error(L("DEAL_USER_MAX_BOUGHT_ERROR_TIP"));
}
if ($data['user_max_bought'] < $data['user_min_bought'] && $data['user_max_bought'] > 0) {
$this->error(L("DEAL_USER_MAX_MIN_BOUGHT_ERROR_TIP"));
}
$data['is_shop'] = 2;
$data['is_coupon'] = 1;
if (intval($data['is_coupon']) == 1 && intval($data['is_refund']) == 1) {
$data['expire_refund'] = intval($_REQUEST['expire_refund']);
$data['any_refund'] = intval($_REQUEST['any_refund']);
} else {
$data['expire_refund'] = 0;
$data['any_refund'] = 0;
}
$data['notice'] = intval($_REQUEST['notice']);
$data['begin_time'] = trim($data['begin_time']) == '' ? 0 : to_timespan($data['begin_time']);
$data['end_time'] = trim($data['end_time']) == '' ? 0 : to_timespan($data['end_time']);
$data['coupon_begin_time'] = trim($data['coupon_begin_time']) == '' ? 0 : to_timespan($data['coupon_begin_time']);
$data['coupon_end_time'] = trim($data['coupon_end_time']) == '' ? 0 : to_timespan($data['coupon_end_time']);
//将第一张图片设为团购图片
$imgs = $_REQUEST['img'];
foreach ($imgs as $k => $v) {
if ($v != '') {
$data['img'] = $v;
break;
}
}
$data['update_time'] = get_gmtime();
$data['publish_wait'] = 0;
// 更新数据
$list = M(MODULE_NAME)->save($data);
if (false !== $list) {
$GLOBALS['db']->query("update " . DB_PREFIX . "deal_coupon set expire_refund = " . $data['expire_refund'] . ",any_refund = " . $data['any_refund'] . ",supplier_id=" . $data['supplier_id'] . ",end_time=" . $data['coupon_end_time'] . ",begin_time=" . $data['coupon_begin_time'] . " where deal_id = " . $data['id']);
//开始处理图片
M("DealGallery")->where("deal_id=" . $data['id'])->delete();
$imgs = $_REQUEST['img'];
foreach ($imgs as $k => $v) {
if ($v != '') {
$img_data['deal_id'] = $data['id'];
$img_data['img'] = $v;
$img_data['sort'] = $k;
M("DealGallery")->add($img_data);
}
}
//end 处理图片
M("DealPayment")->where("deal_id=" . $data['id'])->delete();
if (intval($_REQUEST['define_payment']) == 1) {
$payment_ids = $_REQUEST['payment_id'];
foreach ($payment_ids as $k => $v) {
$payment_conf = array();
$payment_conf['payment_id'] = $payment_ids[$k];
$payment_conf['deal_id'] = $data['id'];
M("DealPayment")->add($payment_conf);
}
}
//成功提示
M("DealCateTypeDealLink")->where("deal_id=" . $data['id'])->delete();
foreach ($_REQUEST['deal_cate_type_id'] as $type_id) {
$link_data = array();
$link_data['deal_cate_type_id'] = $type_id;
$link_data['deal_id'] = $data['id'];
M("DealCateTypeDealLink")->add($link_data);
}
M("DealLocationLink")->where("deal_id=" . $data['id'])->delete();
foreach ($_REQUEST['location_id'] as $location_id) {
$link_data = array();
$link_data['location_id'] = $location_id;
$link_data['deal_id'] = $data['id'];
M("DealLocationLink")->add($link_data);
}
syn_deal_status($data['id']);
foreach ($_REQUEST['location_id'] as $location_id) {
recount_supplier_data_count($location_id, "daijin");
}
syn_deal_match($data['id']);
rm_auto_cache("cache_deal_cart", array("id" => $data['id']));
rm_auto_cache("static_goods_info", array("id" => $data['id']));
//成功提示
save_log($log_info . L("UPDATE_SUCCESS"), 1);
$this->success(L("UPDATE_SUCCESS"));
} else {
//错误提示
$dbErr = M()->getDbError();
save_log($log_info . L("UPDATE_FAILED") . $dbErr, 0);
$this->error(L("UPDATE_FAILED") . $dbErr, 0);
}
}
示例5: order_done
//.........这里部分代码省略.........
showErr($GLOBALS['lang']['FILL_CORRECT_CONSIGNEE'], $ajax);
}
if (trim($_REQUEST['address']) == '') {
showErr($GLOBALS['lang']['FILL_CORRECT_ADDRESS'], $ajax);
}
if (trim($_REQUEST['zip']) == '') {
showErr($GLOBALS['lang']['FILL_CORRECT_ZIP'], $ajax);
}
if (trim($_REQUEST['mobile']) == '') {
showErr($GLOBALS['lang']['FILL_MOBILE_PHONE'], $ajax);
}
if (!check_mobile(trim($_REQUEST['mobile']))) {
showErr($GLOBALS['lang']['FILL_CORRECT_MOBILE_PHONE'], $ajax);
}
if (!$data['delivery_info']) {
showErr($GLOBALS['lang']['PLEASE_SELECT_DELIVERY'], $ajax);
}
}
if (round($data['pay_price'], 4) > 0 && !$data['payment_info']) {
showErr($GLOBALS['lang']['PLEASE_SELECT_PAYMENT'], $ajax);
}
//结束验证订单接交信息
//开始修正订单
$now = NOW_TIME;
$order['total_price'] = $data['pay_total_price'];
//应付总额 商品价 - 会员折扣 + 运费 + 支付手续费
$order['memo'] = strim($_REQUEST['memo']);
$order['region_lv1'] = intval($_REQUEST['region_lv1']);
$order['region_lv2'] = intval($_REQUEST['region_lv2']);
$order['region_lv3'] = intval($_REQUEST['region_lv3']);
$order['region_lv4'] = intval($_REQUEST['region_lv4']);
$order['address'] = strim($_REQUEST['address']);
$order['mobile'] = strim($_REQUEST['mobile']);
$order['consignee'] = strim($_REQUEST['consignee']);
$order['zip'] = strim($_REQUEST['zip']);
$order['delivery_fee'] = $data['delivery_fee'];
$order['delivery_id'] = $data['delivery_info']['id'];
$order['payment_id'] = $data['payment_info']['id'];
$order['payment_fee'] = $data['payment_fee'];
$order['discount_price'] = $data['user_discount'];
$order['bank_id'] = strim($_REQUEST['bank_id']);
$order['promote_description'] = "";
foreach ($data['promote_description'] as $promote_item) {
$order['promote_description'] .= $promote_item . "<br />";
}
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order", $order, 'UPDATE', 'id=' . $order['id'], 'SILENT');
if ($data['is_delivery'] == 1) {
//保存收款人
$consignee_id = intval($_REQUEST['consignee_id']);
$user_consignee = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_consignee where user_id = " . $order['user_id'] . " and id = " . $consignee_id);
$user_consignee['region_lv1'] = intval($_REQUEST['region_lv1']);
$user_consignee['region_lv2'] = intval($_REQUEST['region_lv2']);
$user_consignee['region_lv3'] = intval($_REQUEST['region_lv3']);
$user_consignee['region_lv4'] = intval($_REQUEST['region_lv4']);
$user_consignee['address'] = strim($_REQUEST['address']);
$user_consignee['mobile'] = strim($_REQUEST['mobile']);
$user_consignee['consignee'] = strim($_REQUEST['consignee']);
$user_consignee['zip'] = strim($_REQUEST['zip']);
$user_consignee['user_id'] = $order['user_id'];
if (intval($user_consignee['id']) == 0) {
//新增,修改订单不新增配送
// $user_consignee['is_default'] = 1;
// $GLOBALS['db']->autoExecute(DB_PREFIX."user_consignee",$user_consignee,'INSERT','','SILENT');
} else {
//更新
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $user_consignee, 'UPDATE', 'id=' . $user_consignee['id'], 'SILENT');
rm_auto_cache("consignee_info", array("consignee_id" => intval($user_consignee['id'])));
}
}
//生成order_id 后
//1. 余额支付
$account_money = $data['account_money'];
if (floatval($account_money) > 0) {
$account_payment_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "payment where class_name = 'Account'");
$payment_notice_id = make_payment_notice($account_money, $order['id'], $account_payment_id);
require_once APP_ROOT_PATH . "system/payment/Account_payment.php";
$account_payment = new Account_payment();
$account_payment->get_payment_code($payment_notice_id);
}
//3. 相应的支付接口
$payment_info = $data['payment_info'];
if ($payment_info && $data['pay_price'] > 0) {
$payment_notice_id = make_payment_notice($data['pay_price'], $order['id'], $payment_info['id']);
//创建支付接口的付款单
}
$rs = order_paid($order['id']);
if ($rs) {
$data = array();
$data['info'] = "";
$data['jump'] = url("index", "payment#done", array("id" => $order['id']));
ajax_return($data);
//支付成功
} else {
distribute_order($order['id']);
$data = array();
$data['info'] = "";
$data['jump'] = url("index", "payment#pay", array("id" => $payment_notice_id));
ajax_return($data);
}
}
示例6: index
//.........这里部分代码省略.........
$order['order_end_time'] = $order_time + $order['service_time'] * 60;
//if($send_mobile!='')
// $GLOBALS['db']->query("update ".DB_PREFIX."user set mobile = '".$send_mobile."' where id = ".$user_id);
do {
$order['order_sn'] = to_date(get_gmtime(), "Ymdhis") . rand(10, 99);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order", $order, 'INSERT', '', 'SILENT');
$order_id = intval($GLOBALS['db']->insert_id());
} while ($order_id == 0);
//end 验证成功提交订单成功
//开始生成订单产品以及支付
//生成订单商品
foreach ($goods_list as $k => $v) {
$goods_item = array();
$goods_item['deal_id'] = $v['deal_id'];
$goods_item['number'] = $v['number'];
$goods_item['unit_price'] = $v['unit_price'];
$goods_item['total_price'] = $v['total_price'];
$goods_item['name'] = addslashes($v['name']);
$goods_item['sub_name'] = addslashes($v['sub_name']);
$goods_item['attr'] = $v['attr'];
$goods_item['verify_code'] = $v['verify_code'];
$goods_item['order_id'] = $order_id;
$goods_item['return_score'] = $v['return_score'];
$goods_item['return_total_score'] = $v['return_total_score'];
$goods_item['return_money'] = $v['return_money'];
$goods_item['return_total_money'] = $v['return_total_money'];
$goods_item['buy_type'] = $v['buy_type'];
$goods_item['attr_str'] = $v['attr_str'];
$goods_item['deal_icon'] = $v['icon'];
$goods_item['service_time'] = $v['service_time'];
$deal_info = load_auto_cache("cache_deal_cart", array("id" => $v['deal_id']));
$goods_item['balance_unit_price'] = $deal_info['balance_price'];
$goods_item['balance_total_price'] = $deal_info['balance_price'] * $v['number'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order_item", $goods_item, 'INSERT', '', 'SILENT');
}
//开始更新订单表的deal_ids
$deal_ids = $GLOBALS['db']->getOne("select group_concat(deal_id) from " . DB_PREFIX . "deal_order_item where order_id = " . $order_id);
$GLOBALS['db']->query("update " . DB_PREFIX . "deal_order set deal_ids = '" . $deal_ids . "' where id = " . $order_id);
if ($data['is_delivery'] == 1) {
//保存收款人
$user_consignee = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_consignee where user_id = " . $user_id . " order by id desc");
$user_consignee['region_lv1'] = $region1_id;
$user_consignee['region_lv2'] = $region2_id;
$user_consignee['region_lv3'] = $region3_id;
$user_consignee['region_lv4'] = $region4_id;
$user_consignee['address'] = htmlspecialchars($address);
$user_consignee['mobile'] = htmlspecialchars($consignee_mobile);
$user_consignee['consignee'] = htmlspecialchars($consignee);
$user_consignee['zip'] = htmlspecialchars($zip);
$user_consignee['user_id'] = $user_id;
if (intval($user_consignee['id']) == 0) {
//新增
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $user_consignee, 'INSERT', '', 'SILENT');
} else {
//更新
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $user_consignee, 'UPDATE', 'id=' . $user_consignee['id'], 'SILENT');
rm_auto_cache("consignee_info", array("consignee_id" => intval($user_consignee['id'])));
}
}
//生成order_id 后
//1. 代金券支付
$ecv_data = $data['ecv_data'];
if ($ecv_data) {
$ecv_payment_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "payment where class_name = 'Voucher'");
$payment_notice_id = make_payment_notice($ecv_data['money'], $order_id, $ecv_payment_id);
require_once APP_ROOT_PATH . "system/payment/Voucher_payment.php";
$voucher_payment = new Voucher_payment();
$voucher_payment->direct_pay($ecv_data['sn'], $ecv_data['password'], $payment_notice_id);
}
//2. 余额支付
$account_money = $data['account_money'];
if (floatval($account_money) > 0) {
$GLOBALS['payment_lang'] = array('name' => '余额支付', 'account_credit' => '帐户余额', 'use_user_money' => '使用余额支付', 'use_all_money' => '全额支付', 'USER_ORDER_PAID' => '%s订单付款,付款单号%s');
$account_payment_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "payment where class_name = 'Account'");
$payment_notice_id = make_payment_notice($account_money, $order_id, $account_payment_id);
require_once APP_ROOT_PATH . "system/payment/Account_payment.php";
$account_payment = new Account_payment();
$account_payment->get_payment_code($payment_notice_id);
}
$root['order_id'] = $order_id;
$rs = order_paid($order_id);
update_order_cache($order_id);
if ($rs) {
$root['pay_status'] = 1;
} else {
$root['pay_status'] = 0;
}
//end 订单产品生成及支付
$root['status'] = 1;
}
//end 提交订单
}
} else {
$root['user_login_status'] = 0;
$root['status'] = 0;
$root['info'] = '请先登录';
//未登录
}
output($root);
}
示例7: index
//.........这里部分代码省略.........
$sn = verify_event_submit($submit_id);
}
//同步分享
// $title = "报名参加了".$event['name'];
// $content = "报名参加了".$event['name']." - ".$event['brief'];
// $url_route = array(
// 'rel_app_index' => 'youhui',
// 'rel_route' => 'edetail',
// 'rel_param' => 'id='.$event['id']
// );
// $tid = insert_topic($content,$title,$type="eventsubmit",$group="", $relay_id = 0, $fav_id = 0,$group_data ="",$attach_list=array(),$url_route);
// if($tid)
// {
// $GLOBALS['db']->query("update ".DB_PREFIX."topic set source_name = '".$GLOBALS['request']['source']."' where id = ".intval($tid));
// }
//同步分享
$title = "报名参加了" . $event['name'];
$content = "报名参加了" . $event['name'] . " - " . $event['brief'];
$url_route = array('rel_app_index' => 'index', 'rel_route' => 'event#' . $event['id'], 'rel_param' => '');
require_once APP_ROOT_PATH . "system/model/topic.php";
$tid = insert_topic($content, $title, $type = "eventsubmit", $group = "", $relay_id = 0, $fav_id = 0, $group_data = "", $attach_list = array(), $url_route);
if ($tid) {
$GLOBALS['db']->query("update " . DB_PREFIX . "topic set source_name = '" . $GLOBALS['request']['source'] . "' where id = " . intval($tid));
}
require_once APP_ROOT_PATH . "system/model/user.php";
modify_account(array("score" => "-" . $event['score_limit']), $user_id, "活动报名:" . $event['name']);
$root['return'] = 1;
$root['info'] = "报名成功";
if ($sn) {
$root['info'] .= " 验证码:" . $sn;
} else {
$root['info'] .= " 请等待审核";
}
rm_auto_cache("event", array("id" => $event['id']));
} else {
$root['return'] = 0;
$root['info'] = "报名失败";
}
}
}
} else {
$root['return'] = 0;
$root['info'] = "没有该活动数据";
}
} else {
$root['return'] = 0;
$root['user_login_status'] = 0;
$root['info'] = "请先登录";
}
output($root);
//报名
}
//报名结束
$page = intval($GLOBALS['request']['page']);
//分页,无用
if ($page == 0) {
$page = 1;
}
$event_id = intval($GLOBALS['request']['event_id']);
if ($event_id) {
$user_data = $GLOBALS['user_info'];
require_once APP_ROOT_PATH . "system/model/event.php";
$event = get_event($event_id);
if ($event['xpoint'] == '') {
$event['xpoint'] = 0;
}
示例8: save
public function save()
{
global_run();
if (check_save_login() != LOGIN_STATUS_LOGINED) {
$result['status'] = 2;
ajax_return($result);
}
$consignee_id = intval($_REQUEST['region_id']);
$region_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_consignee where user_id = " . $GLOBALS['user_info']['id']);
if ($region_count >= 5 && $consignee_id == 0) {
$result['status'] = 3;
ajax_return($result);
}
if (strim($_REQUEST['consignee']) == '') {
showErr($GLOBALS['lang']['FILL_CORRECT_CONSIGNEE'], 1);
}
if (strim($_REQUEST['address']) == '') {
showErr($GLOBALS['lang']['FILL_CORRECT_ADDRESS'], 1);
}
if (strim($_REQUEST['zip']) == '') {
showErr($GLOBALS['lang']['FILL_CORRECT_ZIP'], 1);
}
if (strim($_REQUEST['mobile']) == '') {
showErr($GLOBALS['lang']['FILL_MOBILE_PHONE'], 1);
}
if (!check_mobile($_REQUEST['mobile'])) {
showErr($GLOBALS['lang']['FILL_CORRECT_MOBILE_PHONE'], 1);
}
$consignee_data['user_id'] = $GLOBALS['user_info']['id'];
$consignee_data['region_lv1'] = intval($_REQUEST['region_lv1']);
$consignee_data['region_lv2'] = intval($_REQUEST['region_lv2']);
$consignee_data['region_lv3'] = intval($_REQUEST['region_lv3']);
$consignee_data['region_lv4'] = intval($_REQUEST['region_lv4']);
$consignee_data['address'] = strim($_REQUEST['address']);
$consignee_data['mobile'] = strim($_REQUEST['mobile']);
$consignee_data['consignee'] = strim($_REQUEST['consignee']);
$consignee_data['zip'] = strim($_REQUEST['zip']);
$consignee_count = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_consignee where user_id = " . $GLOBALS['user_info']['id']));
if ($consignee_count == 0) {
$consignee_data['is_default'] = 1;
}
if ($consignee_id == 0) {
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $consignee_data);
} else {
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $consignee_data, "UPDATE", "id=" . $consignee_id . " and user_id=" . $GLOBALS['user_info']['id']);
}
rm_auto_cache("consignee_info", array("consignee_id" => intval($consignee_id)));
$result['status'] = 1;
$result['url'] = url('index', 'uc_consignee');
ajax_return($result);
}
示例9: set_sort
public function set_sort()
{
$id = intval($_REQUEST['id']);
$sort = intval($_REQUEST['sort']);
$log_info = M(MODULE_NAME)->where("id=" . $id)->getField('name');
if (!check_sort($sort)) {
$this->error(l("SORT_FAILED"), 1);
}
M(MODULE_NAME)->where("id=" . $id)->setField("sort", $sort);
rm_auto_cache("cache_deal_cart", array("id" => $id));
save_log($log_info . l("SORT_SUCCESS"), 1);
$this->success(l("SORT_SUCCESS"), 1);
}
示例10: toogle_status
public function toogle_status()
{
$id = intval($_REQUEST['id']);
$ajax = intval($_REQUEST['ajax']);
$field = $_REQUEST['field'];
$info = $id . "_" . $field;
$c_is_effect = M(MODULE_NAME)->where("id=" . $id)->getField($field);
//当前状态
$n_is_effect = $c_is_effect == 0 ? 1 : 0;
//需设置的状态
//推荐、置顶、精华增加积分等
if ($field == 'is_top' || $field == 'is_best' || $field == 'is_recommend') {
if (!$c_is_effect) {
if ($field == 'is_top') {
$log_txt = '管理员操作置顶';
}
if ($field == 'is_best') {
$log_txt = '管理员操作精华';
}
if ($field == 'is_recommend') {
$log_txt = '管理员操作推荐';
}
$money = doubleval(app_conf("USER_ADD_MONEY"));
$score = intval(app_conf("USER_ADD_SCORE"));
$point = intval(app_conf("USER_ADD_POINT"));
} else {
if ($field == 'is_top') {
$log_txt = '管理员操作取消置顶';
}
if ($field == 'is_best') {
$log_txt = '管理员操作取消精华';
}
if ($field == 'is_recommend') {
$log_txt = '管理员操作取消推荐';
}
$money = -doubleval(app_conf("USER_ADD_MONEY"));
$score = -intval(app_conf("USER_ADD_SCORE"));
$point = -intval(app_conf("USER_ADD_POINT"));
}
if ($money != 0 || $score != 0 || $point != 0) {
$user_id = M(MODULE_NAME)->where("id=" . $id)->getField('user_id');
require_once APP_ROOT_PATH . "system/model/user.php";
modify_account(array("money" => $money, "score" => $score, "point" => $point), $user_id, $log_txt);
}
}
M(MODULE_NAME)->where("id=" . $id)->setField($field, $n_is_effect);
save_log($info . l("SET_EFFECT_" . $n_is_effect), 1);
rm_auto_cache("recommend_forum_topic");
$this->ajaxReturn($n_is_effect, l("SET_EFFECT_" . $n_is_effect), 1);
}
示例11: set_effect
public function set_effect()
{
$id = intval($_REQUEST['id']);
$ajax = intval($_REQUEST['ajax']);
$info = M("User")->where("id=" . $id)->getField("name");
$c_vip_state = M("User")->where("id=" . $id)->getField("vip_state");
//当前状态
$n_vip_state = $c_vip_state == 0 ? 1 : 0;
//需设置的状态
M("User")->where("id=" . $id)->setField("vip_state", $n_vip_state);
save_log($info . l("SET_EFFECT_" . $n_vip_state), 1);
rm_auto_cache("cache_vip_user");
$this->ajaxReturn($n_vip_state, l("SET_EFFECT_" . $n_vip_state), 1);
}
示例12: check_platform_get_pre_auth_code
public function check_platform_get_pre_auth_code()
{
//若在有效期 则直接调用
// if(get_gmtime()<$this->platform_pre_auth_code_expire){
// return $this->platform_pre_auth_code;
// }
$data = array("component_appid" => $this->platform_appid);
$result = $this->http_post(self::API_URL_PREFIX . self::PLATFORM_GET_PRE_AUTH_CODE . $this->platform_component_access_token, json_encode($data));
if ($result) {
$json = json_decode($result, true);
if (!$json || isset($json['errcode'])) {
$this->errCode = $json['errcode'];
$this->errMsg = $json['errmsg'];
return false;
}
$this->platform_pre_auth_code = $json['pre_auth_code'];
$expire = $json['expires_in'] ? intval($json['expires_in']) - 100 : 3600;
$expire = $expire + get_gmtime();
$GLOBALS['db']->query("update " . DB_PREFIX . "weixin_conf set value='" . $this->platform_pre_auth_code . "' where name='platform_pre_auth_code' ");
$GLOBALS['db']->query("update " . DB_PREFIX . "weixin_conf set value='" . $expire . "' where name='platform_pre_auth_code_expire' ");
rm_auto_cache("weixin_conf");
//load_auto_cache("weixin_conf");
return $this->platform_pre_auth_code;
}
return false;
}
示例13: toogle_status
public function toogle_status()
{
$id = intval($_REQUEST['id']);
$ajax = intval($_REQUEST['ajax']);
$field = $_REQUEST['field'];
$info = $id . "_" . $field;
$c_is_effect = M(MODULE_NAME)->where("id=" . $id)->getField($field);
//当前状态
$n_is_effect = $c_is_effect == 0 ? 1 : 0;
//需设置的状态
M(MODULE_NAME)->where("id=" . $id)->setField($field, $n_is_effect);
save_log($info . l("SET_EFFECT_" . $n_is_effect), 1);
rm_auto_cache("recommend_forum_topic");
$this->ajaxReturn($n_is_effect, l("SET_EFFECT_" . $n_is_effect), 1);
}
示例14: index
//.........这里部分代码省略.........
$order['payment_id'] = $data['payment_info']['id'];
$order['payment_fee'] = $data['payment_fee'];
$order['payment_fee'] = $data['payment_fee'];
$order['bank_id'] = 0;
if ($send_mobile != '') {
$GLOBALS['db']->query("update " . DB_PREFIX . "user set mobile = '" . $send_mobile . "' where id = " . $user_id);
}
do {
$order['order_sn'] = to_date(get_gmtime(), "Ymdhis") . rand(10, 99);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order", $order, 'INSERT', '', 'SILENT');
$order_id = intval($GLOBALS['db']->insert_id());
} while ($order_id == 0);
//end 验证成功提交订单成功
//开始生成订单产品以及支付
//生成订单商品
foreach ($goods_list as $k => $v) {
$goods_item = array();
$goods_item['deal_id'] = $v['deal_id'];
$goods_item['number'] = $v['number'];
$goods_item['unit_price'] = $v['unit_price'];
$goods_item['total_price'] = $v['total_price'];
$goods_item['name'] = addslashes($v['name']);
$goods_item['sub_name'] = addslashes($v['sub_name']);
$goods_item['attr'] = $v['attr'];
$goods_item['verify_code'] = $v['verify_code'];
$goods_item['order_id'] = $order_id;
$goods_item['return_score'] = $v['return_score'];
$goods_item['return_total_score'] = $v['return_total_score'];
$goods_item['return_money'] = $v['return_money'];
$goods_item['return_total_money'] = $v['return_total_money'];
$goods_item['buy_type'] = $v['buy_type'];
$goods_item['attr_str'] = $v['attr_str'];
$deal_info = load_auto_cache("cache_deal_cart", array("id" => $v['deal_id']));
$goods_item['balance_unit_price'] = $deal_info['balance_price'];
$goods_item['balance_total_price'] = $deal_info['balance_price'] * $v['number'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order_item", $goods_item, 'INSERT', '', 'SILENT');
}
//开始更新订单表的deal_ids
$deal_ids = $GLOBALS['db']->getOne("select group_concat(deal_id) from " . DB_PREFIX . "deal_order_item where order_id = " . $order_id);
$GLOBALS['db']->query("update " . DB_PREFIX . "deal_order set deal_ids = '" . $deal_ids . "' where id = " . $order_id);
if ($data['is_delivery'] == 1) {
//保存收款人
$user_consignee = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_consignee where user_id = " . $user_id . " order by id desc");
$user_consignee['region_lv1'] = $region1_id;
$user_consignee['region_lv2'] = $region2_id;
$user_consignee['region_lv3'] = $region3_id;
$user_consignee['region_lv4'] = $region4_id;
$user_consignee['address'] = htmlspecialchars($address);
$user_consignee['mobile'] = htmlspecialchars($consignee_mobile);
$user_consignee['consignee'] = htmlspecialchars($consignee);
$user_consignee['zip'] = htmlspecialchars($zip);
$user_consignee['user_id'] = $user_id;
if (intval($user_consignee['id']) == 0) {
//新增
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $user_consignee, 'INSERT', '', 'SILENT');
} else {
//更新
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $user_consignee, 'UPDATE', 'id=' . $user_consignee['id'], 'SILENT');
rm_auto_cache("consignee_info", array("consignee_id" => intval($user_consignee['id'])));
}
}
//生成order_id 后
//1. 代金券支付
$ecv_data = $data['ecv_data'];
if ($ecv_data) {
$ecv_payment_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "payment where class_name = 'Voucher'");
$payment_notice_id = make_payment_notice($ecv_data['money'], $order_id, $ecv_payment_id);
require_once APP_ROOT_PATH . "system/payment/Voucher_payment.php";
$voucher_payment = new Voucher_payment();
$voucher_payment->direct_pay($ecv_data['sn'], $ecv_data['password'], $payment_notice_id);
}
//2. 余额支付
$account_money = $data['account_money'];
if (floatval($account_money) > 0) {
$GLOBALS['payment_lang'] = array('name' => '余额支付', 'account_credit' => '帐户余额', 'use_user_money' => '使用余额支付', 'use_all_money' => '全额支付', 'USER_ORDER_PAID' => '%s订单付款,付款单号%s');
$account_payment_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "payment where class_name = 'Account'");
$payment_notice_id = make_payment_notice($account_money, $order_id, $account_payment_id);
require_once APP_ROOT_PATH . "system/payment/Account_payment.php";
$account_payment = new Account_payment();
$account_payment->get_payment_code($payment_notice_id);
}
$root['order_id'] = $order_id;
$rs = order_paid($order_id);
if ($rs) {
$root['pay_status'] = 1;
} else {
$root['pay_status'] = 0;
}
//end 订单产品生成及支付
$root['status'] = 1;
}
//end 提交订单
}
} else {
$root['user_login_status'] = 1;
$root['status'] = 0;
//未登录
}
output($root);
}
示例15: clear_history
/**
* 清空浏览历史
*/
public function clear_history()
{
global_run();
$type = strim($_REQUEST['type']);
if ($type == "alldeal") {
rm_auto_cache("cache_history", array("type" => "deal", "city_id" => $GLOBALS['city']['id']));
rm_auto_cache("cache_history", array("type" => "shop", "city_id" => $GLOBALS['city']['id']));
} else {
rm_auto_cache("cache_history", array("type" => $type, "city_id" => $GLOBALS['city']['id']));
}
$data['status'] = 1;
ajax_return($data);
}