Nopcommerce 设置必须登陆

如需将搭建好的商城设置为必须登陆才能访问商品信息,可以按照如下设置:
登陆“后台管理”,选择“商城配置”,“访问控制”菜单。按照如下图将Guest权限勾选去除即可。
保存后效果就是访问前台默认跳转到登陆页面。
20161206140459

Oracle SQL语句去重查询、整理数据

Oracle等数据库在查询时去除重复结果的关键字是distinct,使用例子:select distinct * from tb_table where 1=1,这样执行的查询结果会将完全单行完全重复的数据排除出去。

但这里主要记录的是,将表中的重复数据排除出来的语句,一般来讲当我们想要把重复的冗余数据删除掉时,下面的语句给予我们帮助。

1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断

select * from people
where peopleId in (select peopleId from people group by peopleId having count
(peopleId) > 1)

2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录

delete from people
where peopleId in (select peopleId from people group by peopleId having count
(peopleId) > 1)
and rowid not in (select min(rowid) from people group by peopleId having count(peopleId
)>1)

3、查找表中多余的重复记录(多个字段)

select * from vitae a
where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having
count(*) > 1)

4、删除表中多余的重复记录(多个字段),只留有rowid最小的记录

delete from vitae a
where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having
count(*) > 1)
and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)

5、查找表中多余的重复记录(多个字段),不包含rowid最小的记录

select * from vitae a
where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having
count(*) > 1)
and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)

source:http://www.jb51.net/article/34820.htm

IE 兼容性 HTTP 标头

默认使用如下即可:
< meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

无论页面是否包含 指令,均使用 Windows Internet Explorer 7 的标准渲染模式。
< meta http-equiv="X-UA-Compatible" content="IE=7" />

Edge 模式通知 Windows Internet Explorer 以最高级别的可用模式显示内容,这实际上破坏了“锁定”模式
< meta http-equiv="X-UA-Compatible" content="edge" />

XP 远程连接 Windows 2008 以上版本改注册表方法

修改XP注册表以支持使用NLA验证方式进行远程桌面连接。
开始-运行-regedit打开注册表编辑器。
定位到以下注册表键值:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa,双击右侧Security Packages,打开编辑多字符串对话框,在列表中添加 tspkg 。
定位到以下注册表键值:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders,双击右侧的SecurityProviders,打开编辑字符串对话框,在数值数据框中添加 , credssp.dll ,注意逗号后有一个英文的空格。
修改完成重启即可。

easyui tree 使用 expand 实现仅展开一层效果

对于easyui的tree控件,一般都使用expandAll来实现树形菜单所有层级的展开,但如果需要指定展开某层级则需要先获取对应层级节点,然后使用expand展开单一节点。

有一个类别的树形菜单分为了3层,首先先设置tree仅显示第一层,然后直接使用getChildren方法获取第一层的节点集合,再循环让其节点expend即可展开第二层,但为了第三层不被展开,所以在给tree传json数据时,传递一个level进行判断。

实例代码如下:

$(‘#’ + treeId).tree({
    checkbox: false,
    url: “/Material/MaterialClass/GetTreeDataJson?parent=0&ismarket=1”,
    animate: true,
    lines: true,
    onClick: function (node) {
      CheckTreeNode(node);
    },
    onBeforeExpand: function (node, param) {
    },
    onLoadSuccess: function (node, data) {
      if (data) {
        $(data).each(function (index, d) {
        //只展开2级
          if (this.state == ‘closed’ && this.level < 2) {
            var children = $(‘#’ + treeId).tree(‘getChildren’);
            for (var i = 0; i < children.length; i++) {
              $(‘#’ + treeId).tree(‘expand’, children[i].target);
            }
            //全部打开 、合并操作
            //$(‘#’ + treeId).tree(‘expandAll’);
            //$(‘#’ + treeId).tree(“collapseAll”);
          }
         });
      }
    }
});