public function Errors($caller) { switch (json_last_error()) { case JSON_ERROR_NONE: return; default: plog('JSON->' . $caller . '(): ' . json_last_error_msg()); return; } }
function p($data, $log = false) { $debug = debug_backtrace(); print "<pre>"; echo "File: " . $debug[0]['file'] . " | Line: " . $debug[0]['line'] . "\n\n"; print_r($data); print "</pre>"; if ($log) { plog($data); } }
static function ACL($required) { global $auth, $auth_database; if (!is_array($auth)) { return FALSE; } if (!isset($auth['acl'])) { return FALSE; } plog('Checking ACL: ' . (is_array($required) ? implode(',', $required) : $required)); return ACL::has($auth['acl'], $required); }
function AutoLockMechanism(&$p, $table, $id) { plog("AutoLockMechanism: Start"); $p->HTML('<div class="apadlockarea">' . '<span id="apadlockface" class=""></span>' . ' <span id="apadlockmsg"></span>' . '</div>'); $p->JS(' var page_was_locked=false; function set_row_mutex(d) { var msg=$("#apadlockmsg").get(0).innerHTML; var first_check=(msg.length == 0 ); var page_unlocked_to_me= ( d.unlocked == 1 ); if ( !page_unlocked_to_me ) { $("input").attr("readonly", "readonly"); $("textarea").attr("readonly", "readonly"); $("select").hide(); page_was_locked=true; $("#apadlockface").addClass("fi-lock"); $("#apadlockarea").addClass("apadlock"); $("#apadlockmsg").get(0).innerHTML=d.message; } else if ( !first_check ) { if ( page_was_locked && page_unlocked_to_me ) document.location.reload(true); } else { $("#apadlockface").removeClass("fi-lock"); $("#apadlockmsg").get(0).innerHTML="You have edit control"; } } '); $p->JQ(' $.ajax({ url:"ajax.auto.skeleton.key", data:{T:"' . $table . '",I:' . $id . '}, dataType:"json", success:function(d){ set_row_mutex(d); } }); setInterval(function(){ $.ajax({ url:"ajax.auto.skeleton.key", data:{T:"' . $table . '",I:' . $id . '}, dataType:"json", success:function(d){ set_row_mutex(d); } }); }, 5000 ); '); plog("AutoLockMechanism: End"); }
pdo_insert('ewei_shop_saler', $data); $id = pdo_insertid(); plog('verify.saler.add', "添加核销员 ID: {$id} <br/>核销员信息: ID: {$m['id']} / {$m['openid']}/{$m['nickname']}/{$m['realname']}/{$m['mobile']} "); } message('更新核销员成功!', $this->createPluginWebUrl('verify/saler', array('op' => 'display')), 'success'); } } elseif ($operation == 'delete') { ca('verify.saler.delete'); $id = intval($_GPC['id']); $item = pdo_fetch("SELECT id,openid FROM " . tablename('ewei_shop_saler') . " WHERE id = '{$id}'"); if (empty($item)) { message('抱歉,核销员不存在或是已经被删除!', $this->createPluginWebUrl('verify/saler', array('op' => 'display')), 'error'); } pdo_delete('ewei_shop_saler', array('id' => $id, 'uniacid' => $_W['uniacid'])); $m = m('member')->getMember($item['openid']); plog('verify.saler.delete', "删除核销员 ID: {$id} <br/>核销员信息: ID: {$m['id']} / {$m['openid']}/{$m['nickname']}/{$m['realname']}/{$m['mobile']} "); message('核销员删除成功!', $this->createPluginWebUrl('verify/saler', array('op' => 'display')), 'success'); } elseif ($operation == 'query') { $kwd = trim($_GPC['keyword']); $params = array(); $params[':uniacid'] = $_W['uniacid']; $condition = " and s.uniacid=:uniacid"; if (!empty($kwd)) { $condition .= " AND ( m.nickname LIKE :keyword or m.realname LIKE :keyword or m.mobile LIKE :keyword or store.storename like :keyword )"; $params[':keyword'] = "%{$kwd}%"; } $ds = pdo_fetchall("SELECT s.*,m.nickname,m.avatar,m.mobile,m.realname,store.storename FROM " . tablename('ewei_shop_saler') . " s " . " left join " . tablename('ewei_shop_member') . " m on s.openid=m.openid " . " left join " . tablename('ewei_shop_store') . " store on store.id=s.storeid " . " WHERE 1 {$condition} ORDER BY id asc", $params); include $this->template('query_saler'); exit; } load()->func('tpl');
<?php global $_W, $_GPC; //check_shop_auth('http://120.26.212.219/api.php', $this -> pluginname); ca('sale.enough.view'); $set = $this->getSet(); if (checksubmit('submit')) { ca('sale.enough.save'); $data = is_array($_GPC['data']) ? $_GPC['data'] : array(); $set['enoughfree'] = intval($data['enoughfree']); $set['enoughorder'] = round(floatval($data['enoughorder']), 2); $set['enoughareas'] = $data['enoughareas']; $set['enoughmoney'] = round(floatval($data['enoughmoney']), 2); $set['enoughdeduct'] = round(floatval($data['enoughdeduct']), 2); $this->updateSet($set); plog('sale.enough.save', '修改满额优惠'); message('满额优惠设置成功!', referer(), 'success'); } $areafile = IA_ROOT . "/addons/ewei_shop/data/areas"; $areas = json_decode(@file_get_contents($areafile), true); if (!is_array($areas)) { require_once EWEI_SHOP_INC . 'json/xml2json.php'; $file = IA_ROOT . "/addons/ewei_shop/static/js/dist/area/Area.xml"; $content = file_get_contents($file); $json = xml2json::transformXmlStringToJson($content); $areas = json_decode($json, true); file_put_contents($areafile, $json); } load()->func('tpl'); include $this->template('enough');
message($result['message'], '', 'error'); } foreach ($list as $row) { $update = array(); foreach ($row['goods'] as $g) { $update = array(); if ($row['level'] == 1 && $g['status1'] == 2) { $update = array('paytime1' => $time, 'status1' => 3); } else { if ($row['level'] == 2 && $g['status2'] == 2) { $update = array('paytime2' => $time, 'status2' => 3); } else { if ($row['level'] == 3 && $g['status3'] == 2) { $update = array('paytime3' => $time, 'status3' => 3); } } } if (!empty($update)) { pdo_update('ewei_shop_order_goods', $update, array('id' => $g['id'])); } } } pdo_update('ewei_shop_commission_apply', array('status' => 3, 'paytime' => $time, 'commission_pay' => $totalpay), array('id' => $id, 'uniacid' => $_W['uniacid'])); $log = array('uniacid' => $_W['uniacid'], 'applyid' => $apply['id'], 'mid' => $member['id'], 'commission' => $totalcommission, 'commission_pay' => $totalpay, 'createtime' => $time); pdo_insert('ewei_shop_commission_log', $log); $this->model->sendMessage($member['openid'], array('commission' => $totalpay, 'type' => $apply['type'] == 1 ? '微信' : '余额'), TM_COMMISSION_PAY); plog('commission.apply.pay', "佣金打款 ID: {$id} 申请编号: {$apply['applyno']} 总佣金: {$totalcommission} 审核通过佣金: {$totalpay} "); message('佣金打款处理成功!', $this->createPluginWebUrl('commission/apply', array('status' => $apply['status'])), 'success'); } load()->func('tpl'); include $this->template('apply');
} elseif ($class1 == 4) { $member = pdo_fetchall("SELECT openid FROM " . tablename('ewei_shop_member') . " WHERE uniacid = '{$_W['uniacid']}'" . $where, array(), 'openid'); plog('tmessage.send', "会员群发 模板ID: {$id} 方式: 全部会员 分组:{$groupname} 人数: " . count($member)); die(json_encode(array('result' => 1, 'openids' => array_keys($member)))); } elseif ($class1 == 5) { $where = ''; if ($value1 != '') { $where .= " and agentlevel =" . intval($value1); } $member = pdo_fetchall("SELECT openid FROM " . tablename('ewei_shop_member') . " WHERE uniacid = '{$_W['uniacid']}' and isagent=1 and status=1 " . $where, array(), 'openid'); if (!empty($value1)) { $levelname = pdo_fetchcolumn('select levelname from ' . tablename('ewei_shop_commission_level') . ' where id=:id limit 1', array(':id' => $value1)); } else { $levelname = "全部"; } plog('tmessage.send', "会员群发 模板ID: {$id} 方式: 分销商-{$levelname} 人数: " . count($member)); die(json_encode(array('result' => 1, 'openids' => array_keys($member)))); } } elseif ($operation == 'sendmessage') { $id = intval($_GPC['id']); $template = pdo_fetch('SELECT * FROM ' . tablename('ewei_shop_member_message_template') . ' WHERE id=:id and uniacid=:uniacid ', array(':id' => $id, ':uniacid' => $_W['uniacid'])); if (empty($template)) { die(json_encode(array('result' => 0, 'mesage' => '未指定群发模板!', 'openid' => $openid))); } if (empty($template['template_id'])) { die(json_encode(array('result' => 0, 'mesage' => '未指定群发模板ID!', 'openid' => $openid))); } $openid = $_GPC['openid']; if (empty($openid)) { die(json_encode(array('result' => 0, 'mesage' => '未指定openid!', 'openid' => $openid))); }
if (empty($id)) { ca('creditshop.category.add'); } else { ca('creditshop.category.edit|creditshop.category.view'); } if (checksubmit('submit')) { $data = array('uniacid' => $_W['uniacid'], 'name' => trim($_GPC['catename']), 'enabled' => intval($_GPC['enabled']), 'isrecommand' => intval($_GPC['isrecommand']), 'displayorder' => intval($_GPC['displayorder']), 'thumb' => save_media($_GPC['thumb'])); if (!empty($id)) { pdo_update('ewei_shop_creditshop_category', $data, array('id' => $id)); plog('creditshop.category.edit', "修改积分商城分类 ID: {$id}"); } else { pdo_insert('ewei_shop_creditshop_category', $data); $id = pdo_insertid(); plog('creditshop.category.add', "添加积分商城分类 ID: {$id}"); } message('更新分类成功!', $this->createPluginWebUrl('creditshop/category', array('op' => 'display')), 'success'); } $item = pdo_fetch("select * from " . tablename('ewei_shop_creditshop_category') . " where id=:id and uniacid=:uniacid limit 1", array(":id" => $id, ":uniacid" => $_W['uniacid'])); } elseif ($operation == 'delete') { ca('creditshop.category.delete'); $id = intval($_GPC['id']); $item = pdo_fetch("SELECT id,name FROM " . tablename('ewei_shop_creditshop_category') . " WHERE id = '{$id}' AND uniacid=" . $_W['uniacid'] . ""); if (empty($item)) { message('抱歉,分类不存在或是已经被删除!', $this->createPluginWebUrl('creditshop/category', array('op' => 'display')), 'error'); } pdo_delete('ewei_shop_creditshop_category', array('id' => $id)); plog('creditshop.category.delete', "删除积分商城分类 ID: {$id} 标题: {$item['name']} "); message('分类删除成功!', $this->createPluginWebUrl('creditshop/category', array('op' => 'display')), 'success'); } load()->func('tpl'); include $this->template('category');
if (empty($id)) { ca('creditshop.adv.add'); } else { ca('creditshop.adv.edit|creditshop.adv.view'); } if (checksubmit('submit')) { $data = array('uniacid' => $_W['uniacid'], 'advname' => trim($_GPC['advname']), 'link' => trim($_GPC['link']), 'enabled' => intval($_GPC['enabled']), 'displayorder' => intval($_GPC['displayorder']), 'thumb' => save_media($_GPC['thumb'])); if (!empty($id)) { pdo_update('ewei_shop_creditshop_adv', $data, array('id' => $id)); plog('creditshop.adv.edit', "修改积分商城幻灯片 ID: {$id}"); } else { pdo_insert('ewei_shop_creditshop_adv', $data); $id = pdo_insertid(); plog('creditshop.adv.add', "添加积分商城幻灯片 ID: {$id}"); } message('更新幻灯片成功!', $this->createPluginWebUrl('creditshop/adv', array('op' => 'display')), 'success'); } $item = pdo_fetch("select * from " . tablename('ewei_shop_creditshop_adv') . " where id=:id and uniacid=:uniacid limit 1", array(":id" => $id, ":uniacid" => $_W['uniacid'])); } elseif ($operation == 'delete') { ca('creditshop.adv.delete'); $id = intval($_GPC['id']); $item = pdo_fetch("SELECT id,advname FROM " . tablename('ewei_shop_creditshop_adv') . " WHERE id = '{$id}' AND uniacid=" . $_W['uniacid'] . ""); if (empty($item)) { message('抱歉,幻灯片不存在或是已经被删除!', $this->createPluginWebUrl('creditshop/adv', array('op' => 'display')), 'error'); } pdo_delete('ewei_shop_creditshop_adv', array('id' => $id)); plog('creditshop.adv.delete', "删除积分商城幻灯片 ID: {$id} 标题: {$item['advname']} "); message('幻灯片删除成功!', $this->createPluginWebUrl('creditshop/adv', array('op' => 'display')), 'success'); } load()->func('tpl'); include $this->template('adv');
global $_W, $_GPC; //check_shop_auth('http://120.26.212.219/api.php', $this -> pluginname); ca('commission.cover'); $rule = pdo_fetch("select * from " . tablename('rule') . ' where uniacid=:uniacid and module=:module and name=:name limit 1', array(':uniacid' => $_W['uniacid'], ':module' => 'cover', ':name' => "ewei_shop分销中心入口设置")); if (!empty($rule)) { $keyword = pdo_fetch("select * from " . tablename('rule_keyword') . ' where uniacid=:uniacid and rid=:rid limit 1', array(':uniacid' => $_W['uniacid'], ':rid' => $rule['id'])); $cover = pdo_fetch("select * from " . tablename('cover_reply') . ' where uniacid=:uniacid and rid=:rid limit 1', array(':uniacid' => $_W['uniacid'], ':rid' => $rule['id'])); } if (checksubmit('submit')) { $data = is_array($_GPC['cover']) ? $_GPC['cover'] : array(); if (empty($data['keyword'])) { message('请输入关键词!'); } if (!empty($rule)) { pdo_delete('rule', array('id' => $rule['id'], 'uniacid' => $_W['uniacid'])); pdo_delete('rule_keyword', array('rid' => $rule['id'], 'uniacid' => $_W['uniacid'])); pdo_delete('cover_reply', array('rid' => $rule['id'], 'uniacid' => $_W['uniacid'])); } $rule_data = array('uniacid' => $_W['uniacid'], 'name' => 'ewei_shop分销中心入口设置', 'module' => 'cover', 'displayorder' => 0, 'status' => intval($data['status'])); pdo_insert('rule', $rule_data); $rid = pdo_insertid(); $keyword_data = array('uniacid' => $_W['uniacid'], 'rid' => $rid, 'module' => 'cover', 'content' => trim($data['keyword']), 'type' => 1, 'displayorder' => 0, 'status' => intval($data['status'])); pdo_insert('rule_keyword', $keyword_data); $cover_data = array('uniacid' => $_W['uniacid'], 'rid' => $rid, 'module' => $this->modulename, 'title' => trim($data['title']), 'description' => trim($data['desc']), 'thumb' => $data['thumb'], 'url' => $this->createPluginMobileUrl('commission')); pdo_insert('cover_reply', $cover_data); plog('commission.cover', '修改分销商入口设置'); message('分销中心入口设置成功!', referer(), 'success'); } load()->func('tpl'); include $this->template('cover');
//decode by 012wz.com QQ:800083075 global $_W, $_GPC; ca('creditshop.cover'); $rule = pdo_fetch("select * from " . tablename('rule') . ' where uniacid=:uniacid and module=:module and name=:name limit 1', array(':uniacid' => $_W['uniacid'], ':module' => 'cover', ':name' => "ewei_shop积分商城入口设置")); if (!empty($rule)) { $keyword = pdo_fetch("select * from " . tablename('rule_keyword') . ' where uniacid=:uniacid and rid=:rid limit 1', array(':uniacid' => $_W['uniacid'], ':rid' => $rule['id'])); $cover = pdo_fetch("select * from " . tablename('cover_reply') . ' where uniacid=:uniacid and rid=:rid limit 1', array(':uniacid' => $_W['uniacid'], ':rid' => $rule['id'])); } if (checksubmit('submit')) { $data = is_array($_GPC['cover']) ? $_GPC['cover'] : array(); if (empty($data['keyword'])) { message('请输入关键词!'); } if (!empty($rule)) { pdo_delete('rule', array('id' => $rule['id'], 'uniacid' => $_W['uniacid'])); pdo_delete('rule_keyword', array('rid' => $rule['id'], 'uniacid' => $_W['uniacid'])); pdo_delete('cover_reply', array('rid' => $rule['id'], 'uniacid' => $_W['uniacid'])); } $rule_data = array('uniacid' => $_W['uniacid'], 'name' => 'ewei_shop积分商城入口设置', 'module' => 'cover', 'displayorder' => 0, 'status' => intval($data['status'])); pdo_insert('rule', $rule_data); $rid = pdo_insertid(); $keyword_data = array('uniacid' => $_W['uniacid'], 'rid' => $rid, 'module' => 'cover', 'content' => trim($data['keyword']), 'type' => 1, 'displayorder' => 0, 'status' => intval($data['status'])); pdo_insert('rule_keyword', $keyword_data); $cover_data = array('uniacid' => $_W['uniacid'], 'rid' => $rid, 'module' => $this->modulename, 'title' => trim($data['title']), 'description' => trim($data['desc']), 'thumb' => $data['thumb'], 'url' => $this->createPluginMobileUrl('creditshop')); pdo_insert('cover_reply', $cover_data); plog('creditshop.cover', '修改积分商城入口设置'); message('分销中心入口设置成功!', referer(), 'success'); } load()->func('tpl'); include $this->template('cover');
if ($paytype == 'refund') { ca('finance.recharge.refund'); if (!empty($log['type'])) { message('微信钱包退款失败: 非充值记录!', '', 'error'); } if ($log['rechargetype'] != 'alipay' && $log['rechargetype'] != 'wechat') { message('微信钱包退款失败: 后台充值无法退款!', '', 'error'); } $current_credit = m('member')->getCredit($log['openid'], 'credit2'); if ($log['money'] > $current_credit) { message('微信钱包退款失败: 会员账户余额不足,无法进行退款!', '', 'error'); } $result = m('finance')->pay($log['openid'], 1, $log['money'] * 100, $log['logno'], $set['name'] . '充值退款'); if (is_error($result)) { message('微信钱包退款失败: ' . $result['message'], '', 'error'); } pdo_update('ewei_shop_member_log', array('status' => 3), array('id' => $id, 'uniacid' => $uniacid)); m('member')->setCredit($log['openid'], 'credit2', -$log['money'], array(0, $set['name'] . '充值退款')); m('notice')->sendMemberLogMessage($log['id']); plog('finance.withdraw.withdraw', "充值退款 ID: {$log['id']} 金额: {$log['money']} <br/>会员信息: ID: {$member['id']} / {$member['openid']}/{$member['nickname']}/{$member['realname']}/{$member['mobile']}"); message('充值退款成功!', referer(), 'success'); } else { message('未找到提现方式!', '', 'error'); } } } } } } load()->func('tpl'); include $this->template('web/finance/log');
ca('virtual.category.view'); if (!empty($_GPC['catname'])) { ca('virtual.category.edit|virtual.category.add'); foreach ($_GPC['catname'] as $id => $catname) { if ($id == 'new') { ca('virtual.category.add'); pdo_insert('ewei_shop_virtual_category', array('name' => $catname, 'uniacid' => $_W['uniacid'])); $insert_id = pdo_insertid(); plog('virtual.category.add', "添加分类 ID: {$insert_id}"); } else { pdo_update('ewei_shop_virtual_category', array('name' => $catname), array('id' => $id)); plog('virtual.category.edit', "修改分类 ID: {$id}"); } } plog('virtual.category.edit', '批量修改分类'); message('分类更新成功!', $this->createPluginWebUrl('virtual/category', array('op' => 'display')), 'success'); } $list = pdo_fetchall("SELECT * FROM " . tablename('ewei_shop_virtual_category') . " WHERE uniacid = '{$_W['uniacid']}' ORDER BY id DESC"); } elseif ($operation == 'delete') { ca('virtual.category.delete'); $id = intval($_GPC['id']); $item = pdo_fetch("SELECT id,name FROM " . tablename('ewei_shop_virtual_category') . " WHERE id = '{$id}' AND uniacid=" . $_W['uniacid'] . ""); if (empty($item)) { message('抱歉,分类不存在或是已经被删除!', $this->createPluginWebUrl('virtual/category', array('op' => 'display')), 'error'); } pdo_delete('ewei_shop_virtual_category', array('id' => $id)); plog('virtual.category.delete', "删除分类 ID: {$id} 标题: {$item['name']} "); message('分类删除成功!', $this->createPluginWebUrl('virtual/category', array('op' => 'display')), 'success'); } load()->func('tpl'); include $this->template('category');
global $session; $session = NULL; global $user; $user = NULL; global $domain; $domain = NULL; global $expired; $expired = false; global $pageurl; $pageurl = current_page_url(); global $is_logged_in; $is_logged_in = false; if (!defined('quiet_auth')) { $domain = explode("/", str_replace("http://", "", $pageurl)); $domain = $domain[0]; } if (!defined('suppress_auth')) { $session_model->Active(); plog('$auth: ' . vars($auth)); plog('$session: ' . vars($session)); } global $plog_level; if ($plog_level == 1) { plog('##### $pageurl: ' . vars($pageurl)); if (isset($_SERVER['HTTP_REFERRER'])) { plog('Referred: ' . $_SERVER['HTTP_REFERRER']); } plog('getpost():------' . vars(getpost())); } plog('----Executing: ' . vars($pageurl));
private function Errors($err) { plog('Model::Error ' . $err); $this->errors[] = $err; }
} else { pdo_insert('ewei_shop_perm_role', $data); $id = pdo_insertid(); plog('perm.role.add', "添加角色 ID: {$id} "); } message('更新角色成功!', $this->createPluginWebUrl('perm/role', array('op' => 'display')), 'success'); } } elseif ($operation == 'delete') { ca('perm.role.delete'); $id = intval($_GPC['id']); $item = pdo_fetch("SELECT id,rolename FROM " . tablename('ewei_shop_perm_role') . " WHERE id = '{$id}'"); if (empty($item)) { message('抱歉,角色不存在或是已经被删除!', $this->createPluginWebUrl('perm/role', array('op' => 'display')), 'error'); } pdo_update('ewei_shop_perm_role', array('deleted' => 1), array('id' => $id, 'uniacid' => $_W['uniacid'])); plog('perm.role.delete', "删除角色 ID: {$id} 角色名称: {$item['rolename']} "); message('角色删除成功!', $this->createPluginWebUrl('perm/role', array('op' => 'display')), 'success'); } elseif ($operation == 'query') { $kwd = trim($_GPC['keyword']); $params = array(); $params[':uniacid'] = $_W['uniacid']; $condition = " and uniacid=:uniacid and deleted=0"; if (!empty($kwd)) { $condition .= " AND `rolename` LIKE :keyword"; $params[':keyword'] = "%{$kwd}%"; } $ds = pdo_fetchall('SELECT id,rolename,perms FROM ' . tablename('ewei_shop_perm_role') . " WHERE 1 {$condition} order by id asc", $params); include $this->template('query_role'); exit; } load()->func('tpl');
$endtime = strtotime($_GPC['datetime']['end']); if (!empty($_GPC['searchtime'])) { $condition .= " AND og.createtime >={$starttime} AND og.createtime <= {$endtime} "; } } $condition1 = ' and g.uniacid=:uniacid'; $params1 = array(':uniacid' => $_W['uniacid']); if (!empty($_GPC['title'])) { $condition1 .= " and g.title like :title"; $params1[':title'] = "%{$_GPC['title']}%"; } $orderby = !isset($_GPC['orderby']) ? 'desc' : (empty($_GPC['orderby']) ? 'desc' : 'asc'); $sql = "SELECT g.id,g.title,g.thumb,g.viewcount," . "(select sum(og.total) from " . tablename('ewei_shop_order_goods') . " og left join " . tablename('ewei_shop_order') . " o on og.orderid=o.id where o.status>=1 and og.goodsid=g.id {$condition}) as buycount" . " from " . tablename('ewei_shop_goods') . " g " . "where 1 {$condition1} order by buycount/g.viewcount {$orderby} "; if (empty($_GPC['export'])) { $sql .= "LIMIT " . ($pindex - 1) * $psize . ',' . $psize; } $list = pdo_fetchall($sql, $params1); foreach ($list as &$row) { $row['percent'] = round($row['buycount'] / (empty($row['viewcount']) ? 1 : $row['viewcount']) * 100, 2); } unset($row); $total = pdo_fetchcolumn("select count(*) from " . tablename('ewei_shop_goods') . ' g ' . " where 1 {$condition1} ", $params1); $pager = pagination($total, $pindex, $psize); if ($_GPC['export'] == 1) { ca('statistics.export.goods_trans'); plog('statistics.export.goods_trans', '导出商品转化率报告'); m('excel')->export($list, array("title" => "商品转化率报告-" . date('Y-m-d-H-i', time()), "columns" => array(array('title' => '商品名称', 'field' => 'title', 'width' => 24), array('title' => '浏览量', 'field' => 'viewcount', 'width' => 12), array('title' => '购买数', 'field' => 'buycount', 'width' => 12), array('title' => '转化率(%)', 'field' => 'percent', 'width' => 12)))); } load()->func('tpl'); include $this->template('web/statistics/goods_trans'); exit;
include 'core/Page.php'; if (!Session::logged_in()) { Page::Redirect('login'); } plog("New page!"); $p = new Page(); if (!$p->ajax) { $p->HTML('header.html', array("###MENU###" => Dropdown_menu($p))); } $p->title = "Your Website"; $p->CSS("main.css"); $p->Jquery(); $getpost = getpost(); $p->HTML('<BR>'); global $auth_database; plog("Get mods!"); $m = new Modification($auth_database); $mods = $m->All('ORDER BY Timestamp DESC'); $m_auth = new Auth($auth_database); if (!false_or_null($mods)) { $datatemp = array(); foreach ($mods as $mod) { $user = $m_auth->Get($mod['r_Auth']); if (!isset($datatemp[$user['username']])) { $datatemp[$user['username']] = 1; } else { $datatemp[$user['username']] += 1; } } $datapoints = array(); foreach ($datatemp as $username => $events) {
if ($type == 'sendfree') { $typestr = "包邮"; } else { if ($type == 'nodiscount') { $typestr = "不参与折扣状态"; } } } } } } } plog('shop.goods.edit', "修改商品{$typestr}状态 ID: {$id}"); die(json_encode(array('result' => 1, 'data' => $data))); } if (in_array($type, array('status'))) { $data = $data == 1 ? '0' : '1'; pdo_update('ewei_shop_goods', array($type => $data), array("id" => $id, "uniacid" => $_W['uniacid'])); plog('shop.goods.edit', "修改商品上下架状态 ID: {$id}"); die(json_encode(array('result' => 1, 'data' => $data))); } if (in_array($type, array('type'))) { $data = $data == 1 ? '2' : '1'; pdo_update('ewei_shop_goods', array($type => $data), array("id" => $id, "uniacid" => $_W['uniacid'])); plog('shop.goods.edit', "修改商品类型 ID: {$id}"); die(json_encode(array('result' => 1, 'data' => $data))); } die(json_encode(array('result' => 0))); } load()->func('tpl'); include $this->template('web/shop/goods');
$data['headimgurl'] = pdo_fetchcolumn('select avatar from ' . tablename('mc_members') . " where avatar<>'' order by rand() limit 1"); } if (!empty($id)) { pdo_update('ewei_shop_order_comment', $data, array('id' => $id)); plog('shop.comment.edit', "编辑商品虚拟评价 ID: {$id} 商品ID: {$goods['id']} 商品标题: {$goods['title']}"); } else { pdo_insert('ewei_shop_order_comment', $data); $id = pdo_insertid(); plog('shop.comment.add', "添加虚拟评价 ID: {$id} 商品ID: {$goods['id']} 商品标题: {$goods['title']}"); } message('更新评价成功!', $this->createWebUrl('shop/comment'), 'success'); } if (empty($goodsid)) { $goodsid = intval($item['goodsid']); } $goods = pdo_fetch('select id,thumb,title from ' . tablename('ewei_shop_goods') . ' where id=:id and uniacid=:uniacid limit 1', array(':id' => $goodsid, ':uniacid' => $_W['uniacid'])); } elseif ($operation == 'post') { ca('shop.comment.edit'); $id = intval($_GPC['id']); $item = pdo_fetch("SELECT * FROM " . tablename('ewei_shop_order_comment') . " WHERE id =:id and uniacid=:uniacid limit 1 ", array(':id' => $id, ':uniacid' => $_W['uniacid'])); $goods = pdo_fetch('select id,thumb,title from ' . tablename('ewei_shop_goods') . ' where id=:id and uniacid=:uniacid limit 1', array(':id' => $item['goodsid'], ':uniacid' => $_W['uniacid'])); $order = pdo_fetch('select id,ordersn from ' . tablename('ewei_shop_order') . ' where id=:id and uniacid=:uniacid limit 1', array(':id' => $item['orderid'], ':uniacid' => $_W['uniacid'])); if (checksubmit()) { $data = array('uniacid' => $_W['uniacid'], 'reply_content' => $_GPC['reply_content'], 'reply_images' => is_array($_GPC['reply_images']) ? iserializer($_GPC['reply_images']) : iserializer(array()), 'append_reply_content' => $_GPC['append_reply_content'], 'append_reply_images' => is_array($_GPC['append_reply_images']) ? iserializer($_GPC['append_reply_images']) : iserializer(array())); pdo_update('ewei_shop_order_comment', $data, array('id' => $id)); plog('shop.comment.edit', "回复商品评价 ID: {$id} 商品ID: {$goods['id']} 商品标题: {$goods['title']}"); message('更新评价成功!', $this->createWebUrl('shop/comment'), 'success'); } } load()->func('tpl'); include $this->template('web/shop/comment');
global $_W, $_GPC; $op = $operation = $_GPC['op'] ? $_GPC['op'] : 'display'; $id = intval($_GPC['id']); $profile = m('member')->getInfo($id); if ($op == 'credit1') { ca('finance.recharge.credit1'); if ($_W['ispost']) { m('member')->setCredit($profile['openid'], 'credit1', $_GPC['num'], array()); plog('finance.recharge.credit1', "积分充值 充值积分: {$_GPC['num']} <br/>会员信息: ID: {$profile['id']} / {$profile['openid']}/{$profile['nickname']}/{$profile['realname']}/{$profile['mobile']}"); message('充值成功!', referer(), 'success'); } $profile['credit1'] = m('member')->getCredit($profile['openid'], 'credit1'); } elseif ($op == 'credit2') { ca('finance.recharge.credit2'); if ($_W['ispost']) { m('member')->setCredit($profile['openid'], $credittype = 'credit2', $_GPC['num'], $log = array()); $set = m('common')->getSysset('shop'); $logno = m('common')->createNO('member_log', 'logno', 'RC'); $data = array('openid' => $profile['openid'], 'logno' => $logno, 'uniacid' => $_W['uniacid'], 'type' => '0', 'createtime' => TIMESTAMP, 'status' => '1', 'title' => $set['name'] . "会员充值", 'money' => $_GPC['num'], 'rechargetype' => 'system'); pdo_insert('ewei_shop_member_log', $data); $logid = pdo_insertid(); m('member')->setRechargeCredit($openid, $log['money']); m('notice')->sendMemberLogMessage($logid); plog('finance.recharge.credit2', "余额充值 充值金额: {$_GPC['num']} <br/>会员信息: ID: {$profile['id']} / {$profile['openid']}/{$profile['nickname']}/{$profile['realname']}/{$profile['mobile']}"); message('充值成功!', referer(), 'success'); } $set = m('common')->getSysset(); $profile['credit2'] = m('member')->getCredit($profile['openid'], 'credit2'); } load()->func('tpl'); include $this->template('web/finance/recharge');
ca('member.level.edit|member.level.view'); } $level = pdo_fetch("SELECT * FROM " . tablename('ewei_shop_member_level') . " WHERE id = '{$id}'"); if (checksubmit('submit')) { if (empty($_GPC['levelname'])) { message('抱歉,请输入分类名称!'); } $data = array('uniacid' => $_W['uniacid'], 'level' => intval($_GPC['level']), 'levelname' => trim($_GPC['levelname']), 'ordercount' => intval($_GPC['ordercount']), 'ordermoney' => $_GPC['ordermoney'], 'discount' => $_GPC['discount']); if (!empty($id)) { pdo_update('ewei_shop_member_level', $data, array('id' => $id, 'uniacid' => $_W['uniacid'])); plog('member.level.edit', "修改会员等级 ID: {$id}"); } else { pdo_insert('ewei_shop_member_level', $data); $id = pdo_insertid(); plog('member.level.add', "添加会员等级 ID: {$id}"); } message('更新等级成功!', $this->createWebUrl('member/level', array('op' => 'display')), 'success'); } } elseif ($operation == 'delete') { ca('member.level.delete'); $id = intval($_GPC['id']); $level = pdo_fetch("SELECT id,levelname FROM " . tablename('ewei_shop_member_level') . " WHERE id = '{$id}'"); if (empty($level)) { message('抱歉,等级不存在或是已经被删除!', $this->createWebUrl('member/level', array('op' => 'display')), 'error'); } pdo_delete('ewei_shop_member_level', array('id' => $id, 'uniacid' => $_W['uniacid'])); plog('member.level.delete', "删除会员等级 ID: {$id} 等级名称: {$level['levelname']}"); message('等级删除成功!', $this->createWebUrl('member/level', array('op' => 'display')), 'success'); } load()->func('tpl'); include $this->template('web/member/level');
if (!empty($id)) { user_update(array('uid' => $data['uid'], 'password' => $_GPC['password'])); pdo_update('ewei_shop_perm_user', $data, array('id' => $id, 'uniacid' => $_W['uniacid'])); plog('perm.user.edit', "编辑操作员 ID: {$id} 用户名: {$data['username']} "); } else { if (user_check(array('username' => $data['username']))) { die(json_encode(array('result' => 0, 'message' => '非常抱歉,此用户名已经被注册,你需要更换注册名称!'))); } $data['uid'] = user_register(array('username' => $data['username'], 'password' => $_GPC['password'])); pdo_insert('ewei_shop_perm_user', $data); pdo_insert('uni_account_users', array('uid' => $data['uid'], 'uniacid' => $data['uniacid'], 'role' => 'operator')); $id = pdo_insertid(); plog('perm.user.add', "添加操作员 ID: {$id} 用户名: {$data['username']} "); } die(json_encode(array('result' => 1))); } } elseif ($operation == 'delete') { ca('perm.user.delete'); $id = intval($_GPC['id']); $item = pdo_fetch("SELECT id,uid,username FROM " . tablename('ewei_shop_perm_user') . " WHERE id = '{$id}'"); if (empty($item)) { message('抱歉,操作员不存在或是已经被删除!', $this->createPluginWebUrl('perm/user', array('op' => 'display')), 'error'); } pdo_delete('users', array('uid' => $item['uid'])); pdo_delete('uni_account_users', array('uid' => $item['uid'], 'uniacid' => $_W['uniacid'])); pdo_delete('ewei_shop_perm_user', array('id' => $id, 'uniacid' => $_W['uniacid'])); plog('perm.user.delete', "删除操作员 ID: {$id} 用户名: {$item['username']} "); message('操作员删除成功!', $this->createPluginWebUrl('perm/user', array('op' => 'display')), 'success'); } load()->func('tpl'); include $this->template('user');
include_once SITE_ROOT . '/settings/config.enums.php'; include_once SITE_ROOT . '/settings/config.global.php'; include_once SITE_ROOT . '/settings/config.databases.php'; include_all(SITE_ROOT . '/model/'); global $auth_database; try { $auth_database = new Database(AUTH_DB_DSN, AUTH_DB_USER, AUTH_DB_PASS); } catch (Exception $e) { plog($e); } plog('$auth_database: ' . vars($auth_database)); global $auth_model; $auth_model = new Auth($auth_database); global $session_model; $session_model = new Session($auth_database); global $profile_model; $profile_model = new Profile($auth_database); global $auth; $auth = NULL; global $session; $session = NULL; global $user; $user = NULL; global $database; // change to something else if you want a common auth $database = $auth_database; global $db; $db = $database; plog('----Executing.'); // We're done! }
<?php //微赞科技 by QQ:800083075 http://www.012wz.com/ global $_W, $_GPC; ca('sale.deduct.view'); $set = $this->getSet(); if (checksubmit('submit')) { ca('sale.deduct.save'); $data = is_array($_GPC['data']) ? $_GPC['data'] : array(); $set['creditdeduct'] = intval($data['creditdeduct']); $set['credit'] = 1; $set['money'] = round(floatval($data['money']), 2); $set['moneydeduct'] = intval($data['moneydeduct']); $this->updateSet($set); plog('sale.deduct.save', '修改抵扣设置'); message('抵扣设置成功!', referer(), 'success'); } load()->func('tpl'); include $this->template('deduct');
$list[] = $dr; } } else { if (!empty($year)) { foreach ($months as $m) { $lastday = get_last_day($year, $m); $dr = array('data' => $m['data'], 'count' => pdo_fetchcolumn("SELECT ifnull({$countfield},0) as cnt FROM " . tablename('ewei_shop_order') . " WHERE uniacid=:uniacid and status>=1 and createtime >=:starttime and createtime <=:endtime", array(':uniacid' => $_W['uniacid'], ':starttime' => strtotime("{$year}-{$m['data']}-01 00:00:00"), ':endtime' => strtotime("{$year}-{$m['data']}-{$lastday} 23:59:59")))); $totalcount += $dr['count']; if ($dr['count'] > $maxcount) { $maxcount = $dr['count']; $maxcount_date = "{$year}年{$m['data']}月"; } $list[] = $dr; } } } } foreach ($list as $key => &$row) { $list[$key]['percent'] = number_format($row['count'] / (empty($totalcount) ? 1 : $totalcount) * 100, 2); } unset($row); if ($_GPC['export'] == 1) { ca('statistics.export.sale'); plog('statistics.export.sale', '导出销售统计'); $list[] = array('data' => $typename . '总数', 'count' => $totalcount); $list[] = array('data' => '最高' . $typename, 'count' => $maxcount); $list[] = array('data' => '发生在', 'count' => $maxcount_date); m('excel')->export($list, array("title" => "交易报告-" . (!empty($year) && !empty($month) ? "{$year}年{$month}月" : "{$year}年"), "columns" => array(array('title' => $dataname, 'field' => 'data', 'width' => 12), array('title' => $typename, 'field' => 'count', 'width' => 12), array('title' => '所占比例(%)', 'field' => 'percent', 'width' => 24)))); } include $this->template('web/statistics/sale'); exit;
if (empty($id)) { ca('shop.adv.add'); } else { ca('shop.adv.edit|shop.adv.view'); } if (checksubmit('submit')) { $data = array('uniacid' => $_W['uniacid'], 'advname' => trim($_GPC['advname']), 'link' => trim($_GPC['link']), 'enabled' => intval($_GPC['enabled']), 'displayorder' => intval($_GPC['displayorder']), 'thumb' => save_media($_GPC['thumb'])); if (!empty($id)) { pdo_update('ewei_shop_adv', $data, array('id' => $id)); plog('shop.adv.edit', "修改幻灯片 ID: {$id}"); } else { pdo_insert('ewei_shop_adv', $data); $id = pdo_insertid(); plog('shop.adv.add', "添加幻灯片 ID: {$id}"); } message('更新幻灯片成功!', $this->createWebUrl('shop/adv', array('op' => 'display')), 'success'); } $item = pdo_fetch("select * from " . tablename('ewei_shop_adv') . " where id=:id and uniacid=:uniacid limit 1", array(":id" => $id, ":uniacid" => $_W['uniacid'])); } elseif ($operation == 'delete') { ca('shop.adv.delete'); $id = intval($_GPC['id']); $item = pdo_fetch("SELECT id,advname FROM " . tablename('ewei_shop_adv') . " WHERE id = '{$id}' AND uniacid=" . $_W['uniacid'] . ""); if (empty($item)) { message('抱歉,幻灯片不存在或是已经被删除!', $this->createWebUrl('shop/adv', array('op' => 'display')), 'error'); } pdo_delete('ewei_shop_adv', array('id' => $id)); plog('shop.adv.delete', "删除幻灯片 ID: {$id} 标题: {$item['advname']} "); message('幻灯片删除成功!', $this->createWebUrl('shop/adv', array('op' => 'display')), 'success'); } load()->func('tpl'); include $this->template('web/shop/adv');
pdo_insert('rule_keyword', $keyword_data); } message('更新海报成功!', $this->createPluginWebUrl('poster', array('op' => 'display')), 'success'); } } elseif ($operation == 'delete') { ca('poster.delete'); $id = intval($_GPC['id']); $poster = pdo_fetch("SELECT id,title FROM " . tablename('ewei_shop_poster') . " WHERE id = '{$id}'"); if (empty($poster)) { message('抱歉,海报不存在或是已经被删除!', $this->createPluginWebUrl('poster', array('op' => 'display')), 'error'); } pdo_delete('ewei_shop_poster', array('id' => $id, 'uniacid' => $_W['uniacid'])); pdo_delete('ewei_shop_poster_log', array('posterid' => $id, 'uniacid' => $_W['uniacid'])); plog('poster.add', "删除超级海报 ID: {$id} 海报名称: {$poster['title']}"); message('海报删除成功!', $this->createPluginWebUrl('poster', array('op' => 'display')), 'success'); } else { if ($operation == 'setdefault') { ca('poster.setdefault'); $id = intval($_GPC['id']); $poster = pdo_fetch("SELECT * FROM " . tablename('ewei_shop_poster') . " WHERE id = '{$id}'"); if (empty($poster)) { message('抱歉,海报不存在或是已经被删除!', $this->createPluginWebUrl('poster', array('op' => 'display')), 'error'); } pdo_update('ewei_shop_poster', array('isdefault' => 0), array('uniacid' => $_W['uniacid'], 'isdefault' => 1, 'type' => $poster['type'])); pdo_update('ewei_shop_poster', array('isdefault' => 1), array('uniacid' => $_W['uniacid'], 'id' => $poster['id'])); plog('poster.setdefault', "设置默认超级海报 ID: {$id} 海报名称: {$poster['title']}"); message('海报设置成功!', $this->createPluginWebUrl('poster', array('op' => 'display')), 'success'); } } load()->func('tpl'); include $this->template('index');
<?php global $_W, $_GPC; ca('virtual.set.view'); $set = $this->getSet(); if (checksubmit('submit')) { ca('virtual.set.save'); $data = is_array($_GPC['setdata']) ? array_merge($set, $_GPC['setdata']) : array(); $data['tm'] = is_array($_GPC['tm']) ? $_GPC['tm'] : array(); $this->updateSet($data); plog('virtual.set.save', '修改基本设置'); message('设置保存成功!', referer(), 'success'); } load()->func('tpl'); include $this->template('set');