当前位置: 首页>>代码示例>>PHP>>正文


PHP ca函数代码示例

本文整理汇总了PHP中ca函数的典型用法代码示例。如果您正苦于以下问题:PHP ca函数的具体用法?PHP ca怎么用?PHP ca使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ca函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: asChainable

 private static function asChainable($p)
 {
     switch (gettype($p)) {
         case "string":
             return cs($p);
         case "array":
             return ca($p);
         case "object":
             return co($p);
         default:
             if (is_object($p)) {
                 return c($p);
             } else {
                 return $p;
             }
     }
 }
开发者ID:naozone,项目名称:phx,代码行数:17,代码来源:ChainableClass.php

示例2: pdo_fetch

         }
         if (empty($log['dispatchstatus'])) {
             $canexchange = false;
         }
     } else {
         $canexchange = false;
     }
     $log['canexchange'] = $canexchange;
     $address = false;
     if (!empty($log['addressid'])) {
         $address = pdo_fetch('select id,realname,mobile,address,province,city,area from ' . tablename('ewei_shop_member_address') . ' where id=:id and uniacid=:uniacid limit 1', array(':id' => $log['addressid'], ':uniacid' => $_W['uniacid']));
     }
     $address['logid'] = $id;
 } else {
     if ($operation == 'exchange') {
         ca('creditshop.log.exchange');
         $id = intval($_GPC['id']);
         $log = pdo_fetch('select * from ' . tablename('ewei_shop_creditshop_log') . ' where id=:id and uniacid=:uniacid limit 1', array(':id' => $id, ':uniacid' => $_W['uniacid']));
         if (empty($log)) {
             message('兑换记录不存在!', referer(), 'error');
         }
         if (empty($log['status'])) {
             message('无效兑换记录!', referer(), 'error');
         }
         if ($log['status'] >= 3) {
             message('此记录已兑换过了!', referer(), 'error');
         }
         $member = m('member')->getMember($log['openid'], true);
         $goods = $this->model->getGoods($log['goodsid'], $member);
         if (empty($goods['id'])) {
             message('商品记录不存在!', referer(), 'error');
开发者ID:ChainBoy,项目名称:wxfx,代码行数:31,代码来源:log.php

示例3: array

    }
    if (checksubmit('submit')) {
        $data = array('uniacid' => $_W['uniacid'], 'storeid' => intval($_GPC['storeid']), 'openid' => trim($_GPC['openid']), 'status' => intval($_GPC['status']));
        $m = m('member')->getMember($data['openid']);
        if (!empty($id)) {
            pdo_update('ewei_shop_saler', $data, array('id' => $id, 'uniacid' => $_W['uniacid']));
            plog('verify.saler.edit', "编辑核销员 ID: {$id} <br/>核销员信息: ID: {$m['id']} / {$m['openid']}/{$m['nickname']}/{$m['realname']}/{$m['mobile']} ");
        } else {
            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)) {
开发者ID:noikiy,项目名称:mygit,代码行数:31,代码来源:saler.php

示例4: ca

<?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');
开发者ID:noikiy,项目名称:mygit,代码行数:30,代码来源:enough.php

示例5: exit

<?php

if (!defined('IN_IA')) {
    exit('Access Denied');
}
global $_W, $_GPC;
ca('statistics.view.member_increase');
$days = intval($_GPC['days']);
if (empty($_GPC['search'])) {
    $days = 7;
}
$years = array();
$current_year = date('Y');
$year = $_GPC['year'];
for ($i = $current_year - 10; $i <= $current_year; $i++) {
    $years[] = array('data' => $i, 'selected' => $i == $year);
}
$months = array();
$current_month = date('m');
$month = $_GPC['month'];
for ($i = 1; $i <= 12; $i++) {
    $months[] = array('data' => $i, 'selected' => $i == $month);
}
$timefield = empty($isagent) ? 'createtime' : 'agenttime';
$datas = array();
$title = '';
if (!empty($days)) {
    $charttitle = "最近{$days}天增长趋势图";
    for ($i = $days; $i >= 0; $i--) {
        $time = date("Y-m-d", strtotime("-" . $i . " day"));
        $condition = " and uniacid=:uniacid and {$timefield}>=:starttime and {$timefield}<=:endtime";
开发者ID:ChainBoy,项目名称:wxfx,代码行数:31,代码来源:member_increase.php

示例6: ca

        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');
开发者ID:noikiy,项目名称:mygit,代码行数:31,代码来源:level.php

示例7: exit

<?php

if (!defined('IN_IA')) {
    exit('Access Denied');
}
global $_W, $_GPC;
ca('statistics.view.sale_analysis');
function sale_analysis_count($sql)
{
    $c = pdo_fetchcolumn($sql);
    return intval($c);
}
$member_count = sale_analysis_count("SELECT count(*) FROM " . tablename('ewei_shop_member') . "   WHERE uniacid = '{$_W['uniacid']}' ");
$orderprice = sale_analysis_count("SELECT sum(price) FROM " . tablename('ewei_shop_order') . " WHERE status>=1 and uniacid = '{$_W['uniacid']}' ");
$ordercount = sale_analysis_count("SELECT count(*) FROM " . tablename('ewei_shop_order') . " WHERE status>=1 and uniacid = '{$_W['uniacid']}' ");
$viewcount = sale_analysis_count("SELECT sum(viewcount) FROM " . tablename('ewei_shop_goods') . " WHERE uniacid = '{$_W['uniacid']}' ");
$member_buycount = sale_analysis_count("SELECT count(*) from " . tablename('ewei_shop_order') . " o " . " left join " . tablename('ewei_shop_member') . " m on o.openid = m.openid " . "  WHERE o.uniacid = '{$_W['uniacid']}' and o.status>=1 " . " group by m.openid ");
include $this->template('web/statistics/sale_analysis');
开发者ID:ChainBoy,项目名称:wxfx,代码行数:18,代码来源:sale_analysis.php

示例8: ca

    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');
开发者ID:ChainBoy,项目名称:wxfx,代码行数:31,代码来源:category.php

示例9: ca

<?php

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');
开发者ID:noikiy,项目名称:mygit,代码行数:31,代码来源:cover.php

示例10: ca

<?php

//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');
开发者ID:ChainBoy,项目名称:wxfx,代码行数:31,代码来源:cover.php

示例11: pdo_update

     }
     pdo_update('ewei_shop_member_log', array('status' => 1), array('id' => $id, 'uniacid' => $uniacid));
     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 {
     if ($paytype == 'refuse') {
         ca('finance.withdraw.withdraw');
         pdo_update('ewei_shop_member_log', array('status' => -1), 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 {
         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));
开发者ID:noikiy,项目名称:mygit,代码行数:31,代码来源:log.php

示例12: ca

    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');
开发者ID:ChainBoy,项目名称:wxfx,代码行数:31,代码来源:category.php

示例13: pdo_fetch

    }
    $item = pdo_fetch("SELECT * FROM " . tablename('ewei_shop_store') . " WHERE id =:id and uniacid=:uniacid limit 1", array(':uniacid' => $_W['uniacid'], ':id' => $id));
    if (checksubmit('submit')) {
        $data = array('uniacid' => $_W['uniacid'], 'storename' => trim($_GPC['storename']), 'address' => trim($_GPC['address']), 'tel' => trim($_GPC['tel']), 'lng' => $_GPC['map']['lng'], 'lat' => $_GPC['map']['lat'], 'status' => intval($_GPC['status']));
        if (!empty($id)) {
            pdo_update('ewei_shop_store', $data, array('id' => $id, 'uniacid' => $_W['uniacid']));
            plog('verify.store.edit', "编辑核销门店 ID: {$id}");
        } else {
            pdo_insert('ewei_shop_store', $data);
            $id = pdo_insertid();
            plog('verify.store.add', "添加核销门店 ID: {$id}");
        }
        message('更新门店成功!', $this->createPluginWebUrl('verify/store', array('op' => 'display')), 'success');
    }
} elseif ($operation == 'delete') {
    ca('verify.store.delete');
    $id = intval($_GPC['id']);
    $item = pdo_fetch("SELECT id,storename FROM " . tablename('ewei_shop_store') . " WHERE id = '{$id}'");
    if (empty($item)) {
        message('抱歉,门店不存在或是已经被删除!', $this->createPluginWebUrl('verify/store', array('op' => 'display')), 'error');
    }
    pdo_delete('ewei_shop_store', array('id' => $id, 'uniacid' => $_W['uniacid']));
    plog('verify.store.delete', "删除核销门店 ID: {$id} 门店名称: {$item['storename']}");
    message('门店删除成功!', $this->createPluginWebUrl('verify/store', array('op' => 'display')), 'success');
} elseif ($operation == 'query') {
    $kwd = trim($_GPC['keyword']);
    $params = array();
    $params[':uniacid'] = $_W['uniacid'];
    $condition = " and uniacid=:uniacid";
    if (!empty($kwd)) {
        $condition .= " AND `storename` LIKE :keyword";
开发者ID:noikiy,项目名称:mygit,代码行数:31,代码来源:store.php

示例14: message

    if (checksubmit('submit')) {
        if (empty($_GPC['catename'])) {
            message('抱歉,请输入分类名称!');
        }
        $data = array('uniacid' => $_W['uniacid'], 'name' => trim($_GPC['catename']), 'enabled' => intval($_GPC['enabled']), 'displayorder' => intval($_GPC['displayorder']), 'isrecommand' => intval($_GPC['isrecommand']), 'ishome' => intval($_GPC['ishome']), 'description' => $_GPC['description'], 'parentid' => intval($parentid), 'thumb' => save_media($_GPC['thumb']), 'advimg' => save_media($_GPC['advimg']), 'advurl' => trim($_GPC['advurl']));
        if (!empty($id)) {
            unset($data['parentid']);
            pdo_update('ewei_shop_category', $data, array('id' => $id));
            load()->func('file');
            file_delete($_GPC['thumb_old']);
            plog('shop.category.edit', "修改分类 ID: {$id}");
        } else {
            pdo_insert('ewei_shop_category', $data);
            $id = pdo_insertid();
            plog('shop.category.add', "添加分类 ID: {$id}");
        }
        message('更新分类成功!', $this->createWebUrl('shop/category', array('op' => 'display')), 'success');
    }
} elseif ($operation == 'delete') {
    ca('shop.category.delete');
    $id = intval($_GPC['id']);
    $item = pdo_fetch("SELECT id, name, parentid FROM " . tablename('ewei_shop_category') . " WHERE id = '{$id}'");
    if (empty($item)) {
        message('抱歉,分类不存在或是已经被删除!', $this->createWebUrl('shop/category', array('op' => 'display')), 'error');
    }
    pdo_delete('ewei_shop_category', array('id' => $id, 'parentid' => $id), 'OR');
    plog('shop.category.delete', "删除分类 ID: {$id} 分类名称: {$item['name']}");
    message('分类删除成功!', $this->createWebUrl('shop/category', array('op' => 'display')), 'success');
}
load()->func('tpl');
include $this->template('web/shop/category');
开发者ID:noikiy,项目名称:mygit,代码行数:31,代码来源:category.php

示例15: ca

        ca('commission.level.view|commission.level.edit');
    }
    $level = pdo_fetch("SELECT * FROM " . tablename('ewei_shop_commission_level') . " WHERE id = '{$id}'");
    if (checksubmit('submit')) {
        if (empty($_GPC['levelname'])) {
            message('抱歉,请输入分类名称!');
        }
        $data = array('uniacid' => $_W['uniacid'], 'levelname' => $_GPC['levelname'], 'commission1' => $_GPC['commission1'], 'commission2' => $_GPC['commission2'], 'commission3' => $_GPC['commission3'], 'commissionmoney' => $_GPC['commissionmoney'], 'ordermoney' => $_GPC['ordermoney']);
        if (!empty($id)) {
            pdo_update('ewei_shop_commission_level', $data, array('id' => $id, 'uniacid' => $_W['uniacid']));
            plog('commission.level.edit', "修改分销商等级 ID: {$id}");
        } else {
            pdo_insert('ewei_shop_commission_level', $data);
            $id = pdo_insertid();
            plog('commission.level.add', "添加分销商等级 ID: {$id}");
        }
        message('更新等级成功!', $this->createPluginWebUrl('commission/level', array('op' => 'display')), 'success');
    }
} elseif ($operation == 'delete') {
    ca('commission.level.delete');
    $id = intval($_GPC['id']);
    $level = pdo_fetch("SELECT id,levelname FROM " . tablename('ewei_shop_commission_level') . " WHERE id = '{$id}'");
    if (empty($level)) {
        message('抱歉,等级不存在或是已经被删除!', $this->createPluginWebUrl('commission/level', array('op' => 'display')), 'error');
    }
    pdo_delete('ewei_shop_commission_level', array('id' => $id, 'uniacid' => $_W['uniacid']));
    plog('commission.level.delete', "删除分销商等级 ID: {$id} 等级名称: {$level['levelname']}");
    message('等级删除成功!', $this->createPluginWebUrl('commission/level', array('op' => 'display')), 'success');
}
load()->func('tpl');
include $this->template('level');
开发者ID:ChainBoy,项目名称:wxfx,代码行数:31,代码来源:level.php


注:本文中的ca函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。