本文整理汇总了PHP中clear_cache_files函数的典型用法代码示例。如果您正苦于以下问题:PHP clear_cache_files函数的具体用法?PHP clear_cache_files怎么用?PHP clear_cache_files使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clear_cache_files函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$sql_list = strim($GLOBALS['request']['sql_list']);
$clear_cache = $GLOBALS['request']['clear_cache'];
$sql_list = explode(";", $sql_list);
//logutils::log_obj( $sql_list );
foreach ($sql_list as $sql) {
//logutils::log_str( $sql );
$sync_item = array();
$sync_item['succ'] = $GLOBALS['db']->query($sql, 'SILENT');
if ($sync_item['succ'] == false) {
$sync_item['data'] = $sql;
$sync_item['errmsg'] = $GLOBALS['db']->error();
$syncitems[] = $sync_item;
break;
}
$syncitems[] = $sync_item;
}
if ($clear_cache == true) {
clear_cache_files();
}
$root = array("succ" => true, "items" => $syncitems);
output($root);
}
示例2: make_json_error
/* 高度值必须是数字 */
if (!preg_match("/^[\.0-9]+$/",$ad_height))
{
make_json_error($_LANG['height_number']);
}
/* 广告位宽度应在1-1024之间 */
if ($ad_height > 2000 || $ad_height < 1)
{
make_json_error($_LANG['height_value']);
}
if ($exc->edit("ad_height = '$ad_height'", $id))
{
clear_cache_files(); // 清除模版缓存
admin_log($ad_height, 'edit', 'ads_position');
make_json_result(stripslashes($ad_height));
}
else
{
make_json_error($db->error());
}
}
/*------------------------------------------------------ */
//-- 删除广告位置
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'remove')
{
check_authz_json('ad_manage');
示例3: elseif
$smarty->display('user_transaction.dwt');
}
} elseif ($action == 'add_tag') {
include_once 'includes/cls_json.php';
include_once 'includes/lib_clips.php';
$result = array('error' => 0, 'message' => '', 'content' => '');
$id = isset($_POST['id']) ? intval($_POST['id']) : 0;
$tag = isset($_POST['tag']) ? json_str_iconv(trim($_POST['tag'])) : '';
if ($user_id == 0) {
/* 用户没有登录 */
$result['error'] = 1;
$result['message'] = $_LANG['tag_anonymous'];
} else {
add_tag($id, $tag);
// 添加tag
clear_cache_files('goods');
// 删除缓存
/* 重新获得该商品的所有缓存 */
$arr = get_tags($id);
foreach ($arr as $row) {
$result['content'][] = array('word' => htmlspecialchars($row['tag_words']), 'count' => $row['tag_count']);
}
}
$json = new JSON();
echo $json->encode($result);
exit;
} elseif ($action == 'collect') {
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
$result = array('error' => 0, 'message' => '');
$goods_id = $_GET['id'];
示例4: add_comment
/**
* 添加评论内容
*
* @access public
* @param object $cmt
* @return void
*/
function add_comment($cmt)
{
/* 评论是否需要审核 */
$status = 1 - $GLOBALS['_CFG']['comment_check'];
$user_id = empty($_SESSION['user_id']) ? 0 : $_SESSION['user_id'];
$email = empty($cmt->email) ? $_SESSION['email'] : trim($cmt->email);
$user_name = empty($cmt->username) ? $_SESSION['user_name'] : '';
$email = htmlspecialchars($email);
$user_name = htmlspecialchars($user_name);
/* 保存评论内容 */
$sql = "INSERT INTO " . $GLOBALS['ecs']->table('comment') . "(comment_type, id_value, email, user_name, content, comment_rank, add_time, ip_address, status, parent_id, user_id) VALUES " . "('" . $cmt->type . "', '" . $cmt->id . "', '{$email}', '{$user_name}', '" . $cmt->content . "', '" . $cmt->rank . "', " . gmtime() . ", '" . real_ip() . "', '{$status}', '0', '{$user_id}')";
$result = $GLOBALS['db']->query($sql);
$goods_id = $cmt->id;
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND comment_type = 0 AND status = 1 AND parent_id = 0 ";
$count = $GLOBALS['db']->getOne($sql);
if (empty($count)) {
$count = 0;
}
$sql = "UPDATE " . $GLOBALS['ecs']->table('goods') . " SET comments_number = '{$count}' WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
clear_cache_files();
//clear_cache_files('comments_list.lbi');
/*if ($status > 0)
{
add_feed($GLOBALS['db']->insert_id(), COMMENT_GOODS);
}*/
return $result;
}
示例5: add_comment
/**
* 添加评论内容.
*
* @param object $cmt
*/
function add_comment($cmt)
{
/* 评论是否需要审核 */
$status = 1 - $GLOBALS['_CFG']['comment_check'];
$user_id = empty($_SESSION['user_id']) ? 0 : $_SESSION['user_id'];
$email = empty($cmt->email) ? $_SESSION['email'] : trim($cmt->email);
$user_name = empty($cmt->username) ? $_SESSION['user_name'] : '';
$email = htmlspecialchars($email);
$user_name = htmlspecialchars($user_name);
/* 保存评论内容 */
$sql = 'INSERT INTO ' . $GLOBALS['ecs']->table('comment') . '(comment_type, id_value, email, user_name, content, comment_rank, add_time, ip_address, status, parent_id, user_id) VALUES ' . "('" . $cmt->type . "', '" . $cmt->id . "', '{$email}', '{$user_name}', '" . $cmt->content . "', '" . $cmt->rank . "', " . gmtime() . ", '" . real_ip() . "', '{$status}', '0', '{$user_id}')";
$result = $GLOBALS['db']->query($sql);
clear_cache_files('comments_list.lbi');
/*if ($status > 0)
{
add_feed($GLOBALS['db']->insert_id(), COMMENT_GOODS);
}*/
return $result;
}
示例6: delete_goods
/**
* 从回收站删除多个商品
* @param mix $goods_id 商品id列表:可以逗号格开,也可以是数组
* @return void
*/
function delete_goods($goods_id)
{
if (empty($goods_id)) {
return;
}
/* 取得有效商品id */
$sql = "SELECT DISTINCT goods_id FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id " . db_create_in($goods_id) . " AND is_delete = 1";
$goods_id = $GLOBALS['db']->getCol($sql);
if (empty($goods_id)) {
return;
}
/* 删除商品图片和轮播图片文件 */
$sql = "SELECT goods_thumb, goods_img, original_img " . "FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id " . db_create_in($goods_id);
$res = $GLOBALS['db']->query($sql);
while ($goods = $GLOBALS['db']->fetchRow($res)) {
if (!empty($goods['goods_thumb'])) {
@unlink('../' . $goods['goods_thumb']);
}
if (!empty($goods['goods_img'])) {
@unlink('../' . $goods['goods_img']);
}
if (!empty($goods['original_img'])) {
@unlink('../' . $goods['original_img']);
}
}
/* 删除商品 */
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
/* 删除商品的货品记录 */
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('products') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
/* 删除商品相册的图片文件 */
$sql = "SELECT img_url, thumb_url, img_original " . "FROM " . $GLOBALS['ecs']->table('goods_gallery') . " WHERE goods_id " . db_create_in($goods_id);
$res = $GLOBALS['db']->query($sql);
while ($row = $GLOBALS['db']->fetchRow($res)) {
if (!empty($row['img_url'])) {
@unlink('../' . $row['img_url']);
}
if (!empty($row['thumb_url'])) {
@unlink('../' . $row['thumb_url']);
}
if (!empty($row['img_original'])) {
@unlink('../' . $row['img_original']);
}
}
/* 删除商品相册 */
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_gallery') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
/* 删除相关表记录 */
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('collect_goods') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_article') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_attr') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_cat') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('member_price') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('group_goods') . " WHERE parent_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('group_goods') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('link_goods') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('link_goods') . " WHERE link_goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('tag') . " WHERE goods_id " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('comment') . " WHERE comment_type = 0 AND id_value " . db_create_in($goods_id);
$GLOBALS['db']->query($sql);
/* 删除相应虚拟商品记录 */
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('virtual_card') . " WHERE goods_id " . db_create_in($goods_id);
if (!$GLOBALS['db']->query($sql, 'SILENT') && $GLOBALS['db']->errno() != 1146) {
die($GLOBALS['db']->error());
}
/* 清除缓存 */
clear_cache_files();
}
示例7: cancel_delivery
function cancel_delivery($order_id, $delivery_id)
{
global $db, $ecs;
/* 取得参数 */
$delivery = '';
/* 根据发货单id查询发货单信息 */
if (!empty($delivery_id)) {
$delivery_order = delivery_order_info($delivery_id);
} else {
sys_msg('订单号不能为空!', 1);
}
/* 查询订单信息 */
$order = order_info($order_id);
/* 取消当前发货单物流单号 */
$_delivery['invoice_no'] = '';
$_delivery['status'] = 2;
$query = $db->autoExecute($ecs->table('delivery_order'), $_delivery, 'UPDATE', "delivery_id = {$delivery_id}", 'SILENT');
if (!$query) {
/* 操作失败 */
$links[] = array('text' => $GLOBALS['_LANG']['delivery_sn'] . $GLOBALS['_LANG']['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
sys_msg($GLOBALS['_LANG']['act_false'], 1, $links);
exit;
}
/* 修改定单发货单号 */
$invoice_no_order = explode('<br>', $order['invoice_no']);
$invoice_no_delivery = explode('<br>', $delivery_order['invoice_no']);
foreach ($invoice_no_order as $key => $value) {
$delivery_key = array_search($value, $invoice_no_delivery);
if ($delivery_key !== false) {
unset($invoice_no_order[$key], $invoice_no_delivery[$delivery_key]);
if (count($invoice_no_delivery) == 0) {
break;
}
}
}
$_order['invoice_no'] = implode('<br>', $invoice_no_order);
/* 更新配送状态 */
$order_finish = get_all_delivery_finish($order_id);
$shipping_status = $order_finish == -1 ? SS_SHIPPED_PART : SS_SHIPPED_ING;
$arr['shipping_status'] = $shipping_status;
if ($shipping_status == SS_SHIPPED_ING) {
$arr['shipping_time'] = '';
// 发货时间
}
$arr['invoice_no'] = $_order['invoice_no'];
update_order($order_id, $arr);
/* 发货单取消发货记录log */
order_action($order['order_sn'], $order['order_status'], $shipping_status, $order['pay_status'], $action_note, null, 1);
/* 如果使用库存,则增加库存 */
if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP) {
// 检查此单发货商品数量
$virtual_goods = array();
$delivery_stock_sql = "SELECT DG.goods_id, DG.product_id, DG.is_real, SUM(DG.send_number) AS sums\r\n FROM " . $GLOBALS['ecs']->table('delivery_goods') . " AS DG\r\n WHERE DG.delivery_id = '{$delivery_id}'\r\n GROUP BY DG.goods_id ";
$delivery_stock_result = $GLOBALS['db']->getAll($delivery_stock_sql);
foreach ($delivery_stock_result as $key => $value) {
/* 虚拟商品 */
if ($value['is_real'] == 0) {
continue;
}
//(货品)
if (!empty($value['product_id'])) {
$minus_stock_sql = "UPDATE " . $GLOBALS['ecs']->table('products') . "\r\n SET product_number = product_number + " . $value['sums'] . "\r\n WHERE product_id = " . $value['product_id'];
$GLOBALS['db']->query($minus_stock_sql, 'SILENT');
}
$minus_stock_sql = "UPDATE " . $GLOBALS['ecs']->table('goods') . "\r\n SET goods_number = goods_number + " . $value['sums'] . "\r\n WHERE goods_id = " . $value['goods_id'];
$GLOBALS['db']->query($minus_stock_sql, 'SILENT');
}
}
/* 发货单全退回时,退回其它 */
if ($order['order_status'] == SS_SHIPPED_ING) {
/* 如果订单用户不为空,计算积分,并退回 */
if ($order['user_id'] > 0) {
/* 取得用户信息 */
$user = user_info($order['user_id']);
/* 计算并退回积分 */
$integral = integral_to_give($order);
log_account_change($order['user_id'], 0, 0, -1 * intval($integral['rank_points']), -1 * intval($integral['custom_points']), sprintf($GLOBALS['_LANG']['return_order_gift_integral'], $order['order_sn']));
/* todo 计算并退回红包 */
return_order_bonus($order_id);
}
}
/* 清除缓存 */
clear_cache_files();
/* 操作成功 */
$links[] = array('text' => $GLOBALS['_LANG']['delivery_sn'] . $GLOBALS['_LANG']['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
sys_msg($GLOBALS['_LANG']['act_ok'], 0, $links);
}
示例8: add_comment
/**
* 添加评论内容
*
* @access public
* @param object $cmt
* @return void
*/
function add_comment($cmt)
{
/* 评论是否需要审核 */
$status = 1 - C('comment_check');
$user_id = empty($_SESSION['user_id']) ? 0 : $_SESSION['user_id'];
$email = empty($cmt->email) ? $_SESSION['email'] : trim($cmt->email);
$user_name = empty($cmt->username) ? $_SESSION['user_name'] : '';
$email = htmlspecialchars($email);
$user_name = htmlspecialchars($user_name);
/* 保存评论内容 */
$sql = "INSERT INTO " . $this->pre . "comment(comment_type, id_value, email, user_name, content, comment_rank, add_time, ip_address, status, parent_id, user_id) VALUES " . "('" . $cmt->type . "', '" . $cmt->id . "', '{$email}', '{$user_name}', '" . $cmt->content . "', '" . $cmt->rank . "', " . gmtime() . ", '" . real_ip() . "', '{$status}', '0', '{$user_id}')";
$result = $this->query($sql);
clear_cache_files('comments_list.lbi');
return $result;
}
示例9: license_reg
/**
* 功能:license 注册
*
* @param array $certi_added 配置信息补充数组 array_key 登录信息的key;array_key => array_value;
* @return array $return_array['flag'] = reg_succ、reg_fail、reg_ping_fail;
* $return_array['request'];
*/
function license_reg($certi_added = '')
{
// 登录信息配置
$certi['certi_app'] = '';
// 证书方法
$certi['app_id'] = 'ectouch_free';
// 说明客户端来源
$certi['app_instance_id'] = '';
// 应用服务ID
$certi['version'] = LICENSE_VERSION;
// license接口版本号
$certi['shop_version'] = VERSION . '#' . RELEASE;
// 网店软件版本号
$certi['certi_url'] = sprintf(__URL__);
// 网店URL
$certi['certi_session'] = ECTouch::sess()->get_session_id();
// 网店SESSION标识
$certi['certi_validate_url'] = sprintf(__URL__ . url('api/certi'));
// 网店提供于官方反查接口
$certi['format'] = 'json';
// 官方返回数据格式
$certi['certificate_id'] = '';
// 网店证书ID
// 标识
$certi_back['succ'] = 'succ';
$certi_back['fail'] = 'fail';
// return 返回数组
$return_array = array();
if (is_array($certi_added)) {
foreach ($certi_added as $key => $value) {
$certi[$key] = $value;
}
}
// 取出网店 license
$license = model('LicenseBase')->get_shop_license();
// 注册
$certi['certi_app'] = 'certi.reg';
// 证书方法
$certi['certi_ac'] = make_shopex_ac($certi, '');
// 网店验证字符串
unset($certi['certificate_id']);
$request_arr = exchange_shop_license($certi, $license);
if (is_array($request_arr) && $request_arr['res'] == $certi_back['succ']) {
// 注册信息入库
$data['value'] = $request_arr['info']['certificate_id'];
$condition['code'] = 'certificate_id';
model('Base')->table('touch_shop_config')->data($data)->where($condition)->update();
$data['value'] = $request_arr['info']['token'];
$condition['code'] = 'certificate_id';
model('Base')->table('touch_shop_config')->data($data)->where($condition)->update();
$return_array['flag'] = 'reg_succ';
$return_array['request'] = $request_arr;
clear_cache_files();
} elseif (is_array($request_arr) && $request_arr['res'] == $certi_back['fail']) {
$return_array['flag'] = 'reg_fail';
$return_array['request'] = $request_arr;
} else {
$return_array['flag'] = 'reg_ping_fail';
$return_array['request'] = array('res' => 'fail');
}
return $return_array;
}
示例10: index
public function index()
{
clear_cache_files();
output($root);
}
示例11: cancel_delivery
//.........这里部分代码省略.........
$delivery_order = delivery_order_info($delivery_id);
} else {
sys_msg('订单号不能为空!', 1);
}
/* 查询订单信息 */
$order = order_info($order_id);
/* 取消当前发货单物流单号 */
$_delivery['invoice_no'] = '';
$_delivery['status'] = 2;
$query = $db->autoExecute($ecs->table('delivery_order'), $_delivery, 'UPDATE', "delivery_id = {$delivery_id}", 'SILENT');
if (!$query) {
/* 操作失败 */
$links[] = array('text' => $GLOBALS['_LANG']['delivery_sn'] . $GLOBALS['_LANG']['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
sys_msg($GLOBALS['_LANG']['act_false'], 1, $links);
exit;
}
/* 修改定单发货单号 */
$invoice_no_order = explode('<br>', $order['invoice_no']);
$invoice_no_delivery = explode('<br>', $delivery_order['invoice_no']);
foreach ($invoice_no_order as $key => $value) {
$delivery_key = array_search($value, $invoice_no_delivery);
if ($delivery_key !== false) {
unset($invoice_no_order[$key], $invoice_no_delivery[$delivery_key]);
if (count($invoice_no_delivery) == 0) {
break;
}
}
}
$_order['invoice_no'] = implode('<br>', $invoice_no_order);
/* 更新配送状态 */
$order_finish = get_all_delivery_finish($order_id);
$shipping_status = $order_finish == -1 ? SS_SHIPPED_PART : SS_SHIPPED_ING;
$arr['shipping_status'] = $shipping_status;
if ($shipping_status == SS_SHIPPED_ING) {
$arr['shipping_time'] = '';
// 发货时间
}
$arr['invoice_no'] = $_order['invoice_no'];
update_order($order_id, $arr);
/* 发货单取消发货记录log */
order_action($order['order_sn'], $order['order_status'], $shipping_status, $order['pay_status'], $action_note, null, 1);
/* 如果使用库存,则增加库存 */
/* 代码增加_start By morestock_morecity */
if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_SHIP) {
$delivery_stock_sql = "SELECT * FROM " . $GLOBALS['ecs']->table('delivery_goods') . " WHERE delivery_id = '{$delivery_id}' ";
$delivery_stock_result = $GLOBALS['db']->getAll($delivery_stock_sql);
$store_error = '';
//$goods_attr_id = get_goods_attr_id($value['goods_id'], $value['goods_attr']);
$store_id_zhyh = get_storeid_by_ssq($order['province'], $order['city'], $order['district'], $order['xiangcun'], $order['supplier_id']);
if (!$store_id_zhyh) {
$store_error = '该发货单没有对应仓库!';
}
if ($store_error) {
sys_msg($store_error);
} else {
foreach ($delivery_stock_result as $key => $value) {
$goods_attr_id = get_goods_attr_id($value['goods_id'], $value['goods_attr']);
$store_row = get_storeid_youhuo($order['province'], $order['city'], $order['district'], $order['xiangcun'], $value['goods_id'], $goods_attr_id, $order['supplier_id'], $order_id);
$add_time = gmtime();
$add_date = local_date('Ymd');
$sql = "select max(today_sn) from " . $ecs->table('store_inout_list') . " where inout_mode=2 and add_date='{$add_date}' ";
$inout_count = $db->getOne($sql);
$inout_sn = $inout_count ? intval($inout_count + 1) : 1;
$today_sn = $inout_sn;
$inout_sn = str_pad($inout_sn, 4, "0", STR_PAD_LEFT);
$inout_sn = 'rk' . $add_date . $inout_sn;
$stock_type_id = 0;
if ($order['supplier_id'] > 0) {
$stock_type_id = $db->getOne('select type from ' . $ecs->table('store_type') . " where supplier_id=" . $order['supplier_id']);
}
$sql = "insert into " . $ecs->table('store_inout_list') . "(inout_sn, inout_status, store_id, adminer_id, inout_type, inout_mode, order_sn, " . "takegoods_man, today_sn, add_date, add_time, supplier_id, store_type_id) " . "values('{$inout_sn}', '3', '{$store_row['store_id']}', '{$_SESSION['supplier_user_id']}', '5', '2', '{$order['order_sn']}', " . "'{$_SESSION['supplier_name']}', '{$today_sn}' , '{$add_date}', '{$add_time}','{$order['supplier_id']}', '{$stock_type_id}' ) ";
$db->query($sql);
$inout_rec_id = $db->insert_id();
$sql = "insert into " . $ecs->table('store_inout_goods') . "(inout_rec_id, goods_id, goods_sn, attr_value, inout_mode, number_yingshou, number_shishou, supplier_id, store_type_id) " . "values('{$inout_rec_id}', '{$value['goods_id']}', '{$value['goods_sn']}', '{$goods_attr_id}', '2', '{$value['send_number']}', '{$value['send_number']}','{$order['supplier_id']}', '{$stock_type_id}') ";
$db->query($sql);
$upre = update_stock_in($inout_rec_id, $store_row['store_id']);
//更新库存表
}
}
}
/* 代码增加_end By morestock_morecity */
/* 发货单全退回时,退回其它 */
if ($order['order_status'] == SS_SHIPPED_ING) {
/* 如果订单用户不为空,计算积分,并退回 */
if ($order['user_id'] > 0) {
/* 取得用户信息 */
$user = user_info($order['user_id']);
/* 计算并退回积分 */
$integral = integral_to_give($order);
log_account_change($order['user_id'], 0, 0, -1 * intval($integral['rank_points']), -1 * intval($integral['custom_points']), sprintf($GLOBALS['_LANG']['return_order_gift_integral'], $order['order_sn']));
/* todo 计算并退回红包 */
return_order_bonus($order_id);
}
}
/* 清除缓存 */
clear_cache_files();
/* 操作成功 */
$links[] = array('text' => $GLOBALS['_LANG']['delivery_sn'] . $GLOBALS['_LANG']['detail'], 'href' => 'order.php?act=delivery_info&delivery_id=' . $delivery_id);
sys_msg($GLOBALS['_LANG']['act_ok'], 0, $links);
}
示例12: drop_goods
//.........这里部分代码省略.........
$tableExist['volume_price'] = checkTableExist('volume_price');
$tableExist['virtual_card'] = checkTableExist('virtual_card');
foreach ($goods_id_arr as $goods_id) {
$sql = "SELECT goods_id, goods_name, is_delete, is_real, goods_thumb, " . "goods_img, original_img " . "FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id = '{$goods_id}'";
$goods = $GLOBALS['db']->getRow($sql);
if (!empty($goods['goods_id'])) {
if (!empty($goods['goods_thumb'])) {
@unlink('../' . $goods['goods_thumb']);
}
if (!empty($goods['goods_img'])) {
@unlink('../' . $goods['goods_img']);
}
if (!empty($goods['original_img'])) {
@unlink('../' . $goods['original_img']);
}
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
$sql = "SELECT img_url, thumb_url, img_original " . "FROM " . $GLOBALS['ecs']->table('goods_gallery') . " WHERE goods_id = '{$goods_id}'";
$res = $GLOBALS['db']->query($sql);
while ($row = $GLOBALS['db']->fetchRow($res)) {
if (!empty($row['img_url'])) {
@unlink('../' . $row['img_url']);
}
if (!empty($row['thumb_url'])) {
@unlink('../' . $row['thumb_url']);
}
if (!empty($row['img_original'])) {
@unlink('../' . $row['img_original']);
}
}
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_gallery') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
if ($tableExist['collect_goods']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('collect_goods') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['goods_article']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_article') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['goods_activity']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_activity') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['goods_attr']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_attr') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['goods_cat']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_cat') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['member_price']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('member_price') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['group_goods']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('group_goods') . " WHERE parent_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('group_goods') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['link_goods']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('link_goods') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('link_goods') . " WHERE link_goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['tag']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('tag') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['comment']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('comment') . " WHERE comment_type = 0 AND id_value = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['booking_goods']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('booking_goods') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($tableExist['volume_price']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('volume_price') . " WHERE price_type = '1' AND goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
if ($goods['is_real'] != 1 && $tableExist['virtual_card']) {
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('virtual_card') . " WHERE goods_id = '{$goods_id}'";
$GLOBALS['db']->query($sql);
}
}
$sync_item = array();
$sync_item['table'] = "ecs_goods";
$sync_item['guid'] = $goods_id;
$sync_item['succ'] = true;
//$sync_item['errmsg'] = base64_encode($tmp);
$syncitems[] = $sync_item;
}
clear_cache_files();
$pack = array("succ" => true, "items" => $syncitems);
return $pack;
}
示例13: action_remove
function action_remove()
{
// 全局变量
// $user = $GLOBALS['user'];
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$exc = $GLOBALS['exc'];
check_authz_json('admin_drop');
$id = intval($_GET['id']);
/* 获得管理员用户名 */
$action_list = $db->getOne('SELECT action_list FROM ' . $ecs->table('supplier_admin_user') . " WHERE user_id='{$id}' AND supplier_id='{$_SESSION['supplier_id']}'");
/* 总管理员这个管理员不允许删除 */
if ($action_list == 'all') {
// make_json_error($_LANG['edit_remove_cannot']);
make_json_error($_LANG['remove_cannot']);
}
/* ID为1的不允许删除 */
// if ($id == 1)
// {
// make_json_error($_LANG['remove_cannot']);
// }
/* 管理员不能删除自己 */
if ($id == $_SESSION['supplier_user_id']) {
make_json_error($_LANG['remove_self_cannot']);
}
if ($exc->drop($id)) {
// $sess->delete_spec_admin_session($id); // 删除session中该管理员的记录
// admin_log(addslashes($admin_name), 'remove', 'privilege');
clear_cache_files();
}
$url = 'privilege.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
ecs_header("Location: {$url}\n");
exit;
}
示例14: set_time_limit
<?php
set_time_limit(0);
include_once "config.php";
include_once "include/utils/utils.php";
global $mod_strings;
$count = clear_cache_files();
create_tab_data_file();
create_parenttab_data_file();
RecalculateSharingRules();
//echo "<center><font siez=15><b>".$mod_strings["LBL_CLEAR_DATABASE_CACHE"]."</b></font></center>";
$category = getParentTab();
echo "<script language=javascript>alert('" . $mod_strings["LBL_CLEARED_DATABASE_CACHE"] . "');document.location.href='index.php?module=Settings&action=index&parenttab=" . $category . "';</script>";
示例15: license_reg
/**
* 功能:license 注册
*
* @param array $certi_added 配置信息补充数组 array_key 登录信息的key;array_key => array_value;
* @return array $return_array['flag'] = reg_succ、reg_fail、reg_ping_fail;
* $return_array['request'];
*/
function license_reg($certi_added = '')
{
// 登录信息配置
$certi['certi_app'] = '';
// 证书方法
$certi['app_id'] = 'ecshop_b2c';
// 说明客户端来源
$certi['app_instance_id'] = '';
// 应用服务ID
$certi['version'] = LICENSE_VERSION;
// license接口版本号
$certi['shop_version'] = VERSION . '#' . RELEASE;
// 网店软件版本号
$certi['certi_url'] = sprintf($GLOBALS['ecs']->url());
// 网店URL
$certi['certi_session'] = $GLOBALS['sess']->get_session_id();
// 网店SESSION标识
$certi['certi_validate_url'] = sprintf($GLOBALS['ecs']->url() . 'certi.php');
// 网店提供于官方反查接口
$certi['format'] = 'json';
// 官方返回数据格式
$certi['certificate_id'] = '';
// 网店证书ID
// 标识
$certi_back['succ'] = 'succ';
$certi_back['fail'] = 'fail';
// return 返回数组
$return_array = array();
if (is_array($certi_added)) {
foreach ($certi_added as $key => $value) {
$certi[$key] = $value;
}
}
// 取出网店 license
$license = get_shop_license();
// 注册
$certi['certi_app'] = 'certi.reg';
// 证书方法
$certi['certi_ac'] = make_shopex_ac($certi, '');
// 网店验证字符串
unset($certi['certificate_id']);
$request_arr = exchange_shop_license($certi, $license);
if (is_array($request_arr) && $request_arr['res'] == $certi_back['succ']) {
// 注册信息入库
$sql = "UPDATE " . $GLOBALS['ecs']->table('shop_config') . "\n SET value = '" . $request_arr['info']['certificate_id'] . "' WHERE code = 'certificate_id'";
$GLOBALS['db']->query($sql);
$sql = "UPDATE " . $GLOBALS['ecs']->table('shop_config') . "\n SET value = '" . $request_arr['info']['token'] . "' WHERE code = 'token'";
$GLOBALS['db']->query($sql);
$return_array['flag'] = 'reg_succ';
$return_array['request'] = $request_arr;
clear_cache_files();
} elseif (is_array($request_arr) && $request_arr['res'] == $certi_back['fail']) {
$return_array['flag'] = 'reg_fail';
$return_array['request'] = $request_arr;
} else {
$return_array['flag'] = 'reg_ping_fail';
$return_array['request'] = array('res' => 'fail');
}
return $return_array;
}