CREATE TABLE `lc_c_user_path` (
`id` INT ( ) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` VARCHAR ( ) NOT NULL COMMENT '用户标识',
`username` VARCHAR ( ) DEFAULT NULL COMMENT '用户名',
`store_id` VARCHAR ( ) DEFAULT NULL COMMENT '店铺id',
`user_id_path` text COMMENT '当前用户上级用户标识',
`username_path` text COMMENT '当前用户上级用户账号',
`store_id_path` text COMMENT '当前用户上级用户店铺',
`complete_path` text COMMENT '绑定邀请码的用户path',
PRIMARY KEY ( `id` ),
UNIQUE KEY `IDX_U_I` ( `user_id` ) USING BTREE
) ENGINE = INNODB AUTO_INCREMENT = DEFAULT CHARSET = utf8 COMMENT = '用户user_id,username,store之间转化';
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us1', 'un1', 's1', 'us0', 'un0', 's0', 'us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us2', 'un2', 's2', 'us1/us0', 'un1/un0', 's1/s0', 'us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us3', 'un3', 's3', 'us2/us1/us0', 'un2/un1/un0', 's2/s1/s0', 'us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us4', 'un4', NULL, 'us3/us2/us1/us0', 'un3/un2/un1/un0', 's3/s2/s1/s0', 'us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us5', 'un5', 's5', 'us3/us2/us1/us0', 'un3/un2/un1/un0', 's3/s2/s1/s0', 'us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us6', 'un6', 's6', 'us5/us3/us2/us1/us0', 'un5/un3/un2/un1/un0', 's5/s3/s2/s1/s0', 'us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us7', 'un7', 's7', 'us6/us5/us3/us2/us1/us0', 'un6/un5/un3/un2/un1/un0', 's6/s5/s3/s2/s1/s0', 'us6/us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us8', 'un8', 's8', 'us7/us6/us5/us3/us2/us1/us0', 'un7/un6/un5/un3/un2/un1/un0', 's7/s6/s5/s3/s2/s1/s0', 'us7/us6/us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us9', 'un9', '', 'us8/us7/us6/us5/us3/us2/us1/us0', 'un8/un7/un6/un5/un3/un2/un1/un0', 's8/s7/s6/s5/s3/s2/s1/s0', 'us8/us7/us6/us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us10', 'un10', 's10', 'us8/us7/us6/us5/us3/us2/us1/us0', 'un8/un7/un6/un5/un3/un2/un1/un0', 's8/s7/s6/s5/s3/s2/s1/s0', 'us9/us8/us7/us6/us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us11', 'un11', 's11', 'us10/us8/us7/us6/us5/us3/us2/us1/us0', 'un10/un8/un7/un6/un5/un3/un2/un1/un0', 's10/s8/s7/s6/s5/s3/s2/s1/s0', 'us10/us9/us8/us7/us6/us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us12', 'un12', '', 'us11/us10/us8/us7/us6/us5/us3/us2/us1/us0', 'un11/un10/un8/un7/un6/un5/un3/un2/un1/un0', 's11/s10/s8/s7/s6/s5/s3/s2/s1/s0', 'us11/us10/us9/us8/us7/us6/us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us13', 'un13', 's13', 'us11/us10/us8/us7/us6/us5/us3/us2/us1/us0', 'un11/un10/un8/un7/un6/un5/un3/un2/un1/un0', 's11/s10/s8/s7/s6/s5/s3/s2/s1/s0', 'us12/us11/us10/us9/us8/us7/us6/us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us14', 'un14', 's14', 'us13/us11/us10/us8/us7/us6/us5/us3/us2/us1/us0', 'un13/un11/un10/un8/un7/un6/un5/un3/un2/un1/un0', 's13/s11/s10/s8/s7/s6/s5/s3/s2/s1/s0', 'us13/us12/us11/us10/us9/us8/us7/us6/us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us15', 'un15', 's15', 'us14/us13/us11/us10/us8/us7/us6/us5/us3/us2/us1/us0', 'un14/un13/un11/un10/un8/un7/un6/un5/un3/un2/un1/un0', 's14/s13/s11/s10/s8/s7/s6/s5/s3/s2/s1/s0', 'us14/us13/us12/us11/us10/us9/us8/us7/us6/us5/us4/us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us16', 'un16', 's16', 'us1/us0', 'un1/un0', 's1/s0', 'us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us17', 'un17', 's17', 'us16/us1/us0', 'un16/un1/un0', 's16/s1/s0', 'us16/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us18', 'un18', 's18', 'us3/us2/us1/us0', 'un3/un2/un1/un0', 's3/s2/s1/s0', 'us3/us2/us1/us0');
INSERT INTO `lc_c_user_path`(`id`, `user_id`, `username`, `store_id`, `user_id_path`, `username_path`, `store_id_path`, `complete_path`) VALUES (, 'us19', 'un19', 's19', 'us18/us3/us2/us1/us0', 'un18/un3/un2/un1/un0', 's18/s3/s2/s1/s0', 'us18/us3/us2/us1/us0');

CREATE TABLE `lc_c_customer` (
`id` int() unsigned NOT NULL AUTO_INCREMENT,
`user_id` varchar() NOT NULL COMMENT '用户标识',
`partent_user_id` varchar() DEFAULT NULL COMMENT '上级店铺id',
`pid` varchar() DEFAULT NULL COMMENT '当前用户上级用户标识',
PRIMARY KEY (`id`),
UNIQUE KEY `IDX_U_I` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT= DEFAULT CHARSET=utf8 COMMENT='用户表';
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us1', NULL, 'us0');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us2', 'us1', 'us1');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us3', 'us2', 'us2');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us4', 'us3', 'us3');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us5', 'us3', 'us4');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us6', 'us5', 'us5');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us7', 'us6', 'us6');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us8', 'us7', 'us7');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us9', 'us8', 'us8');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us10', 'us8', 'us9');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us11', 'us10', 'us10');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us12', 'us11', 'us11');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us13', 'us11', 'us12');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us14', 'us13', 'us13');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us15', 'us14', 'us14');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us16', 'us1', 'us15');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us17', 'us16', 'us16');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us18', 'us3', 'us17');
INSERT INTO `lc_c_customer`(`id`, `user_id`, `partent_user_id`, `pid`) VALUES (, 'us19', 'us18', 'us18');

CREATE TABLE `lc_c_store` (
`id` varchar() NOT NULL,
`user_id` varchar() NOT NULL DEFAULT '' COMMENT '客户id',
`name` varchar() DEFAULT '' COMMENT '店铺名字',
PRIMARY KEY (`id`),
UNIQUE KEY `IDX_U` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='店铺表';
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s1', 'us1', 'us1的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s10', 'us10', 'us10的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s11', 'us11', 'us11的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s13', 'us13', 'us13的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s14', 'us14', 'us14的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s15', 'us15', 'us15的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s16', 'us16', 'us16的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s17', 'us17', 'us17的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s18', 'us18', 'us18的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s19', 'us19', 'us19的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s2', 'us2', 'us2的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s3', 'us3', 'us3的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s5', 'us5', 'us5的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s6', 'us6', 'us6的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s7', 'us7', 'us7的云店');
INSERT INTO `lc_c_store`(`id`, `user_id`, `name`) VALUES ('s8', 'us8', 'us8的云店');

CREATE TABLE `lc_c_store_general` (
`id` bigint() unsigned NOT NULL AUTO_INCREMENT,
`store_id` varchar() DEFAULT NULL COMMENT '对应店铺表id',
`user_count` bigint() DEFAULT '' COMMENT '客户数,即 下一级别的用户数',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT= DEFAULT CHARSET=utf8 COMMENT='店铺销售数据表';
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's1', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's2', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's3', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's5', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's6', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's7', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's8', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's10', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's11', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's13', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's14', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's15', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's16', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's17', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's18', );
INSERT INTO `lc_c_store_general`(`id`, `store_id`, `user_count`) VALUES (, 's19', );

查看用户us2的上级path   complete_path

select * from lc_c_user_path where user_id='us2';

查看用户us2的所有下级用户

select * from lc_c_user_path where complete_path like '%us2/us1/us0';

某个开店用户下的客户数

select partent_user_id,count(1) as count from lc_c_customer where 1=1 GROUP BY partent_user_id

当某个店铺开店,更新lc_c_customer表的partent_user_id字段,即更新当前开店用户的所有下级的partent_user_id,此partent_user_id为最近的已开店的上级的user_id

partent_user_id可以通过获取user_id_path的第一个就是它的直接上级的已开店的partent_user_id

参考代码:

   /**
* desc 更新用户链条关系
*/
public function upUserChain(){
$where['create_time']=array('gt',"2016-01-01 00:00:00");
$storeM=M('c_store'); $data=$storeM->where($where)->order('create_time asc')->find(); if(empty($data)){
exit('没有数据需要更新');
} $openStoreUserId=$data['user_id'];
$up_date=$data['create_time']; //查询当前店铺的 对应的userPath信息
$userPathM=M('c_user_path');
$whereUP['user_id']=$openStoreUserId;
$field='user_id,username,store_id,user_id_path,username_path,store_id_path,complete_path';
$currentUserInfo=$userPathM->where($whereUP)->field($field)->find();
if(empty($currentUserInfo)){
exit('当前店铺不存在user_path');
}
//查询当前店铺的 对应的所有下级
$pidPath=$openStoreUserId.'/'.$currentUserInfo['complete_path'];
$whereAllSubordinate['complete_path']=array('like',"%{$pidPath}"); //按id升序
$list=$userPathM->where($whereAllSubordinate)->order('id asc')->field($field)->select(); //需要更新lc_store_general数据的店铺 -- 开店 + 开店所有下级(开店)+ 直接上级(开店)
$needUpStoreArr=array();
$needUpStoreArr[]=$currentUserInfo['store_id'];//开店
$store_id_path=$currentUserInfo['store_id_path'];
$storeIdPathArr=explode('/',$store_id_path);
$needUpStoreArr[]=reset($storeIdPathArr);//上级蜂店 try{
if(empty($list)){
exit('当前店铺无下级,更新完毕!');
}
//存在下级的情况
//更新lc_user_path 几个上级蜂店path
//更新所有下级的parent_user_id
$needUpPUIArr=array();
M()->startTrans();
foreach ($list as $key => $value) {
//当前用户的直接上级
$complete_path=$value['complete_path'];
$completePathArr=explode('/',$complete_path);
$firstLevel=reset($completePathArr); //判断当前用户是否开店
if(!empty($value['store_id'])){//说明已经开店--更新lc_store_general数据
$needUpStoreArr[]=$value['store_id'];
}
//判断当前用户的直接上级
$wherCurrenSuperior['user_id']=$firstLevel;
$currenSuperiorInfo=$userPathM->where($wherCurrenSuperior)->field($field)->find();
//判断当前用户的上级是否开店
if(!empty($currenSuperiorInfo['store_id'])){//说明已经开店
$newUserIdPath=$currenSuperiorInfo['user_id'].'/'.$currenSuperiorInfo['user_id_path'];//上级蜂店用户编号+上级蜂店用户父级编号=当前用户的上级蜂店用户编号
$newUserNamePath=$currenSuperiorInfo['username'].'/'.$currenSuperiorInfo['username_path'];//上级蜂店用户username+上级蜂店用户父级username=当前用户的上级蜂店用户username
$newStoreIdPath=$currenSuperiorInfo['store_id'].'/'.$currenSuperiorInfo['store_id_path'];//上级蜂店用户店铺编号+上级蜂店用户父级店铺编号=当前用户的上级蜂店用户店铺编号 //当前用户的上级蜂店
$firstStoreUserLevel=$currenSuperiorInfo['user_id']; }else{
//上级没有开店 所有的店铺相关path 都和上级一样
$newUserIdPath=$currenSuperiorInfo['user_id_path'];
$newUserNamePath=$currenSuperiorInfo['username_path'];
$newStoreIdPath=$currenSuperiorInfo['store_id_path'];
//当前用户的上级蜂店
$userIdPathArr=explode('/',$newUserIdPath);
$firstStoreUserLevel=reset($userIdPathArr);
}
$needUpPUIArr[$value['user_id']]=$firstStoreUserLevel; $whereUp['user_id']=$value['user_id'];
$upData=array(
'user_id_path'=>$newUserIdPath,
'username_path'=>$newUserNamePath,
'store_id_path'=>$newStoreIdPath,
);
$reUp=$userPathM->where($whereUp)->data($upData)->save();
if($reUp===false){
E('','更新user_path失败');
}
}
M()->commit();
exit('执行成功');
}catch (Exception $ex) {
M()->rollback();
$curCode=$ex->getErrorCode();
$curmsg=$ex->getMessage();
exit($curmsg);
}
}

mysql path妙用的更多相关文章

  1. WPF Binding Path妙用

    <Window x:Class="XamlTest.Window9"        xmlns="http://schemas.microsoft.com/winf ...

  2. WPF Binding Path妙用代码实现

    using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...

  3. mysql学习(4)-mysqldump备份和恢复数据

    背景 最近在公司做数据迁移方面的工作,使用mysql数据库在测试环境模拟数据迁移,在迁移测试的过程中需要做数据备份和恢复 mysql数据备份和恢复比较简单,可以选择mysqldump工具,这里简单提一 ...

  4. CentOS6.5 安装Sphinx 配置MySQL数据源

      前提安装完mysql,并创建测试表和数据 DROP TABLE IF EXISTS `documents`; CREATE TABLE IF NOT EXISTS `documents` ( `i ...

  5. CentOS6.4 安装Sphinx 配置MySQL数据源

    前提安装完mysql,并创建测试表和数据 DROP TABLE IF EXISTS `documents`; CREATE TABLE IF NOT EXISTS `documents` ( `id` ...

  6. MySQL备份学习

    备份分类 物理和逻辑备份 物理备份直接拷贝数据库目录和文件,适合数据量大.重要且需要在出现问题时快速恢复的数据库 逻辑备份保存信息包括逻辑数据库结构(数据库表的创建脚本)和内容(插入语句或者分隔符平面 ...

  7. 基于PXC的MySQL高可用环境简单部署

    PXC简介 Percona XtraDB Cluster(简称PXC集群)提供了MySQL高可用的一种实现方法. 1.集群是有节点组成的,推荐配置至少3个节点,但是也可以运行在2个节点上. 2.每个节 ...

  8. windows MySQL 5+ 服务手动安装

    一.手动安装mysql 1.准备一个mysql免安装版本(把原来安装好的版本复制一份即可.一次安装多次使用^_^),将mysql复制到指定目录. 2.配置my.ini文件(本例使用的是5.0.22版本 ...

  9. MySQL配置文件-my.ini

    下面允许我介绍一下MySQL的my.ini配置文件: my.ini是什么? my.ini是MySQL数据库中使用的配置文件,修改这个文件可以达到更新配置的目的. my.ini存放在哪里? my.ini ...

随机推荐

  1. springboot 框架 - helloword

    功能:浏览器发送hello请求,服务器接收请求并处理,返回hello word字符串 一.创建一个maven项目 二.在pom.xml文件中添加依赖导入springboot框架运行需要的依赖 < ...

  2. opencv:图像直方图均衡化

    // 直方图均衡化 Mat gray, dst; cvtColor(src, gray, COLOR_BGR2GRAY); equalizeHist(gray, dst); imshow(" ...

  3. AspectRatio图片的宽高比、Card 卡片组件

    一.AspectRatio 组件 AspectRatio 的作用是根据设置调整子元素 child 的宽高比. AspectRatio 首先会在布局限制条件允许的范围内尽可能的扩展,widget 的高度 ...

  4. Jekyll本地搭建开发环境以及Github部署流程

    转载自: http://www.jianshu.com/p/f37a96f83d51 前言 博客从wordpres迁移到Jekyll上来了,整个过程还是很顺利的.Jekyll是什么?它是一个简单静态博 ...

  5. mysql带条件的计数

    在网站开发的过程中,经常会用到数据统计功能,因此条件计数查询便是不可避免的,下面介绍几种方法来解决此问题. 例(假设): mysql> select * from count_demo; +-- ...

  6. C语言:判断t所指字符串中的字母是否由连续递增字母组成。-判断一个输入的任何整数n,是否等于某个连续正整数序列之和。-将一副扑克牌编号为1到54,以某种方式洗牌,这种方式是将这副牌分成两半,然后将他们交叉,并始终保持编号1的牌在最上方。

    //判断t所指字符串中的字母是否由连续递增字母组成. #include <stdio.h> #include <string.h> void NONO(); int fun( ...

  7. C# 动态类型 以及 脚本调用(scriptRunTime)

    在使用中让我感觉 好像 JavaScript中的 动态类型囧 先看动态类型 class Program { static void Main(string[] args) { var streamRe ...

  8. Hibernate学习过程出现的问题

    1  核心配置文件hibernate.cfg.xml添加了约束但是无法自动获取属性值 解决方案:手动将DTD文件导入 步骤:倒开Eclipse,找到[window]->[preference]- ...

  9. 在Visual Studio 2017中,.NET(C#)通过Oracle.ManagedDataAccess来连接Oracle数据库

    C#如何通过Oracle.ManagedDataAccess来连接Oracle数据库 1.先创建一个项目,鼠标右击项目中的引用,再点击管理NuGet程序包(也可以先下载dll文件,再选添加引用),在搜 ...

  10. 【PAT甲级】1047 Student List for Course (25 分)

    题意: 输入两个正整数N和K(N<=40000,K<=2500),接下来输入N行,每行包括一个学生的名字和所选课程的门数,接着输入每门所选课程的序号.输出每门课程有多少学生选择并按字典序输 ...