Merge pull request #107 from zoujingli/master

合并composer到v3
This commit is contained in:
邹景立 2018-05-12 16:32:08 +08:00 committed by GitHub
commit 6e90d26658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2588 changed files with 16430 additions and 5337 deletions

8
.gitignore vendored
View File

@ -1,9 +1,11 @@
!.gitignore
!.gitattributes
/.idea
/.svn
/.git
*.DS_Store
*.idea
*.svn
*.git
/runtime
/nbproject
!composer.json
/composer.lock
/static/upload

View File

@ -5,7 +5,7 @@ ThinkAdmin for PHP
* ThinkAdmin 是一个基于 Thinkphp 5.1.x 开发的后台管理系统,集成后台系统常用功能。
* 项目安装及二次开发请参考 ThinkPHP 官方文档及下面的服务环境说明,数据库 sql 文件存放于项目根目录下。
>* 注意:项目测试请另行搭建环境并创建数据库(数据库配置 config/database.php, 切勿直接使用测试环境数据!
>* 如果系统提示“测试系统禁止操作等字样”,可以修改项目路由配置route/route.php, 清空里面的路由记录。
>* 如果系统提示“测试系统禁止操作等字样”,可以删除项目演示路由配置route/demo.php清空里面的路由记录。
>* 当前版本使用 ThinkPHP 5.1.x 版本对PHP版本要求不低于php5.6具体请查阅ThinkPHP官方文档。

View File

@ -1,25 +1,135 @@
/*
Navicat MySQL Data Transfer
Source Server : ctolog.com
Source Server Version : 50559
Source Host : ctolog.com:3306
Source Server : server.cuci.cc
Source Server Version : 50558
Source Host : server.cuci.cc:3306
Source Database : admin_v3
Target Server Type : MYSQL
Target Server Version : 50559
Target Server Version : 50558
File Encoding : 65001
Date: 2018-03-23 17:07:39
Date: 2018-05-04 11:40:19
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for goods
-- Table structure for store_express
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods` (
DROP TABLE IF EXISTS `store_express`;
CREATE TABLE `store_express` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`express_title` varchar(50) DEFAULT '' COMMENT '快递公司名称',
`express_code` varchar(50) DEFAULT '' COMMENT '快递公司代码',
`express_desc` text COMMENT '快递公司描述',
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '状态(0.无效,1.有效)',
`sort` bigint(20) unsigned DEFAULT '0' COMMENT '排序',
`is_deleted` tinyint(1) unsigned DEFAULT '0' COMMENT '删除状态(1删除,0未删除)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8 COMMENT='商城快递配置';
-- ----------------------------
-- Records of store_express
-- ----------------------------
INSERT INTO `store_express` VALUES ('5', 'AAE全球专递', 'aae', '顺丰快递公司', '0', '0', '0', '2017-09-12 11:53:40');
INSERT INTO `store_express` VALUES ('6', '安捷快递', 'anjie', '', '0', '0', '0', '2017-09-13 15:27:26');
INSERT INTO `store_express` VALUES ('7', '安信达快递', 'anxindakuaixi', null, '0', '0', '0', '2017-09-13 16:05:19');
INSERT INTO `store_express` VALUES ('8', '彪记快递', 'biaojikuaidi', null, '0', '0', '0', '2017-09-13 16:05:26');
INSERT INTO `store_express` VALUES ('9', 'BHT', 'bht', '', '0', '0', '0', '2017-09-13 16:05:37');
INSERT INTO `store_express` VALUES ('10', '百福东方国际物流', 'baifudongfang', null, '0', '0', '0', '2017-09-13 16:05:41');
INSERT INTO `store_express` VALUES ('11', '中国东方COE', 'coe', null, '0', '0', '0', '2017-09-13 16:05:48');
INSERT INTO `store_express` VALUES ('12', '长宇物流', 'changyuwuliu', null, '0', '0', '0', '2017-09-13 16:05:58');
INSERT INTO `store_express` VALUES ('13', '大田物流', 'datianwuliu', null, '0', '0', '0', '2017-09-13 16:06:06');
INSERT INTO `store_express` VALUES ('14', '德邦物流', 'debangwuliu', null, '1', '1', '0', '2017-09-13 16:06:14');
INSERT INTO `store_express` VALUES ('15', 'DHL', 'dhl', null, '0', '0', '0', '2017-09-13 16:06:24');
INSERT INTO `store_express` VALUES ('16', 'DPEX', 'dpex', null, '0', '0', '0', '2017-09-13 16:06:29');
INSERT INTO `store_express` VALUES ('17', 'd速快递', 'dsukuaidi', null, '0', '0', '0', '2017-09-13 16:06:34');
INSERT INTO `store_express` VALUES ('18', '递四方', 'disifang', null, '0', '0', '0', '2017-09-13 16:06:40');
INSERT INTO `store_express` VALUES ('19', 'EMS快递', 'ems', '', '1', '0', '0', '2017-09-13 16:06:47');
INSERT INTO `store_express` VALUES ('20', 'FEDEX国外', 'fedex', null, '0', '0', '0', '2017-09-13 16:06:56');
INSERT INTO `store_express` VALUES ('21', '飞康达物流', 'feikangda', null, '0', '0', '0', '2017-09-13 16:07:03');
INSERT INTO `store_express` VALUES ('22', '凤凰快递', 'fenghuangkuaidi', null, '0', '0', '0', '2017-09-13 16:07:10');
INSERT INTO `store_express` VALUES ('23', '飞快达', 'feikuaida', null, '0', '0', '0', '2017-09-13 16:07:16');
INSERT INTO `store_express` VALUES ('24', '国通快递', 'guotongkuaidi', null, '0', '0', '0', '2017-09-13 16:07:27');
INSERT INTO `store_express` VALUES ('25', '港中能达物流', 'ganzhongnengda', null, '0', '0', '0', '2017-09-13 16:07:33');
INSERT INTO `store_express` VALUES ('26', '广东邮政物流', 'guangdongyouzhengwuliu', null, '0', '0', '0', '2017-09-13 16:08:22');
INSERT INTO `store_express` VALUES ('27', '共速达', 'gongsuda', null, '0', '0', '0', '2017-09-13 16:08:48');
INSERT INTO `store_express` VALUES ('28', '汇通快运', 'huitongkuaidi', null, '0', '0', '0', '2017-09-13 16:08:56');
INSERT INTO `store_express` VALUES ('29', '恒路物流', 'hengluwuliu', null, '0', '0', '0', '2017-09-13 16:09:02');
INSERT INTO `store_express` VALUES ('30', '华夏龙物流', 'huaxialongwuliu', null, '0', '0', '0', '2017-09-13 16:09:12');
INSERT INTO `store_express` VALUES ('31', '海红', 'haihongwangsong', null, '0', '0', '0', '2017-09-13 16:09:20');
INSERT INTO `store_express` VALUES ('32', '海外环球', 'haiwaihuanqiu', null, '0', '0', '0', '2017-09-13 16:09:27');
INSERT INTO `store_express` VALUES ('33', '佳怡物流', 'jiayiwuliu', null, '0', '0', '0', '2017-09-13 16:09:35');
INSERT INTO `store_express` VALUES ('34', '京广速递', 'jinguangsudikuaijian', null, '0', '0', '0', '2017-09-13 16:09:42');
INSERT INTO `store_express` VALUES ('35', '急先达', 'jixianda', null, '0', '0', '0', '2017-09-13 16:09:49');
INSERT INTO `store_express` VALUES ('36', '佳吉物流', 'jjwl', null, '0', '0', '0', '2017-09-13 16:10:01');
INSERT INTO `store_express` VALUES ('37', '加运美物流', 'jymwl', null, '0', '0', '0', '2017-09-13 16:10:13');
INSERT INTO `store_express` VALUES ('38', '金大物流', 'jindawuliu', null, '0', '0', '0', '2017-09-13 16:10:22');
INSERT INTO `store_express` VALUES ('39', '嘉里大通', 'jialidatong', null, '0', '0', '0', '2017-09-13 16:10:33');
INSERT INTO `store_express` VALUES ('40', '晋越快递', 'jykd', null, '0', '0', '0', '2017-09-13 16:10:40');
INSERT INTO `store_express` VALUES ('41', '快捷速递', 'kuaijiesudi', null, '0', '0', '0', '2017-09-13 16:10:49');
INSERT INTO `store_express` VALUES ('42', '联邦快递(国内)', 'lianb', null, '0', '0', '0', '2017-09-13 16:10:58');
INSERT INTO `store_express` VALUES ('43', '联昊通物流', 'lianhaowuliu', null, '0', '0', '0', '2017-09-13 16:11:07');
INSERT INTO `store_express` VALUES ('44', '龙邦物流', 'longbanwuliu', null, '0', '0', '0', '2017-09-13 16:11:15');
INSERT INTO `store_express` VALUES ('45', '立即送', 'lijisong', null, '0', '0', '0', '2017-09-13 16:11:25');
INSERT INTO `store_express` VALUES ('46', '乐捷递', 'lejiedi', null, '0', '0', '0', '2017-09-13 16:11:36');
INSERT INTO `store_express` VALUES ('47', '民航快递', 'minghangkuaidi', null, '0', '0', '0', '2017-09-13 16:11:45');
INSERT INTO `store_express` VALUES ('48', '美国快递', 'meiguokuaidi', null, '0', '0', '0', '2017-09-13 16:11:53');
INSERT INTO `store_express` VALUES ('49', '门对门', 'menduimen', null, '0', '0', '0', '2017-09-13 16:12:01');
INSERT INTO `store_express` VALUES ('50', 'OCS', 'ocs', null, '0', '0', '0', '2017-09-13 16:12:10');
INSERT INTO `store_express` VALUES ('51', '配思货运', 'peisihuoyunkuaidi', null, '0', '0', '0', '2017-09-13 16:12:18');
INSERT INTO `store_express` VALUES ('52', '全晨快递', 'quanchenkuaidi', null, '0', '0', '0', '2017-09-13 16:12:26');
INSERT INTO `store_express` VALUES ('53', '全峰快递', 'quanfengkuaidi', null, '0', '0', '0', '2017-09-13 16:12:34');
INSERT INTO `store_express` VALUES ('54', '全际通物流', 'quanjitong', null, '0', '0', '0', '2017-09-13 16:12:41');
INSERT INTO `store_express` VALUES ('55', '全日通快递', 'quanritongkuaidi', null, '0', '0', '0', '2017-09-13 16:12:49');
INSERT INTO `store_express` VALUES ('56', '全一快递', 'quanyikuaidi', null, '0', '0', '0', '2017-09-13 16:12:56');
INSERT INTO `store_express` VALUES ('57', '如风达', 'rufengda', null, '0', '0', '0', '2017-09-13 16:13:03');
INSERT INTO `store_express` VALUES ('58', '三态速递', 'santaisudi', null, '0', '0', '0', '2017-09-13 16:13:15');
INSERT INTO `store_express` VALUES ('59', '盛辉物流', 'shenghuiwuliu', null, '0', '0', '0', '2017-09-13 16:13:22');
INSERT INTO `store_express` VALUES ('60', '申通', 'shentong', null, '0', '0', '0', '2017-09-13 16:13:34');
INSERT INTO `store_express` VALUES ('61', '顺丰', 'shunfeng', '', '1', '0', '0', '2017-09-13 16:13:41');
INSERT INTO `store_express` VALUES ('62', '速尔物流', 'sue', null, '0', '0', '0', '2017-09-13 16:13:48');
INSERT INTO `store_express` VALUES ('63', '盛丰物流', 'shengfeng', null, '0', '0', '0', '2017-09-13 16:13:55');
INSERT INTO `store_express` VALUES ('64', '赛澳递', 'saiaodi', null, '0', '0', '0', '2017-09-13 16:14:02');
INSERT INTO `store_express` VALUES ('65', '天地华宇', 'tiandihuayu', null, '0', '0', '0', '2017-09-13 16:14:11');
INSERT INTO `store_express` VALUES ('66', '天天快递', 'tiantian', null, '0', '0', '0', '2017-09-13 16:14:19');
INSERT INTO `store_express` VALUES ('67', 'TNT', 'tnt', null, '0', '0', '0', '2017-09-13 16:14:26');
INSERT INTO `store_express` VALUES ('68', 'UPS', 'ups', null, '0', '0', '0', '2017-09-13 16:14:29');
INSERT INTO `store_express` VALUES ('69', '万家物流', 'wanjiawuliu', null, '0', '0', '0', '2017-09-13 16:14:37');
INSERT INTO `store_express` VALUES ('70', '文捷航空速递', 'wenjiesudi', null, '0', '0', '0', '2017-09-13 16:14:46');
INSERT INTO `store_express` VALUES ('71', '伍圆', 'wuyuan', null, '0', '0', '0', '2017-09-13 16:14:52');
INSERT INTO `store_express` VALUES ('72', '万象物流', 'wxwl', null, '0', '0', '0', '2017-09-13 16:15:00');
INSERT INTO `store_express` VALUES ('73', '新邦物流', 'xinbangwuliu', null, '0', '0', '0', '2017-09-13 16:15:06');
INSERT INTO `store_express` VALUES ('74', '信丰物流', 'xinfengwuliu', null, '0', '0', '0', '2017-09-13 16:15:15');
INSERT INTO `store_express` VALUES ('75', '亚风速递', 'yafengsudi', null, '0', '0', '0', '2017-09-13 16:15:23');
INSERT INTO `store_express` VALUES ('76', '一邦速递', 'yibangwuliu', null, '0', '0', '0', '2017-09-13 16:15:30');
INSERT INTO `store_express` VALUES ('77', '优速物流', 'youshuwuliu', null, '0', '0', '0', '2017-09-13 16:15:36');
INSERT INTO `store_express` VALUES ('78', '邮政包裹挂号信', 'youzhengguonei', null, '0', '3', '0', '2017-09-13 16:15:44');
INSERT INTO `store_express` VALUES ('79', '邮政国际包裹挂号信', 'youzhengguoji', null, '0', '2', '0', '2017-09-13 16:15:51');
INSERT INTO `store_express` VALUES ('80', '远成物流', 'yuanchengwuliu', null, '0', '0', '0', '2017-09-13 16:15:57');
INSERT INTO `store_express` VALUES ('81', '圆通速递', 'yuantong', null, '1', '1', '0', '2017-09-13 16:16:03');
INSERT INTO `store_express` VALUES ('82', '源伟丰快递', 'yuanweifeng', null, '0', '0', '0', '2017-09-13 16:16:10');
INSERT INTO `store_express` VALUES ('83', '元智捷诚快递', 'yuanzhijiecheng', null, '0', '0', '0', '2017-09-13 16:16:17');
INSERT INTO `store_express` VALUES ('84', '韵达快运', 'yunda', null, '0', '0', '0', '2017-09-13 16:16:24');
INSERT INTO `store_express` VALUES ('85', '运通快递', 'yuntongkuaidi', null, '0', '0', '0', '2017-09-13 16:16:33');
INSERT INTO `store_express` VALUES ('86', '越丰物流', 'yuefengwuliu', null, '0', '0', '0', '2017-09-13 16:16:40');
INSERT INTO `store_express` VALUES ('87', '源安达', 'yad', null, '0', '0', '0', '2017-09-13 16:16:47');
INSERT INTO `store_express` VALUES ('88', '银捷速递', 'yinjiesudi', null, '0', '0', '0', '2017-09-13 16:16:56');
INSERT INTO `store_express` VALUES ('89', '宅急送', 'zhaijisong', null, '0', '0', '0', '2017-09-13 16:17:03');
INSERT INTO `store_express` VALUES ('90', '中铁快运', 'zhongtiekuaiyun', null, '0', '0', '0', '2017-09-13 16:17:10');
INSERT INTO `store_express` VALUES ('91', '中通速递', 'zhongtong', '', '0', '0', '0', '2017-09-13 16:17:16');
INSERT INTO `store_express` VALUES ('92', '中邮物流', 'zhongyouwuliu', null, '0', '0', '0', '2017-09-13 16:17:27');
INSERT INTO `store_express` VALUES ('93', '忠信达', 'zhongxinda', null, '0', '0', '0', '2017-09-13 16:17:34');
INSERT INTO `store_express` VALUES ('94', '芝麻开门', 'zhimakaimen', null, '0', '0', '0', '2017-09-13 16:17:41');
-- ----------------------------
-- Table structure for store_goods
-- ----------------------------
DROP TABLE IF EXISTS `store_goods`;
CREATE TABLE `store_goods` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`brand_id` bigint(20) unsigned DEFAULT '0' COMMENT '品牌ID',
`cate_id` bigint(20) unsigned DEFAULT '0' COMMENT '商品分类id',
@ -44,14 +154,14 @@ CREATE TABLE `goods` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商城商品主表';
-- ----------------------------
-- Records of goods
-- Records of store_goods
-- ----------------------------
-- ----------------------------
-- Table structure for goods_brand
-- Table structure for store_goods_brand
-- ----------------------------
DROP TABLE IF EXISTS `goods_brand`;
CREATE TABLE `goods_brand` (
DROP TABLE IF EXISTS `store_goods_brand`;
CREATE TABLE `store_goods_brand` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`brand_logo` varchar(1024) DEFAULT '' COMMENT '品牌logo',
`brand_cover` varchar(1024) DEFAULT '' COMMENT '品牌封面',
@ -63,17 +173,17 @@ CREATE TABLE `goods_brand` (
`is_deleted` tinyint(1) unsigned DEFAULT '0' COMMENT '删除状态(1删除,0未删除)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品产品品牌';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='产品品牌';
-- ----------------------------
-- Records of goods_brand
-- Records of store_goods_brand
-- ----------------------------
-- ----------------------------
-- Table structure for goods_cate
-- Table structure for store_goods_cate
-- ----------------------------
DROP TABLE IF EXISTS `goods_cate`;
CREATE TABLE `goods_cate` (
DROP TABLE IF EXISTS `store_goods_cate`;
CREATE TABLE `store_goods_cate` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`pid` bigint(20) unsigned DEFAULT '0' COMMENT '上级分类编号',
`brand_id` bigint(20) DEFAULT '0' COMMENT '品牌ID',
@ -87,14 +197,14 @@ CREATE TABLE `goods_cate` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商城商品分类';
-- ----------------------------
-- Records of goods_cate
-- Records of store_goods_cate
-- ----------------------------
-- ----------------------------
-- Table structure for goods_list
-- Table structure for store_goods_list
-- ----------------------------
DROP TABLE IF EXISTS `goods_list`;
CREATE TABLE `goods_list` (
DROP TABLE IF EXISTS `store_goods_list`;
CREATE TABLE `store_goods_list` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`goods_id` bigint(20) unsigned DEFAULT '0' COMMENT '商品ID',
`goods_spec` varchar(255) DEFAULT '' COMMENT '商品规格名称',
@ -110,14 +220,14 @@ CREATE TABLE `goods_list` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商城商品列表';
-- ----------------------------
-- Records of goods_list
-- Records of store_goods_list
-- ----------------------------
-- ----------------------------
-- Table structure for goods_spec
-- Table structure for store_goods_spec
-- ----------------------------
DROP TABLE IF EXISTS `goods_spec`;
CREATE TABLE `goods_spec` (
DROP TABLE IF EXISTS `store_goods_spec`;
CREATE TABLE `store_goods_spec` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mch_id` bigint(20) unsigned DEFAULT '0' COMMENT '商户ID',
`spec_title` varchar(255) DEFAULT '' COMMENT '商品规格名称',
@ -132,7 +242,152 @@ CREATE TABLE `goods_spec` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商城商品规格';
-- ----------------------------
-- Records of goods_spec
-- Records of store_goods_spec
-- ----------------------------
-- ----------------------------
-- Table structure for store_member
-- ----------------------------
DROP TABLE IF EXISTS `store_member`;
CREATE TABLE `store_member` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`openid` varchar(100) DEFAULT '' COMMENT '会员微信OPENID',
`phone` varchar(16) DEFAULT '' COMMENT '会员手机号',
`password` varchar(64) NOT NULL DEFAULT '' COMMENT '登录密码',
`nickname` varchar(20) DEFAULT '' COMMENT '会员昵称',
`headimg` varchar(500) DEFAULT '' COMMENT '会员头像',
`sex` char(2) DEFAULT '' COMMENT '性别',
`level` tinyint(2) unsigned DEFAULT '1' COMMENT '会员级别',
`remark` varchar(500) DEFAULT '' COMMENT '会员个性签名',
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '会员状态(1有效,0无效)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `index_store_member_openid` (`openid`) USING BTREE,
KEY `index_store_member_phone` (`phone`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商城会员信息';
-- ----------------------------
-- Records of store_member
-- ----------------------------
-- ----------------------------
-- Table structure for store_member_address
-- ----------------------------
DROP TABLE IF EXISTS `store_member_address`;
CREATE TABLE `store_member_address` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mid` bigint(20) unsigned DEFAULT '0' COMMENT '会员ID',
`username` varchar(20) DEFAULT '' COMMENT '收货人姓名',
`phone` varchar(16) DEFAULT '' COMMENT '收货手机号',
`province` varchar(50) DEFAULT '' COMMENT '收货地址省份',
`city` varchar(50) DEFAULT '' COMMENT '收货地址城市',
`area` varchar(255) DEFAULT '' COMMENT '收货地址区域',
`address` varchar(255) DEFAULT '' COMMENT '收货详细地址',
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '状态(0无效, 1新快递)',
`is_default` tinyint(1) unsigned DEFAULT '1' COMMENT '默认收货地址',
`is_deleted` bigint(1) unsigned DEFAULT '0' COMMENT '删除状态(1删除,0未删除)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商城会员收货地址';
-- ----------------------------
-- Records of store_member_address
-- ----------------------------
-- ----------------------------
-- Table structure for store_order
-- ----------------------------
DROP TABLE IF EXISTS `store_order`;
CREATE TABLE `store_order` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`type` tinyint(1) unsigned DEFAULT '1' COMMENT '订单类型(1普通订单,2积分订单)',
`mid` bigint(20) unsigned DEFAULT '0' COMMENT '会员ID',
`order_no` char(10) DEFAULT '' COMMENT '订单号',
`freight_price` decimal(20,2) unsigned DEFAULT '0.00' COMMENT '快递费',
`goods_price` decimal(20,2) unsigned DEFAULT '0.00' COMMENT '商品总金额(不含快递费)',
`real_price` decimal(20,2) unsigned DEFAULT '0.00' COMMENT '真实支付金额(商品金额+快递金额)',
`is_pay` tinyint(1) unsigned DEFAULT '0' COMMENT '订单支付状态(0.未支付,1.已支付)',
`pay_type` varchar(255) DEFAULT '' COMMENT '支付方式 (wechat微信支付, alipay支付宝支付)',
`pay_no` varchar(100) DEFAULT '' COMMENT '商户交易号',
`pay_price` decimal(20,2) unsigned DEFAULT '0.00' COMMENT '实际支付金额',
`pay_at` datetime DEFAULT NULL COMMENT '支付时间',
`desc` text COMMENT '订单描述',
`status` bigint(1) unsigned DEFAULT '1' COMMENT '订单状态(0.无效,1.新订单,2.待发货,3.已发货,4.已收货,5.已完成,6.已退货及退款)',
`is_deleted` tinyint(1) unsigned DEFAULT '0' COMMENT '删除状态(1删除,0未删除)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_store_order_order_no` (`order_no`) USING BTREE,
KEY `index_store_order_status` (`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商城订单主表';
-- ----------------------------
-- Records of store_order
-- ----------------------------
-- ----------------------------
-- Table structure for store_order_express
-- ----------------------------
DROP TABLE IF EXISTS `store_order_express`;
CREATE TABLE `store_order_express` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mid` bigint(20) unsigned DEFAULT '0' COMMENT '会员ID',
`type` tinyint(1) unsigned DEFAULT '0' COMMENT '快递类型(0.订单快递,1.退货快递)',
`order_no` char(10) DEFAULT '' COMMENT '订单编号',
`company_title` varchar(50) DEFAULT '' COMMENT '物流公司名称',
`company_code` varchar(50) DEFAULT '' COMMENT '物流公司编码',
`username` varchar(20) DEFAULT '' COMMENT '收货人姓名',
`phone` varchar(16) DEFAULT '' COMMENT '收货手机号',
`province` varchar(50) DEFAULT NULL COMMENT '收货地址省份',
`city` varchar(50) DEFAULT '' COMMENT '收货地址城市',
`area` varchar(255) DEFAULT '' COMMENT '收货地址区域',
`address` varchar(255) DEFAULT '' COMMENT '收货详细地址',
`send_no` varchar(50) DEFAULT '' COMMENT '实际物流公司单号',
`send_company_title` varchar(50) DEFAULT '' COMMENT '实际发货快递公司',
`send_company_code` varchar(50) DEFAULT '' COMMENT '实际发货快递代码',
`send_username` varchar(255) DEFAULT '' COMMENT '寄件人名称',
`send_phone` varchar(16) DEFAULT '' COMMENT '寄件人手机号',
`send_province` varchar(50) DEFAULT '' COMMENT '寄件人地址省份',
`send_city` varchar(50) DEFAULT '' COMMENT '寄件人地址城市',
`send_area` varchar(255) DEFAULT '' COMMENT '寄件人地址区域',
`send_address` varchar(255) DEFAULT '' COMMENT '寄件人详细地址',
`send_at` datetime DEFAULT NULL COMMENT '快递发货时间',
`desc` text COMMENT '发货描述',
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '状态(0.无效,1.新快递,2.已签收,3.签收失败)',
`is_deleted` bigint(1) unsigned DEFAULT '0' COMMENT '删除状态(1删除,0未删除)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商城订单快递';
-- ----------------------------
-- Records of store_order_express
-- ----------------------------
-- ----------------------------
-- Table structure for store_order_goods
-- ----------------------------
DROP TABLE IF EXISTS `store_order_goods`;
CREATE TABLE `store_order_goods` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mid` bigint(20) unsigned DEFAULT '0' COMMENT '会员ID',
`order_no` char(10) DEFAULT '' COMMENT '订单编号',
`goods_id` bigint(20) DEFAULT '0' COMMENT '商品ID',
`goods_title` varchar(255) DEFAULT '' COMMENT '商品标签',
`goods_spec` varchar(255) DEFAULT '' COMMENT '商品规格',
`goods_logo` varchar(255) DEFAULT '' COMMENT '商品LOGO',
`goods_image` text COMMENT '商品图片地址',
`market_price` decimal(20,2) unsigned DEFAULT '0.00' COMMENT '市场价格',
`selling_price` decimal(20,2) unsigned DEFAULT '0.00' COMMENT '商品销售价格',
`price_field` varchar(20) DEFAULT 'selling_price' COMMENT '计价字段',
`number` bigint(20) unsigned DEFAULT '0' COMMENT '订单商品数量',
`status` bigint(1) unsigned DEFAULT '1' COMMENT '商品状态(1有效,0无效)',
`is_deleted` bigint(1) unsigned DEFAULT '0' COMMENT '删除状态(1删除,0未删除)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_store_order_list_order_no` (`order_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商城订单关联商品';
-- ----------------------------
-- Records of store_order_goods
-- ----------------------------
-- ----------------------------
@ -183,7 +438,7 @@ CREATE TABLE `system_config` (
`value` varchar(500) DEFAULT NULL COMMENT '配置值',
PRIMARY KEY (`id`),
KEY `index_system_config_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='系统参数配置';
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8 COMMENT='系统参数配置';
-- ----------------------------
-- Records of system_config
@ -191,8 +446,8 @@ CREATE TABLE `system_config` (
INSERT INTO `system_config` VALUES ('1', 'app_name', 'ThinkAdmin');
INSERT INTO `system_config` VALUES ('2', 'site_name', 'ThinkAdmin');
INSERT INTO `system_config` VALUES ('3', 'app_version', '3.0 dev');
INSERT INTO `system_config` VALUES ('4', 'site_copy', '©版权所有 2014-2018 楚才科技');
INSERT INTO `system_config` VALUES ('5', 'browser_icon', 'http://service.thinkadmin.top/static/upload/f47b8fe06e38ae99/08e8398da45583b9.png');
INSERT INTO `system_config` VALUES ('4', 'site_copy', '©版权所有 2014-2018 楚才科技');
INSERT INTO `system_config` VALUES ('5', 'browser_icon', 'http://localhost/ThinkAdmin/static/upload/f47b8fe06e38ae99/08e8398da45583b9.png');
INSERT INTO `system_config` VALUES ('6', 'tongji_baidu_key', '');
INSERT INTO `system_config` VALUES ('7', 'miitbeian', '粤ICP备16006642号-2');
INSERT INTO `system_config` VALUES ('8', 'storage_type', 'local');
@ -209,7 +464,7 @@ INSERT INTO `system_config` VALUES ('18', 'storage_oss_secret', '用你自己的
INSERT INTO `system_config` VALUES ('34', 'wechat_appid', 'wx60a43dd8161666d4');
INSERT INTO `system_config` VALUES ('35', 'wechat_appkey', '9890a0d7c91801a609d151099e95b61a');
INSERT INTO `system_config` VALUES ('36', 'storage_oss_is_https', 'http');
INSERT INTO `system_config` VALUES ('37', 'wechat_type', 'api');
INSERT INTO `system_config` VALUES ('37', 'wechat_type', 'thr');
INSERT INTO `system_config` VALUES ('38', 'wechat_token', 'test');
INSERT INTO `system_config` VALUES ('39', 'wechat_appsecret', 'a041bec98ed015d52b99acea5c6a16ef');
INSERT INTO `system_config` VALUES ('40', 'wechat_encodingaeskey', 'BJIUzE0gqlWy0GxfPp4J1oPTBmOrNDIGPNav1YFH5Z5');
@ -254,7 +509,7 @@ CREATE TABLE `system_menu` (
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_system_menu_node` (`node`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8 COMMENT='系统菜单表';
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8 COMMENT='系统菜单表';
-- ----------------------------
-- Records of system_menu
@ -268,22 +523,33 @@ INSERT INTO `system_menu` VALUES ('6', '11', '访问节点', '', 'fa fa-fort-awe
INSERT INTO `system_menu` VALUES ('7', '0', '后台首页', '', '', 'admin/index/main', '', '_self', '1000', '1', '0', '2018-01-23 13:42:30');
INSERT INTO `system_menu` VALUES ('8', '16', '系统日志', '', 'fa fa-code', 'admin/log/index', '', '_self', '10', '1', '0', '2018-01-24 13:52:58');
INSERT INTO `system_menu` VALUES ('9', '10', '文件存储', '', 'fa fa-stop-circle', 'admin/config/file', '', '_self', '30', '1', '0', '2018-01-25 10:54:28');
INSERT INTO `system_menu` VALUES ('10', '1', '系统管理', '', 'fa fa-scribd', '#', '', '_self', '200', '1', '0', '2018-01-25 18:14:28');
INSERT INTO `system_menu` VALUES ('11', '1', '访问权限', '', 'fa fa-anchor', '#', '', '_self', '300', '1', '0', '2018-01-25 18:15:08');
INSERT INTO `system_menu` VALUES ('16', '1', '日志管理', '', 'fa fa-hashtag', '#', '', '_self', '400', '1', '0', '2018-02-10 16:31:15');
INSERT INTO `system_menu` VALUES ('10', '1', '系统管理', '', '', '#', '', '_self', '200', '1', '0', '2018-01-25 18:14:28');
INSERT INTO `system_menu` VALUES ('11', '1', '访问权限', '', '', '#', '', '_self', '300', '1', '0', '2018-01-25 18:15:08');
INSERT INTO `system_menu` VALUES ('16', '1', '日志管理', '', '', '#', '', '_self', '400', '1', '0', '2018-02-10 16:31:15');
INSERT INTO `system_menu` VALUES ('17', '0', '微信管理', '', '', '#', '', '_self', '8000', '1', '0', '2018-03-06 14:42:49');
INSERT INTO `system_menu` VALUES ('18', '17', '公众号配置', '', 'fa fa-cogs', '#', '', '_self', '0', '1', '0', '2018-03-06 14:43:05');
INSERT INTO `system_menu` VALUES ('18', '17', '公众号配置', '', '', '#', '', '_self', '0', '1', '0', '2018-03-06 14:43:05');
INSERT INTO `system_menu` VALUES ('19', '18', '微信授权绑定', '', 'fa fa-cog', 'wechat/config/index', '', '_self', '0', '1', '0', '2018-03-06 14:43:26');
INSERT INTO `system_menu` VALUES ('20', '18', '关注默认回复', '', 'fa fa-comment-o', 'wechat/keys/subscribe', '', '_self', '0', '1', '0', '2018-03-06 14:44:45');
INSERT INTO `system_menu` VALUES ('21', '18', '无反馈默认回复', '', 'fa fa-commenting', 'wechat/keys/defaults', '', '_self', '0', '1', '0', '2018-03-06 14:45:55');
INSERT INTO `system_menu` VALUES ('22', '18', '微信关键字管理', '', 'fa fa-hashtag', 'wechat/keys/index', '', '_self', '0', '1', '0', '2018-03-06 14:46:23');
INSERT INTO `system_menu` VALUES ('23', '17', '微信服务定制', '', 'fa fa-cubes', '#', '', '_self', '0', '1', '0', '2018-03-06 14:47:11');
INSERT INTO `system_menu` VALUES ('23', '17', '微信服务定制', '', '', '#', '', '_self', '0', '1', '0', '2018-03-06 14:47:11');
INSERT INTO `system_menu` VALUES ('24', '23', '微信菜单管理', '', 'fa fa-gg-circle', 'wechat/menu/index', '', '_self', '0', '1', '0', '2018-03-06 14:47:39');
INSERT INTO `system_menu` VALUES ('25', '23', '微信图文管理', '', 'fa fa-map-o', 'wechat/news/index', '', '_self', '0', '1', '0', '2018-03-06 14:48:14');
INSERT INTO `system_menu` VALUES ('26', '17', '微信粉丝管理', '', 'fa fa-user', '#', '', '_self', '0', '1', '0', '2018-03-06 14:48:33');
INSERT INTO `system_menu` VALUES ('27', '26', '微信粉丝列表', '', 'fa fa-users', 'wechat/fans/index', '', '_self', '20', '1', '0', '2018-03-06 14:49:04');
INSERT INTO `system_menu` VALUES ('28', '26', '微信黑名单管理', '', 'fa fa-user-times', 'wechat/block/index', '', '_self', '30', '1', '0', '2018-03-06 14:49:22');
INSERT INTO `system_menu` VALUES ('28', '26', '微信黑名单管理', '', 'fa fa-user-times', 'wechat/fans_block/index', '', '_self', '30', '1', '0', '2018-03-06 14:49:22');
INSERT INTO `system_menu` VALUES ('29', '26', '微信标签管理', '', 'fa fa-tags', 'wechat/tags/index', '', '_self', '10', '1', '0', '2018-03-06 14:49:39');
INSERT INTO `system_menu` VALUES ('32', '0', '商城管理', '', '', '#', '', '_self', '2000', '1', '0', '2018-03-20 16:46:07');
INSERT INTO `system_menu` VALUES ('33', '32', '商品管理', '', '', '#', '', '_self', '0', '1', '0', '2018-03-20 16:46:21');
INSERT INTO `system_menu` VALUES ('34', '33', '产品管理', '', 'fa fa-modx', 'store/goods/index', '', '_self', '0', '1', '0', '2018-03-20 16:46:45');
INSERT INTO `system_menu` VALUES ('35', '33', '规格管理', '', 'fa fa-hashtag', 'store/goods_spec/index', '', '_self', '0', '1', '0', '2018-03-20 16:47:08');
INSERT INTO `system_menu` VALUES ('36', '33', '分类管理', '', 'fa fa-product-hunt', 'store/goods_cate/index', '', '_self', '0', '1', '0', '2018-03-20 16:47:50');
INSERT INTO `system_menu` VALUES ('37', '33', '品牌管理', '', 'fa fa-scribd', 'store/goods_brand/index', '', '_self', '0', '1', '0', '2018-03-20 16:48:05');
INSERT INTO `system_menu` VALUES ('38', '32', '订单管理', '', '', '#', '', '_self', '0', '1', '0', '2018-04-21 15:07:36');
INSERT INTO `system_menu` VALUES ('39', '38', '订单列表', '', 'fa fa-adjust', 'store/order/index', '', '_self', '0', '1', '0', '2018-04-21 15:07:54');
INSERT INTO `system_menu` VALUES ('40', '32', '商城配置', '', '', '#', '', '_self', '0', '1', '0', '2018-04-21 15:08:17');
INSERT INTO `system_menu` VALUES ('41', '40', '参数管理', '', '', '#', '', '_self', '0', '0', '0', '2018-04-21 15:08:25');
INSERT INTO `system_menu` VALUES ('42', '40', '快递公司', '', 'fa fa-mixcloud', 'store/express/index', '', '_self', '0', '1', '0', '2018-04-21 15:08:50');
-- ----------------------------
-- Table structure for system_node
@ -299,87 +565,125 @@ CREATE TABLE `system_node` (
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `index_system_node_node` (`node`)
) ENGINE=InnoDB AUTO_INCREMENT=230 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='系统节点表';
) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=utf8 COMMENT='系统节点表';
-- ----------------------------
-- Records of system_node
-- ----------------------------
INSERT INTO `system_node` VALUES ('1', 'admin', '系统管理', '0', '1', '1', '2018-01-23 12:39:13');
INSERT INTO `system_node` VALUES ('2', 'admin/auth', '权限管理', '0', '1', '1', '2018-01-23 12:39:14');
INSERT INTO `system_node` VALUES ('3', 'admin/auth/index', '权限列表', '1', '1', '1', '2018-01-23 12:39:14');
INSERT INTO `system_node` VALUES ('4', 'admin/auth/apply', '访问授权', '0', '1', '1', '2018-01-23 12:39:19');
INSERT INTO `system_node` VALUES ('5', 'admin/auth/add', '添加权限', '0', '1', '1', '2018-01-23 12:39:22');
INSERT INTO `system_node` VALUES ('6', 'admin/auth/edit', '编辑权限', '0', '1', '1', '2018-01-23 12:39:23');
INSERT INTO `system_node` VALUES ('7', 'admin/auth/forbid', '禁用权限', '0', '1', '1', '2018-01-23 12:39:23');
INSERT INTO `system_node` VALUES ('8', 'admin/auth/resume', '启用权限', '0', '1', '1', '2018-01-23 12:39:24');
INSERT INTO `system_node` VALUES ('9', 'admin/auth/del', '删除权限', '0', '1', '1', '2018-01-23 12:39:25');
INSERT INTO `system_node` VALUES ('10', 'admin/config/index', '系统参数', '1', '1', '1', '2018-01-23 12:39:25');
INSERT INTO `system_node` VALUES ('11', 'admin/config/file', '文件存储', '0', '1', '1', '2018-01-23 12:39:26');
INSERT INTO `system_node` VALUES ('13', 'admin/log/index', '日志记录', '1', '1', '1', '2018-01-23 12:39:28');
INSERT INTO `system_node` VALUES ('14', 'admin/log/sms', '短信记录', '0', '1', '1', '2018-01-23 12:39:29');
INSERT INTO `system_node` VALUES ('15', 'admin/log/del', '日志删除', '0', '1', '1', '2018-01-23 12:39:29');
INSERT INTO `system_node` VALUES ('16', 'admin/menu/index', '系统菜单列表', '1', '1', '1', '2018-01-23 12:39:31');
INSERT INTO `system_node` VALUES ('17', 'admin/menu/add', '添加系统菜单', '0', '1', '1', '2018-01-23 12:39:31');
INSERT INTO `system_node` VALUES ('18', 'admin/menu/edit', '编辑系统菜单', '0', '1', '1', '2018-01-23 12:39:32');
INSERT INTO `system_node` VALUES ('19', 'admin/menu/del', '删除系统菜单', '0', '1', '1', '2018-01-23 12:39:33');
INSERT INTO `system_node` VALUES ('20', 'admin/menu/forbid', '禁用系统菜单', '0', '1', '1', '2018-01-23 12:39:33');
INSERT INTO `system_node` VALUES ('21', 'admin/menu/resume', '启用系统菜单', '0', '1', '1', '2018-01-23 12:39:34');
INSERT INTO `system_node` VALUES ('22', 'admin/node/index', '系统节点列表', '1', '1', '1', '2018-01-23 12:39:36');
INSERT INTO `system_node` VALUES ('23', 'admin/node/save', '保存节点信息', '0', '1', '1', '2018-01-23 12:39:36');
INSERT INTO `system_node` VALUES ('24', 'admin/user/index', '系统用户列表', '1', '1', '1', '2018-01-23 12:39:37');
INSERT INTO `system_node` VALUES ('25', 'admin/user/auth', '用户授权操作', '0', '1', '1', '2018-01-23 12:39:38');
INSERT INTO `system_node` VALUES ('26', 'admin/user/add', '添加系统用户', '0', '1', '1', '2018-01-23 12:39:39');
INSERT INTO `system_node` VALUES ('27', 'admin/user/edit', '编辑系统用户', '0', '1', '1', '2018-01-23 12:39:39');
INSERT INTO `system_node` VALUES ('28', 'admin/user/pass', '修改用户密码', '0', '1', '1', '2018-01-23 12:39:40');
INSERT INTO `system_node` VALUES ('29', 'admin/user/del', '删除系统用户', '0', '1', '1', '2018-01-23 12:39:41');
INSERT INTO `system_node` VALUES ('30', 'admin/user/forbid', '禁用系统用户', '0', '1', '1', '2018-01-23 12:39:41');
INSERT INTO `system_node` VALUES ('31', 'admin/user/resume', '启用系统用户', '0', '1', '1', '2018-01-23 12:39:42');
INSERT INTO `system_node` VALUES ('32', 'admin/config', '系统配置', '0', '1', '1', '2018-01-23 13:34:37');
INSERT INTO `system_node` VALUES ('33', 'admin/log', '日志管理', '0', '1', '1', '2018-01-23 13:34:48');
INSERT INTO `system_node` VALUES ('34', 'admin/menu', '系统菜单管理', '0', '1', '1', '2018-01-23 13:34:58');
INSERT INTO `system_node` VALUES ('35', 'admin/node', '系统节点管理', '0', '1', '1', '2018-01-23 13:35:17');
INSERT INTO `system_node` VALUES ('36', 'admin/user', '系统用户管理', '0', '1', '1', '2018-01-23 13:35:26');
INSERT INTO `system_node` VALUES ('37', 'wechat', '微信管理', '0', '1', '1', '2018-02-06 11:53:21');
INSERT INTO `system_node` VALUES ('38', 'wechat/config', '公众号对接', '0', '1', '1', '2018-02-06 11:53:32');
INSERT INTO `system_node` VALUES ('39', 'wechat/config/index', '公众号对接', '1', '1', '1', '2018-02-06 11:53:32');
INSERT INTO `system_node` VALUES ('45', 'wechat/block', '黑名单', '0', '1', '1', '2018-03-06 14:37:37');
INSERT INTO `system_node` VALUES ('46', 'wechat/block/index', '黑名单列表', '1', '1', '1', '2018-03-06 14:37:47');
INSERT INTO `system_node` VALUES ('47', 'wechat/block/backdel', '移出黑名单', '0', '1', '1', '2018-03-06 14:37:49');
INSERT INTO `system_node` VALUES ('48', 'wechat/fans', '粉丝管理', '0', '1', '1', '2018-03-06 14:38:06');
INSERT INTO `system_node` VALUES ('49', 'wechat/fans/index', '粉丝列表', '1', '1', '1', '2018-03-06 14:38:25');
INSERT INTO `system_node` VALUES ('50', 'wechat/fans/backadd', '移入黑名单', '0', '1', '1', '2018-03-06 14:38:35');
INSERT INTO `system_node` VALUES ('51', 'wechat/fans/tagset', '标签设置', '0', '1', '1', '2018-03-06 14:38:36');
INSERT INTO `system_node` VALUES ('52', 'wechat/fans/tagadd', '添加标签', '0', '1', '1', '2018-03-06 14:38:37');
INSERT INTO `system_node` VALUES ('53', 'wechat/fans/tagdel', '删除标签', '0', '1', '1', '2018-03-06 14:38:38');
INSERT INTO `system_node` VALUES ('54', 'wechat/fans/sync', '同步粉丝', '0', '1', '1', '2018-03-06 14:38:38');
INSERT INTO `system_node` VALUES ('55', 'wechat/keys', '关键字管理', '0', '1', '1', '2018-03-06 14:39:21');
INSERT INTO `system_node` VALUES ('56', 'wechat/keys/index', '关键字列表', '1', '1', '1', '2018-03-06 14:39:25');
INSERT INTO `system_node` VALUES ('57', 'wechat/keys/add', '添加关键字', '0', '1', '1', '2018-03-06 14:39:27');
INSERT INTO `system_node` VALUES ('58', 'wechat/keys/edit', '编辑关键字', '0', '1', '1', '2018-03-06 14:39:28');
INSERT INTO `system_node` VALUES ('59', 'wechat/keys/del', '删除关键字', '0', '1', '1', '2018-03-06 14:39:42');
INSERT INTO `system_node` VALUES ('60', 'wechat/keys/forbid', '禁用关键字', '0', '1', '1', '2018-03-06 14:39:55');
INSERT INTO `system_node` VALUES ('61', 'wechat/keys/resume', '启用关键字', '0', '1', '1', '2018-03-06 14:40:01');
INSERT INTO `system_node` VALUES ('62', 'wechat/keys/subscribe', '关注默认回复', '1', '1', '1', '2018-03-06 14:40:12');
INSERT INTO `system_node` VALUES ('63', 'wechat/keys/defaults', '无反馈默认回复', '1', '1', '1', '2018-03-06 14:40:27');
INSERT INTO `system_node` VALUES ('64', 'wechat/menu', '微信菜单管理', '0', '1', '1', '2018-03-06 14:40:37');
INSERT INTO `system_node` VALUES ('65', 'wechat/menu/index', '微信菜单管理', '1', '1', '1', '2018-03-06 14:40:41');
INSERT INTO `system_node` VALUES ('66', 'wechat/menu/edit', '编辑发布菜单', '0', '1', '1', '2018-03-06 14:40:53');
INSERT INTO `system_node` VALUES ('67', 'wechat/menu/cancel', '取消发布菜单', '0', '1', '1', '2018-03-06 14:41:01');
INSERT INTO `system_node` VALUES ('68', 'wechat/news', '图文内容管理', '0', '1', '1', '2018-03-06 14:41:13');
INSERT INTO `system_node` VALUES ('69', 'wechat/news/index', '图文内容管理', '1', '1', '1', '2018-03-06 14:41:20');
INSERT INTO `system_node` VALUES ('70', 'wechat/news/select', '图文选择器', '0', '1', '1', '2018-03-06 14:41:22');
INSERT INTO `system_node` VALUES ('71', 'wechat/news/image', '图文选择器', '0', '1', '1', '2018-03-06 14:41:22');
INSERT INTO `system_node` VALUES ('72', 'wechat/news/add', '添加图文', '0', '1', '1', '2018-03-06 14:41:23');
INSERT INTO `system_node` VALUES ('73', 'wechat/news/del', '删除图文', '0', '1', '1', '2018-03-06 14:41:23');
INSERT INTO `system_node` VALUES ('74', 'wechat/news/push', '推荐图文', '0', '1', '1', '2018-03-06 14:41:24');
INSERT INTO `system_node` VALUES ('75', 'wechat/news/edit', '编辑图文', '0', '1', '1', '2018-03-06 14:41:25');
INSERT INTO `system_node` VALUES ('76', 'wechat/tags', '标签管理', '0', '1', '1', '2018-03-06 14:42:06');
INSERT INTO `system_node` VALUES ('77', 'wechat/tags/index', '标签列表', '1', '1', '1', '2018-03-06 14:42:09');
INSERT INTO `system_node` VALUES ('78', 'wechat/tags/add', '添加标签', '0', '1', '1', '2018-03-06 14:42:14');
INSERT INTO `system_node` VALUES ('79', 'wechat/tags/edit', '编辑标签', '0', '1', '1', '2018-03-06 14:42:17');
INSERT INTO `system_node` VALUES ('80', 'wechat/tags/del', '删除标签', '0', '1', '1', '2018-03-06 14:42:20');
INSERT INTO `system_node` VALUES ('81', 'wechat/tags/sync', '同步标签', '0', '1', '1', '2018-03-06 14:42:23');
INSERT INTO `system_node` VALUES ('229', 'admin/node/clear', '清理无效记录', '0', '1', '1', '2018-03-09 12:24:31');
INSERT INTO `system_node` VALUES ('13', 'admin', '系统设置', '0', '1', '1', '2018-05-04 11:02:34');
INSERT INTO `system_node` VALUES ('14', 'admin/auth', '权限管理', '0', '1', '1', '2018-05-04 11:06:55');
INSERT INTO `system_node` VALUES ('15', 'admin/auth/index', '权限列表', '1', '1', '1', '2018-05-04 11:06:56');
INSERT INTO `system_node` VALUES ('16', 'admin/auth/apply', '权限配置', '0', '1', '1', '2018-05-04 11:06:56');
INSERT INTO `system_node` VALUES ('17', 'admin/auth/add', '添加权限', '0', '1', '1', '2018-05-04 11:06:56');
INSERT INTO `system_node` VALUES ('18', 'admin/auth/edit', '编辑权限', '0', '1', '1', '2018-05-04 11:06:56');
INSERT INTO `system_node` VALUES ('19', 'admin/auth/forbid', '禁用权限', '0', '1', '1', '2018-05-04 11:06:56');
INSERT INTO `system_node` VALUES ('20', 'admin/auth/resume', '启用权限', '0', '1', '1', '2018-05-04 11:06:56');
INSERT INTO `system_node` VALUES ('21', 'admin/auth/del', '删除权限', '0', '1', '1', '2018-05-04 11:06:56');
INSERT INTO `system_node` VALUES ('22', 'admin/config', '系统配置', '0', '1', '1', '2018-05-04 11:08:18');
INSERT INTO `system_node` VALUES ('23', 'admin/config/index', '系统参数', '1', '1', '1', '2018-05-04 11:08:25');
INSERT INTO `system_node` VALUES ('24', 'admin/config/file', '文件存储', '1', '1', '1', '2018-05-04 11:08:27');
INSERT INTO `system_node` VALUES ('25', 'admin/log', '日志管理', '0', '1', '1', '2018-05-04 11:08:43');
INSERT INTO `system_node` VALUES ('26', 'admin/log/index', '日志管理', '1', '1', '1', '2018-05-04 11:08:43');
INSERT INTO `system_node` VALUES ('28', 'admin/log/del', '日志删除', '0', '1', '1', '2018-05-04 11:08:43');
INSERT INTO `system_node` VALUES ('29', 'admin/menu', '系统菜单', '0', '1', '1', '2018-05-04 11:09:54');
INSERT INTO `system_node` VALUES ('30', 'admin/menu/index', '菜单列表', '1', '1', '1', '2018-05-04 11:09:54');
INSERT INTO `system_node` VALUES ('31', 'admin/menu/add', '添加菜单', '0', '1', '1', '2018-05-04 11:09:55');
INSERT INTO `system_node` VALUES ('32', 'admin/menu/edit', '编辑菜单', '0', '1', '1', '2018-05-04 11:09:55');
INSERT INTO `system_node` VALUES ('33', 'admin/menu/del', '删除菜单', '0', '1', '1', '2018-05-04 11:09:55');
INSERT INTO `system_node` VALUES ('34', 'admin/menu/forbid', '禁用菜单', '0', '1', '1', '2018-05-04 11:09:55');
INSERT INTO `system_node` VALUES ('35', 'admin/menu/resume', '启用菜单', '0', '1', '1', '2018-05-04 11:09:55');
INSERT INTO `system_node` VALUES ('36', 'admin/node', '节点管理', '0', '1', '1', '2018-05-04 11:10:20');
INSERT INTO `system_node` VALUES ('37', 'admin/node/index', '节点列表', '1', '1', '1', '2018-05-04 11:10:20');
INSERT INTO `system_node` VALUES ('38', 'admin/node/clear', '清理节点', '0', '1', '1', '2018-05-04 11:10:21');
INSERT INTO `system_node` VALUES ('39', 'admin/node/save', '更新节点', '0', '1', '1', '2018-05-04 11:10:21');
INSERT INTO `system_node` VALUES ('40', 'admin/user', '系统用户', '0', '1', '1', '2018-05-04 11:10:43');
INSERT INTO `system_node` VALUES ('41', 'admin/user/index', '用户列表', '1', '1', '1', '2018-05-04 11:10:43');
INSERT INTO `system_node` VALUES ('42', 'admin/user/auth', '用户授权', '0', '1', '1', '2018-05-04 11:10:43');
INSERT INTO `system_node` VALUES ('43', 'admin/user/add', '添加用户', '0', '1', '1', '2018-05-04 11:10:43');
INSERT INTO `system_node` VALUES ('44', 'admin/user/edit', '编辑用户', '0', '1', '1', '2018-05-04 11:10:43');
INSERT INTO `system_node` VALUES ('45', 'admin/user/pass', '修改密码', '0', '1', '1', '2018-05-04 11:10:43');
INSERT INTO `system_node` VALUES ('46', 'admin/user/del', '删除用户', '0', '1', '1', '2018-05-04 11:10:43');
INSERT INTO `system_node` VALUES ('47', 'admin/user/forbid', '禁用启用', '0', '1', '1', '2018-05-04 11:10:43');
INSERT INTO `system_node` VALUES ('48', 'admin/user/resume', '启用用户', '0', '1', '1', '2018-05-04 11:10:44');
INSERT INTO `system_node` VALUES ('49', 'store', '商城管理', '0', '1', '1', '2018-05-04 11:11:28');
INSERT INTO `system_node` VALUES ('50', 'store/express', '快递公司管理', '0', '1', '1', '2018-05-04 11:11:39');
INSERT INTO `system_node` VALUES ('51', 'store/express/index', '快递公司列表', '1', '1', '1', '2018-05-04 11:11:39');
INSERT INTO `system_node` VALUES ('52', 'store/express/add', '添加快递公司', '0', '1', '1', '2018-05-04 11:11:39');
INSERT INTO `system_node` VALUES ('53', 'store/express/edit', '编辑快递公司', '0', '1', '1', '2018-05-04 11:11:39');
INSERT INTO `system_node` VALUES ('54', 'store/express/del', '删除快递公司', '0', '1', '1', '2018-05-04 11:11:39');
INSERT INTO `system_node` VALUES ('55', 'store/express/forbid', '禁用快递公司', '0', '1', '1', '2018-05-04 11:11:39');
INSERT INTO `system_node` VALUES ('56', 'store/express/resume', '启用快递公司', '0', '1', '1', '2018-05-04 11:11:40');
INSERT INTO `system_node` VALUES ('57', 'store/order', '订单管理', '0', '1', '1', '2018-05-04 11:12:14');
INSERT INTO `system_node` VALUES ('58', 'store/order/index', '订单列表', '1', '1', '1', '2018-05-04 11:12:17');
INSERT INTO `system_node` VALUES ('59', 'store/order/address', '修改地址', '0', '1', '1', '2018-05-04 11:12:19');
INSERT INTO `system_node` VALUES ('76', 'wechat', '微信管理', '0', '1', '1', '2018-05-04 11:14:59');
INSERT INTO `system_node` VALUES ('78', 'wechat/config', '微信对接管理', '0', '1', '1', '2018-05-04 11:16:20');
INSERT INTO `system_node` VALUES ('79', 'wechat/config/index', '微信对接配置', '1', '1', '1', '2018-05-04 11:16:23');
INSERT INTO `system_node` VALUES ('80', 'wechat/fans', '微信粉丝管理', '0', '1', '1', '2018-05-04 11:16:31');
INSERT INTO `system_node` VALUES ('81', 'wechat/fans/index', '微信粉丝列表', '1', '1', '1', '2018-05-04 11:16:32');
INSERT INTO `system_node` VALUES ('82', 'wechat/fans/backadd', '微信粉丝拉黑', '0', '1', '1', '2018-05-04 11:16:32');
INSERT INTO `system_node` VALUES ('83', 'wechat/fans/tagset', '设置粉丝标签', '0', '1', '1', '2018-05-04 11:16:32');
INSERT INTO `system_node` VALUES ('84', 'wechat/fans/tagadd', '添加粉丝标签', '0', '1', '1', '2018-05-04 11:16:32');
INSERT INTO `system_node` VALUES ('85', 'wechat/fans/tagdel', '删除粉丝标签', '0', '1', '1', '2018-05-04 11:16:32');
INSERT INTO `system_node` VALUES ('86', 'wechat/fans/sync', '同步粉丝列表', '0', '1', '1', '2018-05-04 11:16:32');
INSERT INTO `system_node` VALUES ('87', 'wechat/fans_block', '粉丝黑名单管理', '0', '1', '1', '2018-05-04 11:17:25');
INSERT INTO `system_node` VALUES ('88', 'wechat/fans_block/index', '粉丝黑名单列表', '1', '1', '1', '2018-05-04 11:17:50');
INSERT INTO `system_node` VALUES ('89', 'wechat/fans_block/backdel', '移除粉丝黑名单', '0', '1', '1', '2018-05-04 11:17:51');
INSERT INTO `system_node` VALUES ('90', 'wechat/keys', '微信关键字', '0', '1', '1', '2018-05-04 11:18:09');
INSERT INTO `system_node` VALUES ('91', 'wechat/keys/index', '关键字列表', '1', '1', '1', '2018-05-04 11:18:09');
INSERT INTO `system_node` VALUES ('92', 'wechat/keys/add', '添加关键字', '0', '1', '1', '2018-05-04 11:18:09');
INSERT INTO `system_node` VALUES ('93', 'wechat/keys/edit', '编辑关键字', '0', '1', '1', '2018-05-04 11:18:09');
INSERT INTO `system_node` VALUES ('94', 'wechat/keys/del', '删除关键字', '0', '1', '1', '2018-05-04 11:18:09');
INSERT INTO `system_node` VALUES ('95', 'wechat/keys/forbid', '禁用关键字', '0', '1', '1', '2018-05-04 11:18:09');
INSERT INTO `system_node` VALUES ('96', 'wechat/keys/resume', '启用关键字', '0', '1', '1', '2018-05-04 11:18:09');
INSERT INTO `system_node` VALUES ('97', 'wechat/keys/subscribe', '关注回复', '1', '1', '1', '2018-05-04 11:18:09');
INSERT INTO `system_node` VALUES ('98', 'wechat/keys/defaults', '默认回复', '1', '1', '1', '2018-05-04 11:18:09');
INSERT INTO `system_node` VALUES ('99', 'wechat/menu', '微信菜单管理', '0', '1', '1', '2018-05-04 11:18:57');
INSERT INTO `system_node` VALUES ('100', 'wechat/menu/index', '微信菜单展示', '1', '1', '1', '2018-05-04 11:19:10');
INSERT INTO `system_node` VALUES ('101', 'wechat/menu/edit', '编辑微信菜单', '0', '1', '1', '2018-05-04 11:19:22');
INSERT INTO `system_node` VALUES ('102', 'wechat/menu/cancel', '取消微信菜单', '0', '1', '1', '2018-05-04 11:19:26');
INSERT INTO `system_node` VALUES ('103', 'wechat/news/index', '微信图文列表', '1', '1', '1', '2018-05-04 11:19:28');
INSERT INTO `system_node` VALUES ('104', 'wechat/news/select', '微信图文选择', '0', '1', '1', '2018-05-04 11:19:28');
INSERT INTO `system_node` VALUES ('105', 'wechat/news/image', '微信图片选择', '0', '1', '1', '2018-05-04 11:19:28');
INSERT INTO `system_node` VALUES ('106', 'wechat/news/add', '添加微信图文', '0', '1', '1', '2018-05-04 11:19:28');
INSERT INTO `system_node` VALUES ('107', 'wechat/news/edit', '编辑微信图文', '0', '1', '1', '2018-05-04 11:19:28');
INSERT INTO `system_node` VALUES ('108', 'wechat/news/del', '删除微信图文', '0', '1', '1', '2018-05-04 11:19:28');
INSERT INTO `system_node` VALUES ('109', 'wechat/news/push', '推送微信图文', '0', '1', '1', '2018-05-04 11:19:28');
INSERT INTO `system_node` VALUES ('110', 'wechat/news', '微信图文管理', '0', '1', '1', '2018-05-04 11:19:35');
INSERT INTO `system_node` VALUES ('111', 'wechat/tags', '微信粉丝标签管理', '0', '1', '1', '2018-05-04 11:20:28');
INSERT INTO `system_node` VALUES ('112', 'wechat/tags/index', '粉丝标签列表', '1', '1', '1', '2018-05-04 11:20:28');
INSERT INTO `system_node` VALUES ('113', 'wechat/tags/add', '添加粉丝标签', '0', '1', '1', '2018-05-04 11:20:28');
INSERT INTO `system_node` VALUES ('114', 'wechat/tags/edit', '编辑粉丝标签', '0', '1', '1', '2018-05-04 11:20:29');
INSERT INTO `system_node` VALUES ('115', 'wechat/tags/del', '删除粉丝标签', '0', '1', '1', '2018-05-04 11:20:29');
INSERT INTO `system_node` VALUES ('116', 'wechat/tags/sync', '同步粉丝标签', '0', '1', '1', '2018-05-04 11:20:29');
INSERT INTO `system_node` VALUES ('117', 'store/goods', '商品管理', '0', '1', '1', '2018-05-04 11:29:55');
INSERT INTO `system_node` VALUES ('118', 'store/goods/index', '商品列表', '1', '1', '1', '2018-05-04 11:29:56');
INSERT INTO `system_node` VALUES ('119', 'store/goods/add', '添加商品', '0', '1', '1', '2018-05-04 11:29:56');
INSERT INTO `system_node` VALUES ('120', 'store/goods/edit', '编辑商品', '0', '1', '1', '2018-05-04 11:29:56');
INSERT INTO `system_node` VALUES ('121', 'store/goods/del', '删除商品', '0', '1', '1', '2018-05-04 11:29:56');
INSERT INTO `system_node` VALUES ('122', 'store/goods/forbid', '下架商品', '0', '1', '1', '2018-05-04 11:29:56');
INSERT INTO `system_node` VALUES ('123', 'store/goods/resume', '上架商品', '0', '1', '1', '2018-05-04 11:29:57');
INSERT INTO `system_node` VALUES ('124', 'store/goods_brand', '商品品牌管理', '0', '1', '1', '2018-05-04 11:30:44');
INSERT INTO `system_node` VALUES ('125', 'store/goods_brand/index', '商品品牌列表', '1', '1', '1', '2018-05-04 11:30:52');
INSERT INTO `system_node` VALUES ('126', 'store/goods_brand/add', '添加商品品牌', '0', '1', '1', '2018-05-04 11:30:55');
INSERT INTO `system_node` VALUES ('127', 'store/goods_brand/edit', '编辑商品品牌', '0', '1', '1', '2018-05-04 11:30:56');
INSERT INTO `system_node` VALUES ('128', 'store/goods_brand/del', '删除商品品牌', '0', '1', '1', '2018-05-04 11:30:56');
INSERT INTO `system_node` VALUES ('129', 'store/goods_brand/forbid', '禁用商品品牌', '0', '1', '1', '2018-05-04 11:30:56');
INSERT INTO `system_node` VALUES ('130', 'store/goods_brand/resume', '启用商品品牌', '0', '1', '1', '2018-05-04 11:30:56');
INSERT INTO `system_node` VALUES ('131', 'store/goods_cate', '商品分类管理', '0', '1', '1', '2018-05-04 11:31:19');
INSERT INTO `system_node` VALUES ('132', 'store/goods_cate/index', '商品分类列表', '1', '1', '1', '2018-05-04 11:31:23');
INSERT INTO `system_node` VALUES ('133', 'store/goods_cate/add', '添加商品分类', '0', '1', '1', '2018-05-04 11:31:23');
INSERT INTO `system_node` VALUES ('134', 'store/goods_cate/edit', '编辑商品分类', '0', '1', '1', '2018-05-04 11:31:23');
INSERT INTO `system_node` VALUES ('135', 'store/goods_cate/del', '删除商品分类', '0', '1', '1', '2018-05-04 11:31:24');
INSERT INTO `system_node` VALUES ('136', 'store/goods_cate/forbid', '禁用商品分类', '0', '1', '1', '2018-05-04 11:31:24');
INSERT INTO `system_node` VALUES ('137', 'store/goods_cate/resume', '启用商品分类', '0', '1', '1', '2018-05-04 11:31:24');
INSERT INTO `system_node` VALUES ('138', 'store/goods_spec', '商品规格管理', '0', '1', '1', '2018-05-04 11:31:47');
INSERT INTO `system_node` VALUES ('139', 'store/goods_spec/index', '商品规格列表', '1', '1', '1', '2018-05-04 11:31:47');
INSERT INTO `system_node` VALUES ('140', 'store/goods_spec/add', '添加商品规格', '0', '1', '1', '2018-05-04 11:31:47');
INSERT INTO `system_node` VALUES ('141', 'store/goods_spec/edit', '编辑商品规格', '0', '1', '1', '2018-05-04 11:31:48');
INSERT INTO `system_node` VALUES ('142', 'store/goods_spec/del', '删除商品规格', '0', '1', '1', '2018-05-04 11:31:48');
INSERT INTO `system_node` VALUES ('143', 'store/goods_spec/forbid', '禁用商品规格', '0', '1', '1', '2018-05-04 11:31:48');
INSERT INTO `system_node` VALUES ('144', 'store/goods_spec/resume', '启用商品规格', '0', '1', '1', '2018-05-04 11:31:48');
-- ----------------------------
-- Table structure for system_sequence
@ -426,7 +730,7 @@ CREATE TABLE `system_user` (
-- ----------------------------
-- Records of system_user
-- ----------------------------
INSERT INTO `system_user` VALUES ('10000', 'admin', '21232f297a57a5a743894a0e4a801fc3', '22222222', '', '18993368867', '', '23296', '2018-03-23 17:05:40', '1', '2,4', '0', null, '2015-11-13 15:14:22');
INSERT INTO `system_user` VALUES ('10000', 'admin', '21232f297a57a5a743894a0e4a801fc3', '22222222', '', '', '', '22973', '2018-03-26 17:06:48', '1', '2,4', '0', null, '2015-11-13 15:14:22');
-- ----------------------------
-- Table structure for wechat_fans
@ -620,6 +924,24 @@ CREATE TABLE `wechat_news_media` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信素材表';
-- ----------------------------
-- Table structure for store_goods_stock
-- ----------------------------
DROP TABLE IF EXISTS `store_goods_stock`;
CREATE TABLE `store_goods_stock` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`goods_id` bigint(20) unsigned DEFAULT '0' COMMENT '商品ID',
`goods_spec` varchar(255) DEFAULT '' COMMENT '商品属性',
`goods_stock` bigint(20) unsigned DEFAULT '0' COMMENT '商品库存',
`stock_desc` varchar(255) DEFAULT '' COMMENT '商品库存描述',
`sort` bigint(20) unsigned DEFAULT '0' COMMENT '数据排序',
`status` bigint(1) unsigned DEFAULT '1' COMMENT '商品状态(1有效,0无效)',
`is_deleted` bigint(1) unsigned DEFAULT '0' COMMENT '删除状态(1删除,0未删除)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 COMMENT='商城商品库存';
-- ----------------------------
-- Records of wechat_news_media
-- ----------------------------

View File

@ -65,7 +65,7 @@ class Index extends BasicAdmin
continue;
} elseif ($menu['url'] !== '#') {
$node = join('/', array_slice(explode('/', preg_replace('/[\W]/', '/', $menu['url'])), 0, 3));
$menu['url'] = url($menu['url']);
$menu['url'] = url($menu['url']) . (empty($menu['params']) ? '' : "?{$menu['params']}");
if (isset($nodes[$node]) && $nodes[$node]['is_login'] && empty($isLogin)) {
unset($menus[$key]);
} elseif (isset($nodes[$node]) && $nodes[$node]['is_auth'] && $isLogin && !auth($node)) {

View File

@ -75,30 +75,6 @@ class Log extends BasicAdmin
}
}
/**
* 短信发送记录
* @return array|string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function sms()
{
// 日志数据库对象
$this->title = '短信发送日志';
$get = $this->request->get();
$db = Db::name('MemberSmsHistory');
foreach (['phone', 'content', 'result'] as $key) {
(isset($get[$key]) && $get[$key] !== '') && $db->whereLike($key, "%{$get[$key]}%");
}
if (isset($get['date']) && $get['date'] !== '') {
list($start, $end) = explode(' - ', $get['date']);
$db->whereBetween('create_at', ["{$start} 00:00:00", "{$end} 23:59:59"]);
}
return parent::_list($db->order('id desc'));
}
/**
* 日志删除操作
* @throws \think\Exception

View File

@ -64,7 +64,7 @@ class Login extends BasicAdmin
($user['password'] !== md5($password)) && $this->error('登录密码与账号不匹配,请重新输入!');
empty($user['status']) && $this->error('账号已经被禁用,请联系管理!');
// 更新登录信息
$data = ['login_at' => ['exp', 'now()'], 'login_num' => ['exp', 'login_num+1']];
$data = ['login_at' => Db::raw('now()'), 'login_num' => Db::raw('login_num+1')];
Db::name('SystemUser')->where(['id' => $user['id']])->update($data);
session('user', $user);
!empty($user['authorize']) && NodeService::applyAuthNode();

View File

@ -58,7 +58,9 @@ class Menu extends BasicAdmin
protected function _index_data_filter(&$data)
{
foreach ($data as &$vo) {
($vo['url'] !== '#') && ($vo['url'] = url($vo['url']));
if ($vo['url'] !== '#') {
$vo['url'] = url($vo['url']) . (empty($vo['params']) ? '' : "?{$vo['params']}");
}
$vo['ids'] = join(',', ToolsService::getArrSubIds($data, $vo['id']));
}
$data = ToolsService::arr2table($data);

View File

@ -43,7 +43,15 @@ class Node extends BasicAdmin
public function index()
{
$nodes = ToolsService::arr2table(NodeService::get(), 'node', 'pnode');
return $this->fetch('', ['title' => '系统节点管理', 'nodes' => $nodes]);
$groups = [];
foreach ($nodes as $node) {
$pnode = explode('/', $node['node'])[0];
if ($node['node'] === $pnode) {
$groups[$pnode]['node'] = $node;
}
$groups[$pnode]['list'][] = $node;
}
return $this->fetch('', ['title' => '系统节点管理', 'nodes' => $nodes, 'groups' => $groups]);
}
/**

View File

@ -133,6 +133,8 @@ class User extends BasicAdmin
if ($this->request->isPost()) {
if (isset($data['authorize']) && is_array($data['authorize'])) {
$data['authorize'] = join(',', $data['authorize']);
} else {
$data['authorize'] = '';
}
if (isset($data['id'])) {
unset($data['username']);

View File

@ -2,10 +2,11 @@
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("$classuri/add")}' data-title="添加权限" class='layui-btn layui-btn-sm'>添加权限</button>
<button data-modal='{:url("$classuri/add")}' data-title="添加权限" class='layui-btn layui-btn-sm layui-btn-primary'>添加权限</button>
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除权限</button>
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除权限</button>
<!--{/if}-->
{/block}

View File

@ -55,7 +55,7 @@
<img data-tips-image style="height:auto;max-height:32px;min-width:32px" src="{:sysconf('browser_icon')}"/>
<input type="hidden" name="browser_icon" onchange="$(this).prev('img').attr('src', this.value)" value="{:sysconf('browser_icon')}" class="layui-input">
<a class="btn btn-link" data-file="one" data-uptype="local" data-type="ico,png" data-field="browser_icon">上传图片</a>
<p class="help-block">建议上传ICO图标的尺寸为128x128px此图标用于网站标题前ICON在线制作</p>
<p class="help-block">建议上传ICO图标的尺寸为128x128px此图标用于网站标题前<a href="http://www.favicon-icon-generator.com/" target="_blank">ICON在线制作</a></p>
</div>
</div>

View File

@ -2,7 +2,7 @@
{block name="button"}
<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除日志</button>
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除日志</button>
<!--{/if}-->
{/block}

View File

@ -12,6 +12,7 @@
<!--{/eq}-->
<!--{/foreach}-->
</select>
<p class="help-block color-desc"><b>必填</b>,请选择上级菜单或顶级菜单(目前最多支持三级菜单)</p>
</div>
</div>
@ -19,6 +20,7 @@
<label class="layui-form-label">菜单名称</label>
<div class="layui-input-block">
<input type="text" name="title" value='{$vo.title|default=""}' required="required" title="请输入菜单名称" placeholder="请输入菜单名称" class="layui-input">
<p class="help-block color-desc"><b>必填</b>请填写菜单名称系统管理建议字符不要太长一般4-6个汉字</p>
</div>
</div>
@ -26,18 +28,33 @@
<label class="layui-form-label">菜单链接</label>
<div class="layui-input-block">
<input type="text" onblur="(this.value === '') && (this.value = '#')" name="url" autocomplete="off" required="required" title="请输入菜单链接" placeholder="请输入菜单链接" value="{$vo.url|default='#'}" class="layui-input typeahead">
<p class="help-block color-desc">
<b>必填</b>请填写系统节点admin/user/index节点加入权限管理时菜单才会自动隐藏非规则内的不会隐藏
<br>正常情况下,在输入的时候会有自动提示。如果是上级菜单时,请填写"#"符号,不要填写地址或节点地址
</p>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">链接参数</label>
<div class="layui-input-block">
<input type="text" name="params" autocomplete="off" title="请输入链接参数" placeholder="请输入链接参数" value="{$vo.params|default=''}" class="layui-input">
<p class="help-block color-desc"><b>可选</b>设置菜单链接的GET访问参数name=1&age=3</p>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">菜单图标</label>
<div class="layui-input-inline" style='width:300px'>
<input placeholder="请输入或选择图标" onchange="$('#icon-preview').get(0).className = this.value" type="text" name="icon" value='{$vo.icon|default=""}' class="layui-input">
</div>
<span class='layui-btn layui-btn-primary' style='padding:0 12px;min-width:45px'>
<div class="layui-input-block">
<div class="layui-input-inline" style='width:300px'>
<input placeholder="请输入或选择图标" onchange="$('#icon-preview').get(0).className = this.value" type="text" name="icon" value='{$vo.icon|default=""}' class="layui-input">
</div>
<span class='layui-btn layui-btn-primary' style='padding:0 12px;min-width:45px'>
<i id='icon-preview' style='font-size:1.2em' class='{$vo.icon|default=""}'></i>
</span>
<button data-icon='icon' type='button' class='layui-btn layui-btn-primary'>选择图标</button>
<button data-icon='icon' type='button' class='layui-btn layui-btn-primary'>选择图标</button>
<p class="help-block color-desc"><b>可选</b>,设置菜单选项前置图标,目前只支持 Font Awesome 4.7.0 字体图标</p>
</div>
</div>
<div class="hr-line-dashed"></div>

View File

@ -2,10 +2,10 @@
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("$classuri/add")}' data-title="添加菜单" class='layui-btn layui-btn-sm'>添加菜单</button>
<button data-modal='{:url("$classuri/add")}' data-title="添加菜单" class='layui-btn layui-btn-sm layui-btn-primary'>添加菜单</button>
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除菜单</button>
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除菜单</button>
<!--{/if}-->
{/block}

View File

@ -2,14 +2,12 @@
{block name='button'}
<!--{if auth("$classuri/clear")}-->
<button data-load='{:url("$classuri/clear")}' class='layui-btn layui-btn-sm layui-btn-danger'>清理无效记录</button>
<button data-load='{:url("$classuri/clear")}' class='layui-btn layui-btn-sm layui-btn-primary'>清理无效记录</button>
<!--{/if}-->
{/block}
{block name="content"}
<!--data-tips-text="勾选后需配置用户权限后才能访问"-->
<!--data-tips-text="勾选后需要登录后才能访问"-->
<!--data-tips-text="勾选后配置菜单时节点可自动选择"-->
<style>
.layui-table .title-input {
width: auto;
@ -21,65 +19,84 @@
cursor: pointer
}
</style>
<table class="layui-table border-none" lay-skin="line">
<!--{empty name='nodes'}-->
<p class="help-block text-center well">没 有 记 录 哦!</p>
<!--{else}-->
<!--{foreach $nodes as $key=>$vo}-->
<tr>
<td class='text-left nowrap'>
<span class="color-desc">{$vo.spl|raw}</span> {$vo.node}
{if auth("$classuri/save")}&nbsp;<input class='layui-input layui-input-inline title-input' name='title' data-node="{$vo.node}" value="{$vo.title}">{/if}
</td>
<td class='text-left nowrap'>
{if auth("$classuri/save") and $vo.spt eq 1}
<label class="color-desc">
<input data-login-group="{$vo.node}" type="checkbox"> 全部加入登录控制
</label>
&nbsp;&nbsp;&nbsp;&nbsp;
<label class="notselect margin-left-15 color-desc">
<input data-auth-group="{$vo.node}" type="checkbox"> 全部加入权限控制
</label>
&nbsp;&nbsp;&nbsp;&nbsp;
<label class="notselect margin-left-15 color-desc">
<input data-menu-group="{$vo.node}" type="checkbox"> 全部加入菜单节点选择器
</label>
{/if}
{if auth("$classuri/save") and $vo.spt eq 2}
<span class="color-desc">&nbsp;&nbsp;├─&nbsp;</span>
<label class="notselect margin-right-15">
<!--{notempty name='vo.is_login'}-->
<input data-login-filter="{$vo.pnode}" checked='checked' class="check-box login_{$key}" type='checkbox' value='1' name='is_login' data-node="{$vo.node}" onclick="!this.checked && ($('.auth_{$key}')[0].checked = !!this.checked)">
<script>
$(function () {
$('.layui-tab ul.layui-tab-title li:first').trigger('click');
});
</script>
<div class="layui-tab layui-tab-card layui-box">
<ul class="layui-tab-title">
<!--{foreach $groups as $key=>$group}-->
<li>{$group.node.title|default='<span class="color-desc">未配置名称</span>'|raw}{$key}</li>
<!--{/foreach}-->
</ul>
<div class="layui-tab-content">
{foreach $groups as $key=>$group}
<div class="layui-tab-item">
<table class="layui-table border-none" lay-skin="line">
<!--{empty name='nodes'}-->
<p class="help-block text-center well">没 有 记 录 哦!</p>
<!--{else}-->
<input data-login-filter="{$vo.pnode}" class="check-box login_{$key}" type='checkbox' value='1' name='is_login' data-node="{$vo.node}" onclick="!this.checked && ($('.auth_{$key}')[0].checked = !!this.checked)">
<!--{/notempty}-->
加入登录控制
</label>
<span class="color-desc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─&nbsp;</span>
<label class="notselect margin-right-15">
<!--{notempty name='vo.is_auth'}-->
<input data-auth-filter="{$vo.pnode}" name='is_auth' data-node="{$vo.node}" checked='checked' class="check-box auth_{$key}" type='checkbox' onclick="this.checked && ($('.login_{$key}')[0].checked = !!this.checked)" value='1'>
<!--{else}-->
<input data-auth-filter="{$vo.pnode}" name='is_auth' data-node="{$vo.node}" class="check-box auth_{$key}" type='checkbox' value='1' onclick="this.checked && ($('.login_{$key}')[0].checked = !!this.checked)">
<!--{/notempty}-->
加入权限控制
</label>
<span class="color-desc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─&nbsp;</span>
<label class="notselect">
<!--{notempty name='vo.is_menu'}-->
<input data-menu-filter="{$vo.pnode}" name='is_menu' data-node="{$vo.node}" checked='checked' class='check-box menu_{$key}' type='checkbox' value='1'>
<!--{else}-->
<input data-menu-filter="{$vo.pnode}" name='is_menu' data-node="{$vo.node}" class='check-box menu_{$key}' type='checkbox' value='1'>
<!--{/notempty}-->
加入菜单节点选择器
</label>
{/if}
</td>
<td data-tips-filter="{$vo.pnode}" class="loading-tips nowrap full-width"></td>
</tr>
<!--{/foreach}-->
<!--{/empty}-->
</table>
<!--{foreach $group.list as $key=>$vo}-->
<tr>
<td class='text-left nowrap'>
<span class="color-desc">{$vo.spl|raw}</span> {$vo.node}
{if auth("$classuri/save")}&nbsp;<input class='layui-input layui-input-inline title-input' name='title' data-node="{$vo.node}" value="{$vo.title}">{/if}
</td>
<td class='text-left nowrap'>
{if auth("$classuri/save") and $vo.spt eq 1}
<label class="color-desc">
<input data-login-group="{$vo.node}" type="checkbox"> 全部加入登录控制
</label>
&nbsp;&nbsp;&nbsp;&nbsp;
<label class="notselect margin-left-15 color-desc">
<input data-auth-group="{$vo.node}" type="checkbox"> 全部加入权限控制
</label>
&nbsp;&nbsp;&nbsp;&nbsp;
<label class="notselect margin-left-15 color-desc">
<input data-menu-group="{$vo.node}" type="checkbox"> 全部加入菜单节点选择器
</label>
{/if}
{if auth("$classuri/save") and $vo.spt eq 2}
<span class="color-desc">&nbsp;&nbsp;├─&nbsp;</span>
<label class="notselect margin-right-15">
<!--{notempty name='vo.is_login'}-->
<input data-login-filter="{$vo.pnode}" checked='checked' class="check-box login_{$key}" type='checkbox' value='1' name='is_login' data-node="{$vo.node}" onclick="!this.checked && ($('.auth_{$key}')[0].checked = !!this.checked)">
<!--{else}-->
<input data-login-filter="{$vo.pnode}" class="check-box login_{$key}" type='checkbox' value='1' name='is_login' data-node="{$vo.node}" onclick="!this.checked && ($('.auth_{$key}')[0].checked = !!this.checked)">
<!--{/notempty}-->
加入登录控制
</label>
<span class="color-desc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─&nbsp;</span>
<label class="notselect margin-right-15">
<!--{notempty name='vo.is_auth'}-->
<input data-auth-filter="{$vo.pnode}" name='is_auth' data-node="{$vo.node}" checked='checked' class="check-box auth_{$key}" type='checkbox' onclick="this.checked && ($('.login_{$key}')[0].checked = !!this.checked)" value='1'>
<!--{else}-->
<input data-auth-filter="{$vo.pnode}" name='is_auth' data-node="{$vo.node}" class="check-box auth_{$key}" type='checkbox' value='1' onclick="this.checked && ($('.login_{$key}')[0].checked = !!this.checked)">
<!--{/notempty}-->
加入权限控制
</label>
<span class="color-desc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─&nbsp;</span>
<label class="notselect">
<!--{notempty name='vo.is_menu'}-->
<input data-menu-filter="{$vo.pnode}" name='is_menu' data-node="{$vo.node}" checked='checked' class='check-box menu_{$key}' type='checkbox' value='1'>
<!--{else}-->
<input data-menu-filter="{$vo.pnode}" name='is_menu' data-node="{$vo.node}" class='check-box menu_{$key}' type='checkbox' value='1'>
<!--{/notempty}-->
加入菜单节点选择器
</label>
{/if}
</td>
<td data-tips-filter="{$vo.pnode}" class="loading-tips nowrap full-width"></td>
</tr>
<!--{/foreach}-->
<!--{/empty}-->
</table>
</div>
{/foreach}
</div>
</div>
<!--{if auth("$classuri/save")}-->
<script>
$(function () {

View File

@ -2,10 +2,11 @@
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("$classuri/add")}' data-title="添加用户" class='layui-btn layui-btn-sm'>添加用户</button>
<button data-modal='{:url("$classuri/add")}' data-title="添加用户" class='layui-btn layui-btn-sm layui-btn-primary'>添加用户</button>
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除用户</button>
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除用户</button>
<!--{/if}-->
{/block}
@ -87,9 +88,7 @@
<td class='text-left nowrap'>
{$vo.mail|default="<span class='color-desc'>还没有设置邮箱</span>"|raw}
</td>
<td class='text-left nowrap'>
{$vo.login_num|default="<span class='color-desc'>从未登录</span>"|raw}
</td>
<td class='text-left nowrap'>{$vo.login_num|default=0}</td>
<td class='text-left nowrap'>
{$vo.login_at|format_datetime|default="<span class='color-desc'>从未登录</span>"|raw}
</td>

View File

@ -27,5 +27,4 @@ class Index extends Controller
{
$this->redirect('@admin/login');
}
}

View File

@ -0,0 +1,126 @@
<?php
// +----------------------------------------------------------------------
// | Think.Admin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/Think.Admin
// +----------------------------------------------------------------------
namespace app\store\controller;
use controller\BasicAdmin;
use service\DataService;
use think\Db;
/**
* 商城快递公司管理
* Class Express
* @package app\store\controller
* @author Anyon <zoujingli@qq.com>
* @date 2017/03/27 14:43
*/
class Express extends BasicAdmin
{
/**
* 定义当前操作表名
* @var string
*/
public $table = 'StoreExpress';
/**
* 快递公司列表
* @return array|string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function index()
{
$this->title = '快递公司管理';
list($get, $db) = [$this->request->get(), Db::name($this->table)];
foreach (['express_title', 'express_code'] as $field) {
(isset($get[$field]) && $get[$field] !== '') && $db->whereLike($field, "%{$get[$field]}%");
}
if (isset($get['date']) && $get['date'] !== '') {
list($start, $end) = explode(' - ', $get['date']);
$db->whereBetween('create_at', ["{$start} 00:00:00", "{$end} 23:59:59"]);
}
return parent::_list($db->where(['is_deleted' => '0'])->order('status desc,sort asc,id desc'));
}
/**
* 添加快递公司
* @return array|string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function add()
{
$this->title = '添加快递公司';
return $this->_form($this->table, 'form');
}
/**
* 编辑快递公司
* @return array|string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function edit()
{
$this->title = '编辑快递公司';
return $this->_form($this->table, 'form');
}
/**
* 删除快递公司
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function del()
{
if (DataService::update($this->table)) {
$this->success("快递公司删除成功!", '');
}
$this->error("快递公司删除失败,请稍候再试!");
}
/**
* 快递公司禁用
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function forbid()
{
if (DataService::update($this->table)) {
$this->success("快递公司禁用成功!", '');
}
$this->error("快递公司禁用失败,请稍候再试!");
}
/**
* 快递公司禁用
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function resume()
{
if (DataService::update($this->table)) {
$this->success("快递公司启用成功!", '');
}
$this->error("快递公司启用失败,请稍候再试!");
}
}

View File

@ -12,9 +12,9 @@
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\goods\controller;
namespace app\store\controller;
use app\goods\service\ProductService;
use app\store\service\GoodsService;
use controller\BasicAdmin;
use service\DataService;
use service\ToolsService;
@ -22,23 +22,23 @@ use think\Db;
use think\exception\HttpResponseException;
/**
* 商店品管理
* 商店品管理
* Class Goods
* @package app\store\controller
* @author Anyon <zoujingli@qq.com>
* @date 2017/03/27 14:43
*/
class Product extends BasicAdmin
class Goods extends BasicAdmin
{
/**
* 定义当前操作表名
* @var string
*/
public $table = 'Goods';
public $table = 'StoreGoods';
/**
* 普通
* 普通
* @return array|string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
@ -47,11 +47,14 @@ class Product extends BasicAdmin
*/
public function index()
{
$this->title = '品管理';
$this->title = '品管理';
$get = $this->request->get();
$db = Db::name($this->table)->where(['is_deleted' => '0']);
foreach (['tags_id', 'goods_title'] as $field) {
(isset($get[$field]) && $get[$field] !== '') && $db->whereLike($field, "%,{$get[$field]},%");
if (isset($get['tags_id']) && $get['tags_id'] !== '') {
$db->whereLike('tags_id', "%,{$get['tags_id']},%");
}
if (isset($get['goods_title']) && $get['goods_title'] !== '') {
$db->whereLike('goods_title', "%{$get['goods_title']}%");
}
foreach (['cate_id', 'brand_id'] as $field) {
(isset($get[$field]) && $get[$field] !== '') && $db->where($field, $get[$field]);
@ -69,7 +72,7 @@ class Product extends BasicAdmin
*/
protected function _data_filter(&$data)
{
$result = ProductService::buildGoodsList($data);
$result = GoodsService::buildGoodsList($data);
$this->assign([
'brands' => $result['brand'],
'cates' => ToolsService::arr2table($result['cate']),
@ -77,7 +80,7 @@ class Product extends BasicAdmin
}
/**
* 添加
* 添加
* @return array|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
@ -86,8 +89,8 @@ class Product extends BasicAdmin
*/
public function add()
{
if (!$this->request->isPost()) {
$this->title = '添加品';
if ($this->request->isGet()) {
$this->title = '添加品';
$this->_form_assign();
return $this->_form($this->table, 'form');
}
@ -98,19 +101,19 @@ class Product extends BasicAdmin
foreach ($data['list'] as &$vo) {
$vo['goods_id'] = $goodsID;
}
Db::name('GoodsList')->insertAll($data['list']);
Db::name('StoreGoodsList')->insertAll($data['list']);
});
} catch (HttpResponseException $exception) {
return $exception->getResponse();
} catch (\Exception $e) {
$this->error('品添加失败,请稍候再试!');
$this->error('品添加失败,请稍候再试!');
}
list($base, $spm, $url) = [url('@admin'), $this->request->get('spm'), url('goods/product/index')];
$this->success('添加品成功!', "{$base}#{$url}?spm={$spm}");
list($base, $spm, $url) = [url('@admin'), $this->request->get('spm'), url('store/goods/index')];
$this->success('添加品成功!', "{$base}#{$url}?spm={$spm}");
}
/**
* 编辑
* 编辑
* @return array|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
@ -121,34 +124,34 @@ class Product extends BasicAdmin
if (!$this->request->isPost()) {
$goods_id = $this->request->get('id');
$goods = Db::name($this->table)->where(['id' => $goods_id, 'is_deleted' => '0'])->find();
empty($goods) && $this->error('需要编辑的品不存在!');
$goods['list'] = Db::name('GoodsList')->where(['goods_id' => $goods_id, 'is_deleted' => '0'])->select();
empty($goods) && $this->error('需要编辑的品不存在!');
$goods['list'] = Db::name('StoreGoodsList')->where(['goods_id' => $goods_id, 'is_deleted' => '0'])->select();
$this->_form_assign();
return $this->fetch('form', ['vo' => $goods, 'title' => '编辑品']);
return $this->fetch('form', ['vo' => $goods, 'title' => '编辑品']);
}
try {
$data = $this->_form_build_data();
$goods_id = $this->request->post('id');
$goods = Db::name($this->table)->where(['id' => $goods_id, 'is_deleted' => '0'])->find();
empty($goods) && $this->error('品编辑失败,请稍候再试!');
empty($goods) && $this->error('品编辑失败,请稍候再试!');
foreach ($data['list'] as &$vo) {
$vo['goods_id'] = $goods_id;
}
Db::transaction(function () use ($data, $goods_id, $goods) {
// 更新品主表
// 更新品主表
$where = ['id' => $goods_id, 'is_deleted' => '0'];
Db::name('Goods')->where($where)->update(array_merge($goods, $data['main']));
// 更新品详细
Db::name('GoodsList')->where(['goods_id' => $goods_id])->delete();
Db::name('GoodsList')->insertAll($data['list']);
Db::name('StoreGoods')->where($where)->update(array_merge($goods, $data['main']));
// 更新品详细
Db::name('StoreGoodsList')->where(['goods_id' => $goods_id])->delete();
Db::name('StoreGoodsList')->insertAll($data['list']);
});
} catch (HttpResponseException $exception) {
return $exception->getResponse();
} catch (\Exception $e) {
$this->error('品编辑失败,请稍候再试!' . $e->getMessage());
$this->error('品编辑失败,请稍候再试!' . $e->getMessage());
}
list($base, $spm, $url) = [url('@admin'), $this->request->get('spm'), url('goods/product/index')];
$this->success('品编辑成功!', "{$base}#{$url}?spm={$spm}");
list($base, $spm, $url) = [url('@admin'), $this->request->get('spm'), url('store/goods/index')];
$this->success('品编辑成功!', "{$base}#{$url}?spm={$spm}");
}
/**
@ -160,14 +163,14 @@ class Product extends BasicAdmin
protected function _form_assign()
{
list($where, $order) = [['status' => '1', 'is_deleted' => '0'], 'sort asc,id desc'];
$specs = (array)Db::name('GoodsSpec')->where($where)->order($order)->select();
$brands = (array)Db::name('GoodsBrand')->where($where)->order($order)->select();
$cates = (array)Db::name('GoodsCate')->where($where)->order($order)->select();
// 所有的品信息
$specs = (array)Db::name('StoreGoodsSpec')->where($where)->order($order)->select();
$brands = (array)Db::name('StoreGoodsBrand')->where($where)->order($order)->select();
$cates = (array)Db::name('StoreGoodsCate')->where($where)->order($order)->select();
// 所有的品信息
$where = ['is_deleted' => '0', 'status' => '1'];
$goodsListField = 'goods_id,goods_spec,goods_stock,goods_sale';
$goods = Db::name('Goods')->field('id,goods_title')->where($where)->select();
$list = Db::name('GoodsList')->field($goodsListField)->where($where)->select();
$goods = Db::name('StoreGoods')->field('id,goods_title')->where($where)->select();
$list = Db::name('StoreGoodsList')->field($goodsListField)->where($where)->select();
foreach ($goods as $k => $g) {
$goods[$k]['list'] = [];
foreach ($list as $v) {
@ -190,8 +193,8 @@ class Product extends BasicAdmin
protected function _form_build_data()
{
list($main, $list, $post, $verify) = [[], [], $this->request->post(), false];
empty($post['goods_logo']) && $this->error('品LOGO不能为空请上传后再提交数据');
// 品主数据组装
empty($post['goods_logo']) && $this->error('品LOGO不能为空请上传后再提交数据');
// 品主数据组装
$main['cate_id'] = $this->request->post('cate_id', '0');
$main['spec_id'] = $this->request->post('spec_id', '0');
$main['brand_id'] = $this->request->post('brand_id', '0');
@ -202,7 +205,7 @@ class Product extends BasicAdmin
$main['goods_desc'] = $this->request->post('goods_desc', '', null);
$main['goods_content'] = $this->request->post('goods_content', '');
$main['tags_id'] = ',' . join(',', isset($post['tags_id']) ? $post['tags_id'] : []) . ',';
// 品从数据组装
// 品从数据组装
if (!empty($post['goods_spec'])) {
foreach ($post['goods_spec'] as $key => $value) {
$goods = [];
@ -214,49 +217,88 @@ class Product extends BasicAdmin
$list[] = $goods;
}
} else {
$this->error('没有品规格或套餐信息哦!');
$this->error('没有品规格或套餐信息哦!');
}
!$verify && $this->error('没有设置有效的品规格!');
!$verify && $this->error('没有设置有效的品规格!');
return ['main' => $main, 'list' => $list];
}
/**
* 删除产品
* 商品库存信息更新
* @return string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function stock()
{
if (!$this->request->post()) {
$goods_id = $this->request->get('id');
$goods = Db::name('StoreGoods')->where(['id' => $goods_id, 'is_deleted' => '0'])->find();
empty($goods) && $this->error('该商品无法操作入库操作!');
$where = ['goods_id' => $goods_id, 'status' => '1', 'is_deleted' => '0'];
$goods['list'] = Db::name('StoreGoodsList')->where($where)->select();
return $this->fetch('', ['vo' => $goods]);
}
// 入库保存
$goods_id = $this->request->post('id');
list($post, $data) = [$this->request->post(), []];
foreach ($post['spec'] as $key => $spec) {
if ($post['stock'][$key] > 0) {
$data[] = [
'goods_stock' => $post['stock'][$key],
'stock_desc' => $this->request->post('desc'),
'goods_spec' => $spec, 'goods_id' => $goods_id,
];
}
}
empty($data) && $this->error('无需入库的数据哦!');
if (Db::name('StoreGoodsStock')->insertAll($data) !== false) {
GoodsService::syncGoodsStock($goods_id);
$this->success('商品入库成功!', '');
}
$this->error('商品入库失败,请稍候再试!');
}
/**
* 删除商品
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function del()
{
if (DataService::update($this->table)) {
$this->success("产品删除成功!", '');
$this->success("品删除成功!", '');
}
$this->error("产品删除失败,请稍候再试!");
$this->error("品删除失败,请稍候再试!");
}
/**
* 产品禁用
* 品禁用
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function forbid()
{
if (DataService::update($this->table)) {
$this->success("产品禁用成功!", '');
$this->success("商品下架成功!", '');
}
$this->error("产品禁用失败,请稍候再试!");
$this->error("商品下架失败,请稍候再试!");
}
/**
* 产品禁用
* 品禁用
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function resume()
{
if (DataService::update($this->table)) {
$this->success("产品启用成功!", '');
$this->success("商品上架成功!", '');
}
$this->error("产品启用失败,请稍候再试!");
$this->error("商品上架失败,请稍候再试!");
}
}

View File

@ -12,7 +12,7 @@
// | github开源项目https://github.com/zoujingli/Think.Admin
// +----------------------------------------------------------------------
namespace app\goods\controller;
namespace app\store\controller;
use controller\BasicAdmin;
use service\DataService;
@ -25,14 +25,14 @@ use think\Db;
* @author Anyon <zoujingli@qq.com>
* @date 2017/03/27 14:43
*/
class Brand extends BasicAdmin
class GoodsBrand extends BasicAdmin
{
/**
* 定义当前操作表名
* @var string
*/
public $table = 'GoodsBrand';
public $table = 'StoreGoodsBrand';
/**
* 品牌列表
@ -104,7 +104,7 @@ class Brand extends BasicAdmin
protected function _form_result($result)
{
if ($result !== false) {
list($base, $spm, $url) = [url('@admin'), $this->request->get('spm'), url('goods/brand/index')];
list($base, $spm, $url) = [url('@admin'), $this->request->get('spm'), url('store/goods_brand/index')];
$this->success('数据保存成功!', "{$base}#{$url}?spm={$spm}");
}
}

View File

@ -12,7 +12,7 @@
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\goods\controller;
namespace app\store\controller;
use controller\BasicAdmin;
use service\DataService;
@ -20,23 +20,23 @@ use service\ToolsService;
use think\Db;
/**
* 商店品分类管理
* 商店品分类管理
* Class Cate
* @package app\store\controller
* @author Anyon <zoujingli@qq.com>
* @date 2017/03/27 14:43
*/
class Cate extends BasicAdmin
class GoodsCate extends BasicAdmin
{
/**
* 定义当前操作表名
* @var string
*/
public $table = 'GoodsCate';
public $table = 'StoreGoodsCate';
/**
* 品分类列表
* 品分类列表
* @return array|string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
@ -45,7 +45,7 @@ class Cate extends BasicAdmin
*/
public function index()
{
$this->title = '品分类';
$this->title = '品分类';
$db = Db::name($this->table)->where(['is_deleted' => '0']);
return parent::_list($db->order('sort asc,id asc'), false);
}
@ -116,42 +116,42 @@ class Cate extends BasicAdmin
}
/**
* 删除品分类
* 删除品分类
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function del()
{
if (DataService::update($this->table)) {
$this->success("品分类删除成功!", '');
$this->success("品分类删除成功!", '');
}
$this->error("品分类删除失败,请稍候再试!");
$this->error("品分类删除失败,请稍候再试!");
}
/**
* 品分类禁用
* 品分类禁用
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function forbid()
{
if (DataService::update($this->table)) {
$this->success("品分类禁用成功!", '');
$this->success("品分类禁用成功!", '');
}
$this->error("品分类禁用失败,请稍候再试!");
$this->error("品分类禁用失败,请稍候再试!");
}
/**
* 品分类禁用
* 品分类禁用
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function resume()
{
if (DataService::update($this->table)) {
$this->success("品分类启用成功!", '');
$this->success("品分类启用成功!", '');
}
$this->error("品分类启用失败,请稍候再试!");
$this->error("品分类启用失败,请稍候再试!");
}
}

View File

@ -12,7 +12,7 @@
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\goods\controller;
namespace app\store\controller;
use controller\BasicAdmin;
use service\DataService;
@ -25,17 +25,17 @@ use think\Db;
* @author Anyon <zoujingli@qq.com>
* @date 2017/03/27 14:43
*/
class Spec extends BasicAdmin
class GoodsSpec extends BasicAdmin
{
/**
* 定义当前操作表名
* @var string
*/
public $table = 'GoodsSpec';
public $table = 'StoreGoodsSpec';
/**
* 品列表
* 品列表
* @return array|string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
@ -70,7 +70,7 @@ class Spec extends BasicAdmin
}
/**
* 添加
* 添加
* @return array|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
@ -84,7 +84,7 @@ class Spec extends BasicAdmin
}
/**
* 编辑
* 编辑
* @return array|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
@ -116,42 +116,42 @@ class Spec extends BasicAdmin
}
/**
* 删除品规格
* 删除品规格
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function del()
{
if (DataService::update($this->table)) {
$this->success("品规格删除成功!", '');
$this->success("品规格删除成功!", '');
}
$this->error("品规格删除失败,请稍候再试!");
$this->error("品规格删除失败,请稍候再试!");
}
/**
* 品规格禁用
* 品规格禁用
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function forbid()
{
if (DataService::update($this->table)) {
$this->success("品规格禁用成功!", '');
$this->success("品规格禁用成功!", '');
}
$this->error("品规格禁用失败,请稍候再试!");
$this->error("品规格禁用失败,请稍候再试!");
}
/**
* 品规格禁用
* 品规格禁用
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function resume()
{
if (DataService::update($this->table)) {
$this->success("品规格启用成功!", '');
$this->success("品规格启用成功!", '');
}
$this->error("品规格启用失败,请稍候再试!");
$this->error("品规格启用失败,请稍候再试!");
}
}

View File

@ -0,0 +1,157 @@
<?php
// +----------------------------------------------------------------------
// | Think.Admin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/Think.Admin
// +----------------------------------------------------------------------
namespace app\store\controller;
use app\store\service\OrderService;
use controller\BasicAdmin;
use service\DataService;
use think\Db;
/**
* 商店订单管理
* Class Order
* @package app\store\controller
* @author Anyon <zoujingli@qq.com>
* @date 2017/03/27 14:43
*/
class Order extends BasicAdmin
{
/**
* 定义当前操作表名
* @var string
*/
public $table = 'StoreOrder';
/**
* 订单列表
* @return array|string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function index()
{
$this->title = '订单管理';
$db = Db::name($this->table);
$get = $this->request->get();
// 会员信息查询过滤
$memberWhere = [];
foreach (['phone', 'nickname'] as $field) {
if (isset($get[$field]) && $get[$field] !== '') {
$memberWhere[] = [$field, 'like', "%{$get[$field]}%"];
}
}
if (!empty($memberWhere)) {
$memberWhere['status'] = '1';
$sql = Db::name('Member')->field('id')->where($memberWhere)->buildSql(true);
$db->where("mid in {$sql}");
}
// =============== 商品信息查询过滤 ===============
$goodsWhere = [];
foreach (['goods_title'] as $field) {
if (isset($get[$field]) && $get[$field] !== '') {
$goodsWhere[] = [$field, 'like', "%{$get[$field]}%"];
}
}
if (!empty($goodsWhere)) {
$sql = Db::name('StoreOrderList')->field('order_no')->where($goodsWhere)->buildSql(true);
$db->where("order_no in {$sql}");
}
// =============== 收货地址过滤 ===============
$expressWhere = [];
if (isset($get['express_title']) && $get['express_title'] !== '') {
$expressWhere[] = ['send_company_title|company_title', 'like', "%{$get['express_title']}%"];
}
foreach (['send_no', 'username', 'phone', 'province', 'city', 'area', 'address'] as $field) {
if (isset($get[$field]) && $get[$field] !== '') {
$expressWhere[] = [$field, 'like', "%{$get[$field]}%"];
}
}
if (isset($get['send_status']) && $get['send_status'] !== '') {
$expressWhere[] = empty($get['send_status']) ? ['send_no', 'eq', ''] : ['send_no', 'neq', ''];
}
if (!empty($expressWhere)) {
$sql = Db::name('StoreOrderExpress')->field('order_no')->where($expressWhere)->buildSql(true);
$db->where("order_no in {$sql}");
}
// =============== 主订单过滤 ===============
foreach (['order_no', 'desc'] as $field) {
(isset($get[$field]) && $get[$field] !== '') && $db->whereLike($field, "%{$get[$field]}%");
}
(isset($get['status']) && $get['status'] !== '') && $db->where('status', $get['status']);
// 订单是否包邮状态检索
if (isset($get['express_zero']) && $get['express_zero'] !== '') {
empty($get['express_zero']) ? $db->where('freight_price', '>', '0') : $db->where('freight_price', '0');
}
// 订单时间过滤
foreach (['create_at', 'pay_at'] as $field) {
if (isset($get[$field]) && $get[$field] !== '') {
list($start, $end) = explode(' - ', $get[$field]);
$db->whereBetween($field, ["{$start} 00:00:00", "{$end} 23:59:59"]);
}
}
return parent::_list($db);
}
/**
* 订单列表数据处理
* @param array $data
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
protected function _data_filter(&$data)
{
OrderService::buildOrderList($data);
}
/**
* 订单地址修改
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\Exception
*/
public function address()
{
$order_no = $this->request->get('order_no');
if ($this->request->isGet()) {
$order = Db::name('StoreOrder')->where(['order_no' => $order_no])->find();
empty($order) && $this->error('该订单无法进行地址修改,订单数据不存在!');
$orderExpress = Db::name('StoreOrderExpress')->where(['order_no' => $order_no])->find();
empty($orderExpress) && $this->error('该订单无法进行地址修改!');
return $this->fetch('', $orderExpress);
}
$data = [
'order_no' => $order_no,
'username' => $this->request->post('express_username'),
'phone' => $this->request->post('express_phone'),
'province' => $this->request->post('form_express_province'),
'city' => $this->request->post('form_express_city'),
'area' => $this->request->post('form_express_area'),
'address' => $this->request->post('express_address'),
'desc' => $this->request->post('express_desc'),
];
if (DataService::save('StoreOrderExpress', $data, 'order_no')) {
$this->success('收货地址修改成功!', '');
}
$this->error('收货地址修改失败,请稍候再试!');
}
}

View File

@ -0,0 +1,203 @@
<?php
// +----------------------------------------------------------------------
// | Think.Admin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/Think.Admin
// +----------------------------------------------------------------------
namespace app\store\controller\wechat;
use Endroid\QrCode\QrCode;
use service\WechatService;
use WeChat\Pay;
/**
* 微信功能demo
* Class Demo
* @package app\store\controller\wechat
*/
class Demo
{
/**
* 微信扫码支付模式一二维码显示
* @return \think\Response
* @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
* @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
* @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
*/
public function scanOneQrc()
{
$wechat = new Pay(config('wechat.'));
$result = $wechat->createParamsForRuleQrc('8888888');
return $this->createQrc($result);
}
/**
* 微信扫码支付模式一通知处理
* @return string
* @throws \WeChat\Exceptions\InvalidResponseException
*/
public function scanOneNotify()
{
$wechat = new Pay(config('wechat.'));
$notify = $wechat->getNotify();
p('======= 来自扫码支付1的数据 ======');
p($notify);
// 产品ID @todo 你的业务,并实现下面的统一下单操作
$product_id = $notify['product_id'];
// 微信统一下单处理
$options = [
'body' => '测试商品产品ID' . $product_id,
'out_trade_no' => time(),
'total_fee' => '1',
'trade_type' => 'NATIVE',
'notify_url' => url('@wx-demo-notify', '', true, true),
'spbill_create_ip' => request()->ip(),
];
$order = $wechat->createOrder($options);
p('======= 来自扫码支付1统一下单结果 ======');
p($order);
// 回复XML文本
$result = [
'return_code' => 'SUCCESS',
'return_msg' => '处理成功',
'appid' => $notify['appid'],
'mch_id' => $notify['mch_id'],
'nonce_str' => \WeChat\Contracts\Tools::createNoncestr(),
'prepay_id' => $order['prepay_id'],
'result_code' => 'SUCCESS',
];
$result['sign'] = $wechat->getPaySign($result);
p('======= 来自扫码支付1返回的结果 ======');
p($result);
return \WeChat\Contracts\Tools::arr2xml($result);
}
/**
* 扫码支付模式二测试二维码
* @return \think\Response
* @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
* @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
* @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
* @throws \WeChat\Exceptions\InvalidResponseException
*/
public function scanQrc()
{
$wechat = new Pay(config('wechat.'));
$options = [
'body' => '测试商品',
'out_trade_no' => time(),
'total_fee' => '1',
'trade_type' => 'NATIVE',
'notify_url' => url('@wx-demo-notify', '', true, true),
'spbill_create_ip' => request()->ip(),
];
// 生成预支付码
$result = $wechat->createOrder($options);
return $this->createQrc($result['code_url']);
}
/**
* 公众号JSAPI支付二维码
* @return \think\Response
* @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
* @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
* @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
*/
public function jsapiQrc()
{
$url = url('@wx-demo-jsapi', '', true, true);
return $this->createQrc($url);
}
/**
* 公众号JSAPI支付测试
* @link wx-demo-jsapi
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function jsapi()
{
$wechat = new Pay(config('wechat.'));
$openid = WechatService::webOauth(request()->url(true), 0)['openid'];
$options = [
'body' => '测试商品',
'out_trade_no' => time(),
'total_fee' => '1',
'openid' => $openid,
'trade_type' => 'JSAPI',
'notify_url' => url('@wx-demo-notify', '', true, true),
'spbill_create_ip' => request()->ip(),
];
// 生成预支付码
$result = $wechat->createOrder($options);
// 创建JSAPI参数签名
$options = $wechat->createParamsForJsApi($result['prepay_id']);
$optionJSON = json_encode($options, JSON_UNESCAPED_UNICODE);
// JSSDK 签名配置
$configJSON = json_encode(WechatService::webJsSDK(), JSON_UNESCAPED_UNICODE);
echo '<pre>';
echo "当前用户OPENID: {$openid}";
echo "\n--- 创建预支付码 ---\n";
var_export($result);
echo '</pre>';
echo '<pre>';
echo "\n\n--- JSAPI 及 H5 参数 ---\n";
var_export($options);
echo '</pre>';
echo "<button id='paytest' type='button'>JSAPI支付测试</button>";
echo "
<script src='//res.wx.qq.com/open/js/jweixin-1.2.0.js'></script>
<script>
wx.config($configJSON);
document.getElementById('paytest').onclick = function(){
var options = $optionJSON;
options.success = function(){
alert('支付成功');
}
wx.chooseWXPay(options);
}
</script>";
}
/**
* 支付通知接收处理
* @return string
* @throws \WeChat\Exceptions\InvalidResponseException
*/
public function notify()
{
$wechat = new Pay(config('wechat.'));
p($wechat->getNotify());
return 'SUCCESS';
}
/**
* 显示二维码
* @param string $url
* @return \think\Response
* @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
* @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
* @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
*/
protected function createQrc($url)
{
$qrCode = new QrCode();
$qrCode->setText($url)->setSize(300)->setPadding(20)->setImageType(QrCode::IMAGE_TYPE_PNG);
return \think\facade\Response::header('Content-Type', 'image/png')->data($qrCode->get());
}
}

View File

@ -0,0 +1,30 @@
<?php
// +----------------------------------------------------------------------
// | Think.Admin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/Think.Admin
// +----------------------------------------------------------------------
namespace app\store\controller\wechat;
class Index
{
public function index()
{
return '微信商城---开发中...';
}
public function pay()
{
return 'fsdfasfsa';
}
}

View File

@ -0,0 +1,34 @@
<?php
// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
use think\facade\App;
use think\facade\Route;
use think\Request;
/* 注册微信端路由支持 */
Route::rule('wx', function (Request $request) {
$params = explode('-', $request->path());
array_shift($params);
$controller = array_shift($params) ?: config('app.default_controller');
$action = array_shift($params) ?: config('app.default_action');
return App::action("store/wechat.{$controller}/{$action}", $params);
});
// 微信菜单链接配置
$GLOBALS['WechatMenuLink'][] = ['link' => '@wx', 'title' => '微信商城首页'];
$GLOBALS['WechatMenuLink'][] = ['link' => '@wx-demo-jsapi', 'title' => 'JSAPI支付测试'];
// @todo 模块处理机制将写在下面(包括模块初始化及升级)
// @todo 模块权限处理,使用全局数组
// @todo 模板菜单处理,默认放到全局数组中,然后在菜单中可以快速编辑(还要考虑下)

View File

@ -12,41 +12,41 @@
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\goods\service;
namespace app\store\service;
use think\Db;
/**
* 品数据服务支持
* 品数据服务支持
* Class ProductService
* @package app\goods\service
*/
class ProductService
class GoodsService
{
/**
* 品表数据处理
* 品表数据处理
* @param array $goodsList
* @return array
*/
public static function buildGoodsList(&$goodsList)
{
// 品分类处理
// 品分类处理
$cateField = 'id,pid,cate_title,cate_desc';
$cateWhere = ['status' => '1', 'is_deleted' => '0'];
$cateList = Db::name('GoodsCate')->where($cateWhere)->order('sort asc,id desc')->column($cateField);
// 产品品牌处理
$brandField = 'id,brand_logo,brand_cover,brand_title,brand_desc,brand_detail';
$cateList = Db::name('StoreGoodsCate')->where($cateWhere)->order('sort asc,id desc')->column($cateField);
// 商品品牌处理
$brandWhere = ['status' => '1', 'is_deleted' => '0'];
$brandList = Db::name('GoodsBrand')->where($brandWhere)->order('sort asc,id desc')->column($brandField);
// 无产品列表时
$brandField = 'id,brand_logo,brand_cover,brand_title,brand_desc,brand_detail';
$brandList = Db::name('StoreGoodsBrand')->where($brandWhere)->order('sort asc,id desc')->column($brandField);
// 无商品列表时
if (empty($goodsList)) {
return ['list' => $goodsList, 'cate' => $cateList, 'brand' => $brandList];
}
// 读取品详情列表
// 读取品详情列表
$specWhere = [['status', 'eq', '1'], ['is_deleted', 'eq', '0'], ['goods_id', 'in', array_column($goodsList, 'id')]];
$specField = 'id,goods_id,goods_spec,goods_number,market_price,selling_price,goods_stock,goods_sale';
$specList = Db::name('GoodsList')->where($specWhere)->column($specField);
$specList = Db::name('StoreGoodsList')->where($specWhere)->column($specField);
foreach ($specList as $key => $spec) {
foreach ($goodsList as $goods) {
if ($goods['id'] === $spec['goods_id']) {
@ -59,13 +59,13 @@ class ProductService
$specList[$key]['goods_spec_alias'] = str_replace([':', ','], [': ', ', '], $spec['goods_spec']);
}
}
// 品数据组装
// 品数据组装
foreach ($goodsList as $key => $vo) {
// 品内容处理
$goodsList[$key]['goods_content'] = htmlspecialchars_decode($vo['goods_content']);
// 品品牌处理
// 品内容处理
$goodsList[$key]['goods_content'] = $vo['goods_content'];
// 品品牌处理
$goodsList[$key]['brand'] = isset($brandList[$vo['brand_id']]) ? $brandList[$vo['brand_id']] : [];
// 品分类关联
// 品分类关联
$goodsList[$key]['cate'] = [];
if (isset($cateList[$vo['cate_id']])) {
$goodsList[$key]['cate'][] = ($tcate = $cateList[$vo['cate_id']]);
@ -74,7 +74,7 @@ class ProductService
}
$goodsList[$key]['cate'] = array_reverse($goodsList[$key]['cate']);
}
// 品详细列表关联
// 品详细列表关联
$goodsList[$key]['spec'] = [];
foreach ($specList as $spec) {
if ($vo['id'] === $spec['goods_id']) {
@ -86,8 +86,8 @@ class ProductService
}
/**
* 同步更新产品库存及售出(@todo 需要重新做库存统计)
* @param int $goods_id 品ID
* 同步更新商品库存及售出
* @param int $goods_id 品ID
* @return array
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
@ -97,38 +97,34 @@ class ProductService
*/
public static function syncGoodsStock($goods_id)
{
// 检查品是否需要更新库存
// 检查品是否需要更新库存
$map = ['id' => $goods_id, 'is_deleted' => '0'];
if (!($goods = Db::name('Goods')->where($map)->find())) {
return ['code' => 0, 'msg' => '指定品信息无法同步库存!'];
if (!($goods = Db::name('StoreGoods')->where($map)->find())) {
return ['code' => 0, 'msg' => '指定品信息无法同步库存!'];
}
// 统计入库信息
$stockField = 'goods_id,goods_spec,ifnull(sum(goods_stock), 0) goods_stock';
$stockWhere = ['status' => '1', 'is_deleted' => '0', 'goods_id' => $goods_id, 'mch_id' => $mch_id];
$stockList = (array)Db::name('GoodsStock')->field($stockField)->where($stockWhere)->group('goods_id,goods_spec')->select();
$stockWhere = ['status' => '1', 'is_deleted' => '0', 'goods_id' => $goods_id];
$stockList = (array)Db::name('StoreGoodsStock')->field($stockField)->where($stockWhere)->group('goods_id,goods_spec')->select();
// 统计销售信息
$saleField = 'goods_id,goods_spec,ifnull(sum(number), 0) goods_sale';
$saleWhere = ['status' => '1', 'is_deleted' => '0', 'goods_id' => $goods_id, 'mch_id' => $mch_id];
$saleList = (array)Db::name('StoreOrderList')->field($saleField)->where($saleWhere)->group('goods_id,goods_spec')->select();
$saleWhere = ['status' => '1', 'is_deleted' => '0', 'goods_id' => $goods_id];
$saleList = (array)Db::name('StoreOrderGoods')->field($saleField)->where($saleWhere)->group('goods_id,goods_spec')->select();
// 库存置零
list($where, $total_stock, $total_sale) = [['goods_id' => $goods_id], 0, 0];
Db::name('GoodsList')->where($where)->update(['goods_stock' => 0, 'goods_sale' => 0, 'mch_id' => $mch_id]);
// 更新品库存
list($where, $total_sale) = [['goods_id' => $goods_id], 0];
Db::name('StoreGoodsList')->where($where)->update(['goods_stock' => 0, 'goods_sale' => 0]);
// 更新品库存
foreach ($stockList as $stock) {
$total_stock += intval($stock['goods_stock']);
$where = ['goods_id' => $goods_id, 'goods_spec' => $stock['goods_spec'], 'mch_id' => $mch_id];
Db::name('GoodsList')->where($where)->update(['goods_stock' => $stock['goods_stock']]);
$where = ['goods_id' => $goods_id, 'goods_spec' => $stock['goods_spec']];
Db::name('StoreGoodsList')->where($where)->update(['goods_stock' => $stock['goods_stock']]);
}
// 更新品销量
// 更新品销量
foreach ($saleList as $sale) {
$total_sale += intval($sale['goods_sale']);
$where = ['goods_id' => $goods_id, 'goods_spec' => $sale['goods_spec'], 'mch_id' => $mch_id];
Db::name('GoodsList')->where($where)->update(['goods_sale' => $sale['goods_sale']]);
$where = ['goods_id' => $goods_id, 'goods_spec' => $sale['goods_spec']];
Db::name('StoreGoodsList')->where($where)->update(['goods_sale' => $sale['goods_sale']]);
}
// 更新总库存及总销量
$update = ['package_stock' => $total_stock, 'package_sale' => $total_sale, 'mch_id' => $mch_id];
Db::name('Goods')->where(['id' => $goods_id])->update($update);
return ['code' => 1, 'msg' => '同步产品库存成功!'];
return ['code' => 1, 'msg' => '同步商品库存成功!'];
}
}

View File

@ -0,0 +1,37 @@
<?php
// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\store\service;
use service\DataService;
/**
* 会员数据初始化
* Class MemberService
* @package app\store\service
*/
class MemberService
{
/**
* 创建会员数据
* @param array $data 会员数据
* @return bool
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public static function create($data)
{
return DataService::save('StoreMember', $data, 'id');
}
}

View File

@ -0,0 +1,189 @@
<?php
// +----------------------------------------------------------------------
// | Think.Admin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/Think.Admin
// +----------------------------------------------------------------------
namespace app\store\service;
use service\DataService;
use service\ToolsService;
use think\Db;
/**
* 商城订单服务
* Class OrderService
* @package app\store
*/
class OrderService
{
/**
* 商城创建订单
* @param int $mid 会员ID
* @param string $params 商品参数规格 (商品ID@商品规格@购买数量;商品ID@商品规格@购买数量)
* @param int $addressId 地址记录ID
* @param int $expressId 快递记录ID
* @param string $orderDesc 订单描述
* @param integer $orderType 订单类型
* @param string $from 订单来源
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function create($mid, $params, $addressId, $expressId, $orderDesc = '', $orderType = 1, $from = 'wechat')
{
// 会员数据获取与检验
if (!($member = Db::name('StoreMember')->where(['id' => $mid])->find())) {
return ['code' => 0, 'msg' => '会员数据处理异常,请刷新重试!'];
}
// 订单数据生成
list($order_no, $orderList) = [DataService::createSequence(10, 'ORDER'), []];
$order = ['mid' => $mid, 'order_no' => $order_no, 'real_price' => 0, 'goods_price' => 0, 'desc' => $orderDesc, 'type' => $orderType, 'from' => $from];
foreach (explode(';', trim($params, ',;@')) as $param) {
list($goods_id, $goods_spec, $number) = explode('@', "{$param}@@");
$item = ['mid' => $mid, 'type' => $orderType, 'order_no' => $order_no, 'goods_id' => $goods_id, 'goods_spec' => $goods_spec, 'goods_number' => $number];
$goodsResult = self::buildOrderData($item, $order, $orderList, 'selling_price');
if (empty($goodsResult['code'])) {
return $goodsResult;
}
}
// 生成快递信息
$expressResult = self::buildExpressData($order, $addressId, $expressId);
if (empty($expressResult['code'])) {
return $expressResult;
}
try {
// 写入订单信息
Db::transaction(function () use ($order, $orderList, $expressResult) {
Db::name('StoreOrder')->insert($order); // 主订单信息
Db::name('StoreOrderGoods')->insertAll($orderList); // 订单关联的商品信息
Db::name('storeOrderExpress')->insert($expressResult['data']); // 快递信息
});
// 同步商品库存列表
foreach (array_unique(array_column($orderList, 'goods_id')) as $stock_goods_id) {
GoodsService::syncGoodsStock($stock_goods_id);
}
} catch (\Exception $e) {
return ['code' => 0, 'msg' => '商城订单创建失败,请稍候再试!' . $e->getLine() . $e->getFile() . $e->getMessage()];
}
return ['code' => 1, 'msg' => '商城订单创建成功!', 'order_no' => $order_no];
}
/**
* 生成订单快递数据
* @param array $order 订单主表记录
* @param int $address_id 会员地址ID
* @param int $express_id 快递信息ID
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function buildExpressData(&$order, $address_id, $express_id)
{
// 收货地址处理
$addressWhere = ['mid' => $order['mid'], 'id' => $address_id, 'status' => '1', 'is_deleted' => '0'];
$addressField = 'username express_username,phone express_phone,province express_province,city express_city,area express_area,address express_address';
if (!($address = Db::name('StoreMemberAddress')->field($addressField)->where($addressWhere)->find())) {
return ['code' => 0, 'msg' => '收货地址数据异常!'];
}
// 物流信息查询
$expressField = 'express_title,express_code';
$expressWhere = ['id' => $express_id, 'status' => '1', 'is_deleted' => '0'];
if (!($express = Db::name('StoreExpress')->field($expressField)->where($expressWhere)->find())) {
return ['code' => 0, 'msg' => '快递公司数据异常!'];
}
// @todo 运费计算处理
// $order['freight_price'] = '0.00';
// $order['real_price'] += floatval($order['freight_price']);
$extend = ['mid' => $order['mid'], 'order_no' => $order['order_no'], 'type' => $order['type']];
return ['code' => 1, 'data' => array_merge($address, $express, $extend), 'msg' => '生成快递信息成功!'];
}
/**
* 订单数据生成
* @param array $item 订单单项参数
* (mid,type,order_no,goods_id,goods_spec,goods_number)
* @param array $order 订单主表
* @param array $orderList 订单详细表
* @param string $price_field 实际计算单价字段
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private static function buildOrderData($item, &$order, &$orderList, $price_field = 'selling_price')
{
list($mid, $type, $order_no, $goods_id, $goods_spec, $number) = [
$item['mid'], $item['type'], $item['order_no'], $item['goods_id'], $item['goods_spec'], $item['goods_number'],
];
// 商品主体信息
$goodsField = 'goods_title,goods_logo,goods_image';
$goodsWhere = ['id' => $goods_id, 'status' => '1', 'is_deleted' => '0'];
if (!($goods = Db::name('StoreGoods')->field($goodsField)->where($goodsWhere)->find())) {
return ['code' => 0, 'msg' => "无效的商品信息!", 'data' => "{$goods_id}, {$goods_spec}, {$number}"];
}
// 商品规格信息
$specField = 'goods_id,goods_spec,market_price,selling_price,goods_stock,goods_sale';
$specWhere = ['status' => '1', 'is_deleted' => '0', 'goods_id' => $goods_id, 'goods_spec' => $goods_spec];
if (!($goodsSpec = Db::name('StoreGoodsList')->field($specField)->where($specWhere)->find())) {
return ['code' => 0, 'msg' => '无效的商品规格信息!', 'data' => "{$goods_id}, {$goods_spec}, {$number}"];
}
// 商品库存检查
if ($goodsSpec['goods_stock'] - $goodsSpec['goods_sale'] < $number) {
return ['code' => 0, 'msg' => '商品库存不足,请更换其它商品!', 'data' => "{$goods_id}, {$goods_spec}, {$number}"];
}
// 订单价格处理
$goodsSpec['price_field'] = $price_field;
$orderList[] = array_merge($goods, $goodsSpec, ['mid' => $mid, 'number' => $number, 'order_no' => $order_no, 'type' => $type]);
$order['goods_price'] += floatval($goodsSpec[$price_field]) * $number;
$order['real_price'] += floatval($goodsSpec[$price_field]) * $number;
return ['code' => 1, 'msg' => '商品添加到订单成功!'];
}
/**
* 订单主表数据处理
* @param array $list
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function buildOrderList(&$list)
{
$mids = array_unique(array_column($list, 'mid'));
$orderNos = array_unique(array_column($list, 'order_no'));
$memberList = Db::name("StoreMember")->whereIn('id', $mids)->select();
$goodsList = Db::name('StoreOrderGoods')->whereIn('order_no', $orderNos)->select();
$expressList = Db::name('StoreOrderExpress')->whereIn('order_no', $orderNos)->select();
foreach ($list as $key => $vo) {
list($list[$key]['member'], $list[$key]['goods'], $list[$key]['express']) = [[], [], []];
foreach ($memberList as $member) {
$member['nickname'] = ToolsService::emojiDecode($member['nickname']);
($vo['mid'] === $member['id']) && $list[$key]['member'] = $member;
}
foreach ($expressList as $express) {
($vo['order_no'] === $express['order_no']) && $list[$key]['express'] = $express;
}
foreach ($goodsList as $goods) {
if ($goods['goods_spec'] === 'default:default') {
$goods['goods_spec_alias'] = '<span class="color-desc">默认规格</span>';
} else {
$goods['goods_spec_alias'] = str_replace([':', ','], ['', ''], $goods['goods_spec']);
}
($vo['order_no'] === $goods['order_no']) && $list[$key]['goods'][] = $goods;
}
}
return $list;
}
}

View File

@ -0,0 +1,36 @@
<form class="layui-form layui-box" style='padding:25px 30px 20px 0' action="{:request()->url()}" data-auto="true" method="post">
<div class="layui-form-item">
<label class="layui-form-label">快递公司名称</label>
<div class="layui-input-block">
<input autofocus name="express_title" value='{$vo.express_title|default=""}' required="required"
title="请输入快递公司名称" placeholder="请输入快递公司名称" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">快递公司代码</label>
<div class="layui-input-block">
<input autofocus name="express_code" value='{$vo.express_code|default=""}' required="required"
title="请输入快递公司代码" placeholder="请输入快递公司代码" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">快递公司描述</label>
<div class="layui-input-block">
<textarea placeholder="请输入快递公司描述" title="请输入快递公司描述"
class="layui-textarea" name="express_desc">{$vo.express_desc|default=""}</textarea>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="layui-form-item text-center">
{if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'/>{/if}
<button class="layui-btn" type='submit'>保存数据</button>
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
</div>
<script>window.form.render();</script>
</form>

View File

@ -0,0 +1,117 @@
{extend name='admin@public/content'}
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("$classuri/add")}' data-title="添加快递" class='layui-btn layui-btn-sm layui-btn-primary'>添加快递</button>
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除快递</button>
<!--{/if}-->
{/block}
{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">
<div class="layui-form-item layui-inline">
<label class="layui-form-label">快递公司</label>
<div class="layui-input-inline">
<input name="express_title" value="{$Think.get.express_title}" placeholder="请输入快递名称" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">快递代码</label>
<div class="layui-input-inline">
<input name="express_code" value="{$Think.get.express_code}" placeholder="请输入快递代码" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">添加时间</label>
<div class="layui-input-inline">
<input name="date" id="range-date" value="{$Think.get.date}" placeholder="请选择添加时间" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
</div>
</form>
<script>
window.laydate.render({range: true, elem: '#range-date'});
window.form.render();
</script>
<!-- 表单搜索 结束 -->
<form onsubmit="return false;" data-auto="true" method="post">
<input type="hidden" value="resort" name="action"/>
{if empty($list)}
<p class="help-block text-center well">没 有 记 录 哦!</p>
{else}
<table class="layui-table" lay-skin="line" lay-size="sm">
<thead>
<tr>
<th class='list-table-check-td'>
<input data-auto-none="none" data-check-target='.list-check-box' type='checkbox'/>
</th>
<th class='list-table-sort-td'>
<button type="submit" class="layui-btn layui-btn-normal layui-btn-xs">排 序</button>
</th>
<th class='text-left'>快递公司</th>
<th class='text-left'>快递代码</th>
<th class='text-left'>添加时间</th>
<th class='text-left'>快递状态</th>
<th class='text-left'>操作</th>
</tr>
</thead>
<tbody>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
</td>
<td class='list-table-sort-td'>
<input name="_{$vo.id}" value="{$vo.sort}" class="list-sort-input"/>
</td>
<td class='text-left'>{$vo.express_title}</td>
<td class='text-left'>{$vo.express_code}</td>
<td class='text-left'>{$vo.create_at|format_datetime}</td>
<td class='text-left'>
{if $vo.status eq 0}<span class="color-red">已禁用</span>{elseif $vo.status eq 1}<span class="color-green">使用中</span>{/if}
</td>
<td class='text-left nowrap'>
<!--{if auth("$classuri/edit")}-->
<span class="text-explode">|</span>
<a data-title="编辑快递" data-modal='{:url("$classuri/edit")}?id={$vo.id}'>编辑</a>
<!--{/if}-->
<!--{if $vo.status eq 1 and auth("$classuri/forbid")}-->
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:url("$classuri/forbid")}'>禁用</a>
<!--{elseif auth("$classuri/resume")}-->
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:url("$classuri/resume")}'>启用</a>
<!--{/if}-->
{if auth("$classuri/del")}
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}'>删除</a>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
{if isset($page)}<p>{$page|raw}</p>{/if}
{/if}
</form>
{/block}

View File

@ -5,13 +5,13 @@
<!--{if !empty($brands)}-->
<div class="form-group">
<label class="col-sm-2 control-label">品品牌</label>
<label class="col-sm-2 control-label">品品牌</label>
<div class='col-sm-8'>
<select required class="layui-select full-width" name="brand_id">
{foreach $brands as $brand}
<!--{eq name='$brand.id' value='$vo.brand_id|default=0'}-->
<option selected="selected" value="{$brand.id}">{$brand.brand_title}</option>
<!--{elseif empty($vo.brand_id)}-->
<!--{else}-->
<option value="{$brand.id}">{$brand.brand_title}</option>
<!--{/eq}-->
{/foreach}
@ -22,7 +22,7 @@
<!--{if !empty($cates)}-->
<div class="form-group">
<label class="col-sm-2 control-label">品分类</label>
<label class="col-sm-2 control-label">品分类</label>
<div class='col-sm-8 text-top'>
<select required class="layui-select full-width" name="cate_id">
{foreach $cates as $cate}
@ -38,15 +38,15 @@
<!--{/if}-->
<div class="form-group">
<label class="col-sm-2 control-label">品名称</label>
<label class="col-sm-2 control-label">品名称</label>
<div class='col-sm-8'>
<input name="goods_title" required value="{$vo.goods_title|default=''}" class="layui-input" title="请输入产品名称" placeholder="请输入产品名称">
<input name="goods_title" required value="{$vo.goods_title|default=''}" class="layui-input" title="请输入商品名称" placeholder="请输入商品名称">
</div>
</div>
{if !empty($tags)}
<div class="form-group">
<label class="col-sm-2 control-label">品标签</label>
<label class="col-sm-2 control-label">品标签</label>
<div class='col-sm-8'>
<div class="background-item">
{foreach $tags as $tag}
@ -65,13 +65,13 @@
{/if}
<div class="form-group">
<label class="col-sm-2 control-label label-required">品图片</label>
<label class="col-sm-2 control-label label-required">品图片</label>
<div class='col-sm-8'>
<table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
<thead>
<tr>
<td>品LOGO</td>
<td>品图片</td>
<td>品LOGO</td>
<td>品图片</td>
</tr>
</thead>
<tbody>
@ -88,9 +88,9 @@
</div>
</div>
<!-- 普通产品及积分产品 开始 -->
<!-- 普通商品及积分商品 开始 -->
<div class="form-group">
<label class="col-sm-2 control-label">品规格</label>
<label class="col-sm-2 control-label">品规格</label>
<div class='col-sm-8'>
<select required class="layui-select full-width block" name="spec_id" lay-ignore>
{foreach $specs as $spec}
@ -120,7 +120,7 @@
<table class="layui-table notevent" lay-size="sm">
<thead>
<tr>
<th>品规格</th>
<th>品规格</th>
<th>市场价格</th>
<th>销售价格</th>
<th>规格状态</th>
@ -152,7 +152,7 @@
</table>
</div>
</div>
<!-- 普通产品及积分产品 结束 -->
<!-- 普通商品及积分商品 结束 -->
<div class="form-group">
<label class="col-sm-2 control-label">视频展示</label>
@ -176,7 +176,7 @@
</div>
<div class="form-group">
<label class="col-sm-2 control-label label-required">品内容</label>
<label class="col-sm-2 control-label label-required">品内容</label>
<div class='col-sm-8'>
<textarea name="goods_content">{$vo.goods_content|default=''|htmlspecialchars_decode}</textarea>
</div>
@ -212,7 +212,7 @@
$('#ProductForm [name="goods_image"]').uploadMultipleImage();
// 规格显示切换
$('#ProductForm').on('click', '[data-spec]', applySpecData);
// 品规格切换
// 品规格切换
$('#ProductForm').on('change', '[name="spec_id"]', function () {
var specs = eval(this.options[this.selectedIndex].getAttribute('data-param'));
for (var i in specs) {
@ -279,8 +279,8 @@
var specName = specs[i];
var specTitle = (specName === 'default:default') ? '默认规格' : specName.replace(/,/ig, ';').replace(/:/ig, ':');
var specAttrs = [], lines = specTitle.split(';');
for (var i in lines) {
var line = lines[i].split(':');
for (var j in lines) {
var line = lines[j].split(':');
specAttrs.push({name: line[0], value: (line[1] || '').split(',')});
}
list.push({

View File

@ -3,7 +3,7 @@
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-open='{:url("$classuri/add")}' data-title="添加产品" class='layui-btn layui-btn-sm'>添加产</button>
<button data-open='{:url("$classuri/add")}' data-title="添加商品" class='layui-btn layui-btn-sm layui-btn-primary'>添加商</button>
<!--{/if}-->
<!--{if auth("$classuri/forbid")}-->
@ -15,7 +15,7 @@
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>批量删除</button>
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
<!--{/if}-->
{/block}
@ -26,18 +26,18 @@
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">
<div class="layui-form-item layui-inline">
<label class="layui-form-label">品名称</label>
<label class="layui-form-label">品名称</label>
<div class="layui-input-inline">
<input name="goods_title" value="{$Think.get.goods_title}" placeholder="请输入品名称" class="layui-input">
<input name="goods_title" value="{$Think.get.goods_title}" placeholder="请输入品名称" class="layui-input">
</div>
</div>
<!--{if !empty($cates)}-->
<div class="layui-form-item layui-inline">
<label class="layui-form-label">品品牌</label>
<label class="layui-form-label">品品牌</label>
<div class="layui-input-inline">
<select name="brand_id" lay-search>
<option value="">品品牌</option>
<option value="">品品牌</option>
{foreach $brands as $brand}
<!--{if $Think.get.brand_id eq $brand.id}-->
<option selected="selected" value="{$brand.id}">{$brand.brand_title}</option>
@ -52,7 +52,7 @@
<!--{if !empty($cates)}-->
<div class="layui-form-item layui-inline">
<label class="layui-form-label">品分类</label>
<label class="layui-form-label">品分类</label>
<div class="layui-input-inline">
<select name="cate_id" lay-search>
<option value="">所有分类</option>
@ -101,7 +101,7 @@
<table class="think-inner-table layui-table">
<thead>
<tr>
<td>品信息</td>
<td>品信息</td>
<td class="text-right nowrap">售价 ( 标价 ) / 库存 ( 剩余, 已售 )</td>
</tr>
</thead>
@ -159,6 +159,11 @@
<a data-open='{:url("$classuri/edit")}?id={$vo.id}'>编辑</a>
<!--{/if}-->
<!--{if auth("$classuri/stock")}-->
<span class="text-explode">|</span>
<a data-title="商品入库" data-modal='{:url("$classuri/stock")}?id={$vo.id}'>入库</a>
<!--{/if}-->
<!--{if $vo.status eq 1 and auth("$classuri/forbid")}-->
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:url("$classuri/forbid")}'>下架</a>

View File

@ -0,0 +1,52 @@
<form class="layui-form layui-box modal-form-box" action="{:request()->url()}" data-auto="true" method="post">
<div class="layui-form-item">
<label class="layui-form-label">商品名称</label>
<div class="layui-input-block">
<input value='[{$vo.id}] {$vo.goods_title|default=""}' disabled="disabled" class="layui-input layui-bg-gray">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label label-required">商品库存</label>
<div class="layui-input-block">
<table class="layui-table" lay-size="sm">
<thead>
<tr>
<th>商品规格</th>
<th class="text-right">入库数量</th>
</tr>
</thead>
{foreach $vo.list as $spec}
<tr>
<td>
{$spec.goods_spec|str_replace=['default:default',',',':'],['默认规格','',''],###}
</td>
<td style="padding:0">
<input name="spec[]" value="{$spec.goods_spec}" type="hidden">
<input name="stock[]" value="0" onblur="this.value=parseInt(this.value)||0"
class="layui-input text-right padding-right-10 border-none">
</td>
</tr>
{/foreach}
</table>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">入库描述</label>
<div class="layui-input-block">
<textarea placeholder="请输入入库描述" title="请输入入库描述" class="layui-textarea" name="desc"></textarea>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="layui-form-item text-center">
{if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'/>{/if}
<button class="layui-btn" type='submit'>保存数据</button>
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
</div>
<script>window.form.render();</script>
</form>

View File

@ -3,11 +3,11 @@
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-open='{:url("$classuri/add")}' data-title="添加品牌" class='layui-btn layui-btn-sm'>添加品牌</button>
<button data-open='{:url("$classuri/add")}' data-title="添加品牌" class='layui-btn layui-btn-sm layui-btn-primary'>添加品牌</button>
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update="" data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除品牌</button>
<button data-update="" data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除品牌</button>
<!--{/if}-->
{/block}
@ -57,7 +57,7 @@
<th class='list-table-sort-td'>
<button type="submit" class="layui-btn layui-btn-normal layui-btn-xs">排 序</button>
</th>
<th class='text-left nowrap'>品品牌</th>
<th class='text-left nowrap'>品品牌</th>
<th class='text-left nowrap'>添加时间</th>
<th class='text-left nowrap'>品牌状态</th>
<th class='text-left'></th>

View File

@ -1,7 +1,7 @@
<form class="layui-form layui-box modal-form-box" action="{:request()->url()}" data-auto="true" method="post">
<div class="layui-form-item">
<label class="layui-form-label">品主分类</label>
<label class="layui-form-label">品主分类</label>
<div class="layui-input-block">
<select name='pid' class='layui-select full-width block'>
<!--{foreach cates as $cate}-->
@ -16,9 +16,9 @@
</div>
<div class="layui-form-item">
<label class="layui-form-label">品分类</label>
<label class="layui-form-label">品分类</label>
<div class="layui-input-block">
<input autofocus name="cate_title" value='{$vo.cate_title|default=""}' required title="请输入产品分类" placeholder="请输入产品分类" class="layui-input">
<input autofocus name="cate_title" value='{$vo.cate_title|default=""}' required title="请输入商品分类" placeholder="请输入商品分类" class="layui-input">
</div>
</div>

View File

@ -2,10 +2,10 @@
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("@$classuri/add")}' data-title="添加分类" class='layui-btn layui-btn-sm'>添加分类</button>
<button data-modal='{:url("@$classuri/add")}' data-title="添加分类" class='layui-btn layui-btn-sm layui-btn-primary'>添加分类</button>
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update="" data-field='delete' data-action='{:url("@$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除分类</button>
<button data-update="" data-field='delete' data-action='{:url("@$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除分类</button>
<!--{/if}-->
{/block}
@ -24,7 +24,7 @@
<th class='list-table-sort-td'>
<button type="submit" class="layui-btn layui-btn-normal layui-btn-xs">排 序</button>
</th>
<th class='text-left nowrap'>品分类</th>
<th class='text-left nowrap'>品分类</th>
<th class='text-left nowrap'>分类描述</th>
<th class='text-left nowrap'>添加时间</th>
<th class='text-center nowrap'>分类状态</th>

View File

@ -3,11 +3,11 @@
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("$classuri/add")}' data-title="添加规格" class='layui-btn layui-btn-sm'>添加规格</button>
<button data-modal='{:url("$classuri/add")}' data-title="添加规格" class='layui-btn layui-btn-sm layui-btn-primary'>添加规格</button>
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除规格</button>
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除规格</button>
<!--{/if}-->
{/block}

View File

@ -0,0 +1,60 @@
<form class="layui-form layui-box" style='padding:25px 30px 20px 0' action="{:request()->url()}" data-auto="true" method="post">
<div class="layui-form-item">
<label class="layui-form-label">收货人姓名</label>
<div class="layui-input-block">
<input class="layui-input" required placeholder="请输入收货人姓名" title="请输入收货人姓名" name="username" value="{$username}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">收货人手机</label>
<div class="layui-input-block">
<input class="layui-input" pattern="^1\d{10}$" required placeholder="请输入收货人手机" title="请输入收货人手机" name="phone" value="{$phone}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label label-required">收货省市区</label>
<div class="layui-input-block">
<div class="layui-col-xs4 padding-right-5">
<select name="form_express_province" class="layui-select block full-width" lay-ignore></select>
</div>
<div class="layui-col-xs4 padding-right-5">
<select name="form_express_city" class="layui-select block full-width" lay-ignore></select>
</div>
<div class="layui-col-xs4">
<select name="form_express_area" class="layui-select block full-width" lay-ignore></select>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">详细地址</label>
<div class="layui-input-block">
<textarea required placeholder="请输入详细地址" title="请输入详细地址" name="address" class="layui-textarea">{$address|default=""}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea required placeholder="请输入备注" title="请输入备注" name="desc" class="layui-textarea">{$desc|default=""}</textarea>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="layui-form-item text-center">
{if isset($order_no)}<input type='hidden' value='{$order_no}' name='order_no'>{/if}
<button class="layui-btn" type='submit'>保存数据</button>
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
</div>
<script>
require(['pcasunzips'], function () {
new PCAS('form_express_province', 'form_express_city', 'form_express_area', '{$province}', '{$city}', '{$area}');
});
</script>
</form>

View File

@ -0,0 +1,287 @@
{extend name='admin@public/content'}
{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">
<div class="layui-form-item layui-inline">
<label class="layui-form-label">会员手机</label>
<div class="layui-input-inline">
<input name="phone" value="{$Think.get.phone}" placeholder="请输入会员手机" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">会员昵称</label>
<div class="layui-input-inline">
<input name="nickname" value="{$Think.get.nickname}" placeholder="请输入会员昵称" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">订单单号</label>
<div class="layui-input-inline">
<input name="order_no" value="{$Think.get.order_no}" placeholder="请输入订单单号" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">订单状态</label>
<div class="layui-input-inline">
<select name="status" class="layui-select">
<option value="">所有订单</option>
<!--{foreach ["已取消","待付款","待发货","已发货","已完成","已退单","退单审核中","退款处理中"] as $k=>$v}-->
{if $Think.get.status eq "$k"}
<option selected="selected" value="{$k}">{$v}</option>
{else}
<option value="{$k}">{$v}</option>
{/if}
<!--{/foreach}-->
</select>
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">商品名称</label>
<div class="layui-input-inline">
<input name="goods_title" value="{$Think.get.goods_title}" placeholder="请输入商品名称" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">发货状态</label>
<div class="layui-input-inline">
<select name="send_status" class="layui-select">
<option value="">所有订单</option>
{foreach ['未发货','已发货'] as $k=>$v}
{if $Think.get.send_status eq "$k"}
<option selected="selected" value="{$k}">{$v}</option>
{else}
<option value="{$k}">{$v}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">是否包邮</label>
<div class="layui-input-inline">
<select name="express_zero" class="layui-select">
<option value="">所有订单</option>
{if $Think.get.express_zero == '0'}
<option selected="selected" value="0">不包邮</option>
{else}
<option value="0">不包邮</option>
{/if}
{if $Think.get.express_zero eq 1}
<option selected="selected" value="1">包邮</option>
{else}
<option value="1">包邮</option>
{/if}
</select>
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">下单时间</label>
<div class="layui-input-inline">
<input name="create_at" data-time value="{$Think.get.create_at}" placeholder="请选择下单时间" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">支付时间</label>
<div class="layui-input-inline">
<input name="pay_at" data-time value="{$Think.get.pay_at}" placeholder="请选择支付时间间" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">订单描述</label>
<div class="layui-input-inline">
<input name="order_desc" value="{$Think.get.order_desc}" placeholder="请输入订单描述" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">物流公司</label>
<div class="layui-input-inline">
<input name="company_title" value="{$Think.get.company_title}" placeholder="请输入物流公司" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">快递单号</label>
<div class="layui-input-inline">
<input name="send_no" value="{$Think.get.send_no}" placeholder="请输入快递单号" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">收货姓名</label>
<div class="layui-input-inline">
<input name="username" value="{$Think.get.username}" placeholder="请输入收货姓名" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">收货手机</label>
<div class="layui-input-inline">
<input name="phone" value="{$Think.get.phone}" placeholder="请输入收货手机" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">收货省份</label>
<div class="layui-input-inline">
<input name="province" value="{$Think.get.province}" placeholder="请输入收货省份" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">收货城市</label>
<div class="layui-input-inline">
<input name="city" value="{$Think.get.city}" placeholder="请输入收货城市" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">收货区域</label>
<div class="layui-input-inline">
<input name="area" value="{$Think.get.area}" placeholder="请输入收货区域" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">详细地址</label>
<div class="layui-input-inline">
<input name="address" value="{$Think.get.address}" placeholder="请输入详细地址" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
</div>
</form>
<script>
window.form.render();
$('[data-time]').map(function () {
window.laydate.render({range: true, elem: this});
});
</script>
<!-- 表单搜索 结束 -->
<form onsubmit="return false;" data-auto="true" method="post">
{if empty($list)}
<p class="help-block text-center well">没 有 记 录 哦!</p>
{else}
<table class="layui-table" lay-size="sm">
<thead>
<tr>
<th class='list-table-check-td'>
<input data-auto-none="none" data-check-target='.list-check-box' type='checkbox'/>
</th>
<th class="text-left">会员信息</th>
<th class="text-left">订单信息</th>
<th class="text-left nowrap padding-none">
<table class="layui-table think-inner-table">
<colgroup>
<col width="70%">
</colgroup>
<tr>
<td>商品信息</td>
<td class="text-right">
价格 <span class="layui-icon font-s12">&#x1006;</span> 数量
</td>
</tr>
</table>
</th>
<th class="text-left">发货信息</th>
</tr>
</thead>
<tbody>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td text-top'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
</td>
<td class="text-left text-top nowrap">
会员昵称:{$vo.member.nickname|default='<span class="color-desc">未设置会员昵称</span>'}<br>
会员手机:{$vo.member.phone|default='<span class="color-desc">未设置会员手机</span>'}
</td>
<td class="text-left text-top nowrap">
订单单号:<b>{$vo.order_no}</b> {if $vo.type eq 3}<span class="layui-badge-rim">套餐</span> {/if}
{switch name='vo.status'}
{case value='0'}<span class="layui-badge layui-bg-gray">已取消</span>{/case}
{case value='1'}<span class="layui-badge layui-bg-black">待付款</span>{/case}
{case value='2'}<span class="layui-badge layui-bg-blue">待发货</span>{/case}
{case value='3'}<span class="layui-badge layui-bg-orange">已发货</span>{/case}
{case value='4'}<span class="layui-badge layui-bg-green">已完成</span>{/case}
{case value='5'}<span class="layui-badge layui-bg-gray">已退单</span>{/case}
{case value='6'}<span class="layui-badge layui-bg-red">退款审核中({if($vo.refund_type == 1)}退款申请{/if}{if($vo.refund_type == 2)}退货申请{/if}</span>
<span class="margin-left-5"><a data-title="退款审核" data-modal="{:url('order/checkRefund')}?order_no={$vo.order_no}&id={$vo.id}">审核</a></span>{/case}
{case value='7'}<span class="layui-badge layui-bg-rown">退款处理中</span>{/case}
{/switch}
<br>
</td>
<td class="text-left text-top nowrap padding-none">
<table class="layui-table think-inner-table">
<colgroup>
<col width="70%">
</colgroup>
{foreach $vo.goods as $goods}
<tr>
<td>[{$goods.goods_id}] {$goods.goods_title}{$goods.goods_spec_alias}</td>
<td class="text-right">
<b>
{if in_array($vo.type,['1','3'])}
¥ {$goods[$goods['price_field']]}
{else}
{$goods.selling_integral} 积分
{/if}
<span class="layui-icon font-s12">&#x1006;</span>
{$goods.number}
</b>
</td>
</tr>
{/foreach}
</table>
</td>
<td class="text-left text-top nowrap">
{if empty($vo.express)}
<span class="color-desc">无发货信息</span>
{else}
快递公司:{$vo.express.real_company_title|default=$vo.express.company_title}
{if !empty($vo.express.real_company_title)}
<!--<span class="color-desc">{$vo.express.real_express_at|format_datetime|default='未发货'}</span>-->
{if $vo.express.real_company_title neq $vo.express.company_title}
<s class="color-desc">{$vo.express.company_title}</s>
{/if}
{/if}
<br>
快递单号:{$vo.express.real_express_no|default='<span class="layui-badge layui-bg-blue">未发货</span>'|raw}
<!--{if auth('store/deliver/tracking') and !empty($vo.express.real_express_no)}-->
<a data-modal="{:url('store/deliver/tracking')}?express_code={$vo.express.real_express_code}&express_no={$vo.express.real_express_no}&company_title={$vo.express.real_company_title}" data-title="追踪物流">查看</a>
<!--{elseif auth('store/deliver/express') and $vo.status eq 2 and $vo.is_pay eq 1}-->
<a data-title="快速发货" data-modal="{:url('store/deliver/express')}?order_no={$vo.order_no}">快速发货</a>
<!--{/if}-->
<br>
收货信息:{$vo.express.username} {$vo.express.phone}<br>
收货地址:{$vo.express.province}{$vo.express.city}{$vo.express.area}{$vo.express.address}
{if auth('store/order/address')}<a data-title="修改收货人信息" data-modal="{:url('order/address')}?order_no={$vo.order_no}">修改</a>{/if}
{/if}
{if !empty($vo.express.real_express_at)}<br>发货时间:{$vo.express.real_express_at|format_datetime}{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
{if isset($page)}<p>{$page|raw}</p>{/if}
{/if}
</form>
{/block}

View File

@ -14,6 +14,7 @@
namespace think;
use service\NodeService;
use think\exception\HttpResponseException;
return [
@ -21,7 +22,7 @@ return [
'action_begin' => function () {
$request = app('request');
list($module, $controller, $action) = [$request->module(), $request->controller(), $request->action()];
$node = strtolower("{$module}/{$controller}/{$action}");
$node = NodeService::parseNodeStr("{$module}/{$controller}/{$action}");
$info = Db::name('SystemNode')->cache(true, 30)->where(['node' => $node])->find();
$access = ['is_menu' => intval(!empty($info['is_menu'])), 'is_auth' => intval(!empty($info['is_auth'])), 'is_login' => empty($info['is_auth']) ? intval(!empty($info['is_login'])) : 1];
// 登录状态检查
@ -34,6 +35,6 @@ return [
throw new HttpResponseException(json(['code' => 0, 'msg' => '抱歉,您没有访问该模块的权限!']));
}
// 模板常量声明
app('view')->init(config('template.'))->assign(['classuri' => "{$module}/{$controller}"]);
app('view')->init(config('template.'))->assign(['classuri' => NodeService::parseNodeStr("{$module}/{$controller}")]);
},
];

View File

@ -55,6 +55,7 @@ class Config extends BasicAdmin
if ($this->request->get('appid', false)) {
sysconf('wechat_thr_appid', $data['appid']);
sysconf('wechat_thr_appkey', $data['appkey']);
sysconf('wechat_type', 'thr');
WechatService::config()->setApiNotifyUri($thrNotifyUrl);
}
try {
@ -83,7 +84,7 @@ class Config extends BasicAdmin
}
LogService::write('微信管理', '修改微信接口参数成功');
} catch (\Exception $e) {
$this->error('微信授权保存失败 , 请稍候重试 ! ' . $e->getMessage());
$this->error('微信授权保存成功, 但授权验证失败 ! <br>' . $e->getMessage());
}
$this->success('微信授权数据修改成功!', url('@admin') . "#" . url('@wechat/config/index'));
}

View File

@ -26,7 +26,7 @@ use think\Db;
* @author Anyon <zoujingli@qq.com>
* @date 2017/03/27 14:43
*/
class Block extends BasicAdmin
class FansBlock extends BasicAdmin
{
/**

View File

@ -151,8 +151,7 @@ class Keys extends BasicAdmin
public function subscribe()
{
$this->assign('title', '编辑默认回复');
$extend = ['keys' => 'subscribe'];
return $this->_form($this->table, 'form', 'keys', $extend, $extend);
return $this->_form($this->table, 'form', 'keys', [], ['keys' => 'subscribe']);
}
@ -167,8 +166,7 @@ class Keys extends BasicAdmin
public function defaults()
{
$this->assign('title', '编辑无配置默认回复');
$extend = ['keys' => 'default'];
return $this->_form($this->table, 'form', 'keys', $extend, $extend);
return $this->_form($this->table, 'form', 'keys', [], ['keys' => 'default']);
}
/**

View File

@ -150,8 +150,7 @@ class Menu extends BasicAdmin
} else {
$row['url'] = url($row['content'], '', true, true);
}
} elseif
($row['type'] === 'event') {
} elseif ($row['type'] === 'event') {
if (isset($this->menuType[$row['content']])) {
list($row['type'], $row['key']) = [$row['content'], "wechat_menu#id#{$row['id']}"];
}

View File

@ -254,8 +254,7 @@ class News extends BasicAdmin
$data['filter'] = ['is_to_all' => false, 'tag_id' => join(',', $post['fans_tags'])];
$data['mpnews'] = ['media_id' => $newsinfo['media_id']];
}
$wechat = WechatService::custom();
if (false !== $wechat->massSendAll($data)) {
if (WechatService::custom()->massSendAll($data)) {
LogService::write('微信管理', "图文[{$news_id}]推送成功");
$this->success('微信图文推送成功!', '');
}

View File

@ -49,7 +49,7 @@ class Push
protected $receive;
/**
* 微信消息接口(通过ThinkService推送)
* 微信消息接口(来自ThinkService授权的消息推送)
* @return string
* @throws \think\Exception
* @throws \think\exception\PDOException
@ -61,13 +61,13 @@ class Push
$this->openid = $request->post('openid', '', null);
$this->receive = unserialize($request->post('receive', '', null));
if (empty($this->appid) || empty($this->openid) || empty($this->receive)) {
throw new Exception('微信API实例缺失必要参数[appid,openid,event].');
throw new Exception('微信API实例缺失必要参数[appid,openid,receive].');
}
return $this->call($this->appid, $this->openid, $this->receive);
return $this->init();
}
/**
* 公众号直接对接(通过参数对接推送)
* 微信消息接口(来自在公众号官方的消息推送)
* @return string
* @throws \think\Exception
* @throws \think\exception\PDOException
@ -75,21 +75,20 @@ class Push
public function notify()
{
$wechat = WechatService::receive();
return $this->call(WechatService::getAppid(), $wechat->getOpenid(), $wechat->getReceive());
$this->openid = $wechat->getOpenid();
$this->receive = $wechat->getReceive();
$this->appid = WechatService::getAppid();
return $this->init();
}
/**
* 初始化接口
* @param string $appid 公众号APPID
* @param string $openid 公众号OPENID
* @param array $revice 消息对象
* @return string
* @throws \think\Exception
* @throws Exception
* @throws \think\exception\PDOException
*/
protected function call($appid, $openid, $revice)
private function init()
{
list($this->appid, $this->openid, $this->receive) = [$appid, $openid, $revice];
if ($this->appid !== WechatService::getAppid()) {
throw new Exception('微信API实例APPID验证失败.');
}
@ -281,7 +280,7 @@ class Push
/**
* 更新推荐二维码关系
* @param string $key
* @param string $openid
* @return bool
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
@ -289,10 +288,10 @@ class Push
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
protected function updateSpread($key)
protected function updateSpread($openid)
{
// 检测推荐是否有效
$fans = Db::name('WechatFans')->where(['openid' => $key])->find();
$fans = Db::name('WechatFans')->where('openid', $openid)->find();
if (empty($fans['openid']) || $fans['openid'] === $this->openid) {
return false;
}
@ -319,7 +318,7 @@ class Push
FansService::set($userInfo);
} else {
$fans = ['subscribe' => '0', 'openid' => $this->openid, 'appid' => $this->appid];
DataService::save('WechatFans', $fans, 'openid', ['appid' => $this->appid]);
DataService::save('WechatFans', $fans, 'openid', [['appid', 'eq', $this->appid]]);
}
}

View File

@ -64,7 +64,7 @@ class MediaService
public static function uploadImage($local_url)
{
$map = ['md5' => md5($local_url)];
if (!($media_url = Db::name('WechatNewsImage')->where($map)->value('media_url'))) {
if (($media_url = Db::name('WechatNewsImage')->where($map)->value('media_url'))) {
return $media_url;
}
$info = WechatService::media()->uploadImg(self::getServerPath($local_url));
@ -72,7 +72,7 @@ class MediaService
WechatService::wechat()->rmFile($local_url);
}
$data = ['local_url' => $local_url, 'media_url' => $info['url'], 'md5' => $map['md5']];
DataService::save('WechatNewsImage', $data, 'md5', ['type' => 'image']);
DataService::save('WechatNewsImage', $data, 'md5');
return $info['url'];
}

View File

@ -33,10 +33,22 @@
<img class="notselect" data-tips-image src="{:url('@wechat/api.tools/oauth_qrc')}" style="width:80px;margin-left:-4px">
<p class="text-center" style="margin-left:-10px">网页授权</p>
</div>
<div class="pull-left padding-left-0">
<div class="pull-left padding-left-0 padding-right-15">
<img class="notselect" data-tips-image src="{:url('@wechat/api.tools/jssdk_qrc')}" style="width:80px;">
<p class="text-center">JSSDK签名</p>
</div>
<div class="pull-left padding-left-0 padding-right-15">
<img class="notselect" data-tips-image src="{:url('@wx-demo-jsapiqrc')}" style="width:80px;">
<p class="text-center">JSAPI支付</p>
</div>
<div class="pull-left padding-left-0 padding-right-15">
<img class="notselect" data-tips-image src="{:url('@wx-demo-scanoneqrc')}" style="width:80px;">
<p class="text-center">扫码支付①</p>
</div>
<div class="pull-left padding-left-0">
<img class="notselect" data-tips-image src="{:url('@wx-demo-scanqrc')}" style="width:80px;">
<p class="text-center">扫码支付②</p>
</div>
</div>
</div>
@ -92,7 +104,7 @@
</div>
<div class="pull-left padding-left-10">
<p class="margin-bottom-2 nowrap">微信昵称:{$wechat.nick_name}</p>
<p class="margin-bottom-2 nowrap">微信类型:{$wechat.service_type_info == 2 ? '服务号' : '订阅号'} /
<p class="margin-bottom-2 nowrap">微信类型:{if $wechat.service_type eq 2}服务号{elseif $wechat.service_type eq 3}小程序{else}订阅号{/if} /
{$wechat.verify_type_info == -1 ? '未认证' : '<span class="color-green">已认证</span>'}</p>
<p class="margin-bottom-2 nowrap">注册公司:{$wechat.principal_name}</p>
<p class=" nowrap">授权绑定:{$wechat.create_at|format_datetime}</p>

View File

@ -2,89 +2,16 @@
{block name="button"}
<!--{if auth("$classuri/backadd")}-->
<button data-update data-action="{:url('backadd')}" class='layui-btn layui-btn-sm layui-btn-danger'>批量拉黑</button>
<button data-update data-action="{:url('backadd')}" class='layui-btn layui-btn-sm layui-btn-primary'>批量拉黑粉丝</button>
<!--{/if}-->
<!--{if auth("$classuri/sync")}-->
<button data-load="{:url('sync')}" class='layui-btn layui-btn-sm'>远程获取粉丝</button>
<button data-load="{:url('sync')}" class='layui-btn layui-btn-sm layui-btn-primary'>远程获取粉丝</button>
<!--{/if}-->
{/block}
{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">
<div class="layui-form-item layui-inline">
<label class="layui-form-label">昵 称</label>
<div class="layui-input-inline">
<input name="nickname" placeholder="请输入昵称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">性 别</label>
<div class="layui-input-inline">
<select name="sex" class="layui-select">
<option value="">- 性别 -</option>
<!--{foreach [1=>'男',2=>'女'] as $key=>$sex}-->
<!--{if $Think.get.sex eq $key.''}-->
<option selected value="{$key}">- {$sex} -</option>
<!--{else}-->
<option value="{$key}">- {$sex} -</option>
<!--{/if}-->
<!--{/foreach}-->
</select>
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">标 签</label>
<div class="layui-input-inline">
<select name="tag" class="layui-select" lay-search="true">
<option value="">- 粉丝标签 -</option>
<!--{foreach $tags as $key=>$tag}-->
<!--{if $Think.get.tag eq $key}-->
<option selected value="{$key}">{$tag}</option>
<!--{else}-->
<option value="{$key}">{$tag}</option>
<!--{/if}-->
<!--{/foreach}-->
</select>
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">国 家</label>
<div class="layui-input-inline">
<input name="country" value="{$Think.get.country|default=''}" placeholder="请输入国家" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">省 份</label>
<div class="layui-input-inline">
<input name="province" value="{$Think.get.province|default=''}" placeholder="请输入省份" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">城 市</label>
<div class="layui-input-inline">
<input name="city" value="{$Think.get.city|default=''}" placeholder="请输入城市" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">时 间</label>
<div class="layui-input-inline">
<input name="create_at" id='create_at' value="{$Think.get.create_at|default=''}" placeholder="关注时间" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
</div>
</form>
{include file='wechat@fans/search_inc'}
<!-- 表单搜索 结束 -->
<form onsubmit="return false;" data-auto="true" method="post">

View File

@ -0,0 +1,74 @@
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">
<div class="layui-form-item layui-inline">
<label class="layui-form-label">昵 称</label>
<div class="layui-input-inline">
<input name="nickname" placeholder="请输入昵称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">性 别</label>
<div class="layui-input-inline">
<select name="sex" class="layui-select">
<option value="">- 性别 -</option>
<!--{foreach [1=>'男',2=>'女'] as $key=>$sex}-->
<!--{if $Think.get.sex eq $key.''}-->
<option selected value="{$key}">- {$sex} -</option>
<!--{else}-->
<option value="{$key}">- {$sex} -</option>
<!--{/if}-->
<!--{/foreach}-->
</select>
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">标 签</label>
<div class="layui-input-inline">
<select name="tag" class="layui-select" lay-search="true">
<option value="">- 粉丝标签 -</option>
<!--{foreach $tags as $key=>$tag}-->
<!--{if $Think.get.tag eq $key}-->
<option selected value="{$key}">{$tag}</option>
<!--{else}-->
<option value="{$key}">{$tag}</option>
<!--{/if}-->
<!--{/foreach}-->
</select>
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">国 家</label>
<div class="layui-input-inline">
<input name="country" value="{$Think.get.country|default=''}" placeholder="请输入国家" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">省 份</label>
<div class="layui-input-inline">
<input name="province" value="{$Think.get.province|default=''}" placeholder="请输入省份" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">城 市</label>
<div class="layui-input-inline">
<input name="city" value="{$Think.get.city|default=''}" placeholder="请输入城市" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">时 间</label>
<div class="layui-input-inline">
<input name="create_at" id='create_at' value="{$Think.get.create_at|default=''}" placeholder="关注时间" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
</div>
</form>

View File

@ -2,89 +2,16 @@
{block name="button"}
<!--{if auth('wechat/block/backdel')}-->
<button data-update="" data-action="{:url('backdel')}" class='layui-btn layui-btn-sm'>移出黑名单</button>
<button data-update="" data-action="{:url('backdel')}" class='layui-btn layui-btn-sm layui-btn-primary'>批量移出粉丝</button>
<!--{/if}-->
<!--{if auth('wechat/fans/sync')}-->
<button data-load="{:url('wechat/fans/sync')}" class='layui-btn layui-btn-sm'>远程获取粉丝</button>
<button data-load="{:url('wechat/fans/sync')}" class='layui-btn layui-btn-sm layui-btn-primary'>远程获取粉丝</button>
<!--{/if}-->
{/block}
{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">
<div class="layui-form-item layui-inline">
<label class="layui-form-label">昵 称</label>
<div class="layui-input-inline">
<input name="nickname" placeholder="请输入昵称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">性 别</label>
<div class="layui-input-inline">
<select name="sex" class="layui-select">
<option value="">- 性别 -</option>
<!--{foreach [1=>'男',2=>'女'] as $key=>$sex}-->
<!--{if $Think.get.sex eq $key.''}-->
<option selected value="{$key}">- {$sex} -</option>
<!--{else}-->
<option value="{$key}">- {$sex} -</option>
<!--{/if}-->
<!--{/foreach}-->
</select>
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">标 签</label>
<div class="layui-input-inline">
<select name="tag" class="layui-select" lay-search="true">
<option value="">- 粉丝标签 -</option>
<!--{foreach $tags as $key=>$tag}-->
<!--{if $Think.get.tag eq $key}-->
<option selected value="{$key}">{$tag}</option>
<!--{else}-->
<option value="{$key}">{$tag}</option>
<!--{/if}-->
<!--{/foreach}-->
</select>
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">国 家</label>
<div class="layui-input-inline">
<input name="country" value="{$Think.get.country|default=''}" placeholder="请输入国家" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">省 份</label>
<div class="layui-input-inline">
<input name="province" value="{$Think.get.province|default=''}" placeholder="请输入省份" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">城 市</label>
<div class="layui-input-inline">
<input name="city" value="{$Think.get.city|default=''}" placeholder="请输入城市" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">时 间</label>
<div class="layui-input-inline">
<input name="create_at" id='create_at' value="{$Think.get.create_at|default=''}" placeholder="关注时间" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
</div>
</form>
{include file='wechat@fans/search_inc'}
<!-- 表单搜索 结束 -->
<form onsubmit="return false;" data-auto="true" method="post">

View File

@ -3,11 +3,11 @@
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-open="{:url('add')}" class='layui-btn layui-btn-sm'>添加规则</button>
<button data-open="{:url('add')}" class='layui-btn layui-btn-sm layui-btn-primary'>添加规则</button>
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除规则</button>
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除规则</button>
<!--{/if}-->
{/block}

View File

@ -1,47 +1,5 @@
{extend name='admin@public/content'}
{block name="style"}
<style>
.menu-editor {
left: 317px;
width: 500px;
height: 580px;
display: block;
max-width: 500px;
border-radius: 0;
box-shadow: none;
border-color: #e7e7eb;
}
.menu-editor textarea:active, .menu-editor textarea:focus {
box-shadow: none
}
.menu-editor .arrow {
top: auto !important;
bottom: 15px
}
.menu-editor .popover-title {
margin-top: 0
}
.menu-editor textarea, .menu-editor input[type=text] {
border-radius: 0
}
.menu-editor .menu-item-deleted {
font-weight: 400;
font-size: 12px
}
.menu-submit-container {
width: 780px;
padding-top: 40px
}
</style>
{/block}
{block name='content'}
<div class='mobile-preview pull-left notselect'>
<div class='mobile-header'>公众号</div>
@ -80,8 +38,10 @@
<div class="popover fade right up in menu-editor">
<div class="arrow"></div>
<h3 class="popover-title">
菜单名称
{if auth("$classuri/edit")}<a class="pull-right menu-item-deleted">删除</a>{/if}
微信菜单编辑
{if auth("$classuri/edit")}
<button type="button" class="pull-right menu-item-deleted layui-btn layui-btn-sm layui-btn-danger">移除菜单项</button>
{/if}
</h3>
<div class="popover-content menu-content"></div>
</div>
@ -91,9 +51,9 @@
<form class="form-horizontal">
<p class="help-block text-center">已添加子菜单,仅可设置菜单名称。</p>
<div class="form-group margin-top-20">
<label class="col-xs-3 control-label">菜单名称</label>
<label class="col-xs-3 control-label label-required">菜单名称</label>
<div class="col-xs-8">
<input name="menu-name" class="layui-input block">
<input name="menu-name" class="layui-input">
<span class="help-block m-b-none">字数不超过5个汉字或16个字母</span>
</div>
</div>
@ -242,13 +202,10 @@
$html.find('input[name="menu-type"]').on('click', function () {
var type = this.value, content = $span.data('content') || '请输入内容';
$span.attr('data-type', this.value || 'text').data('content', content);
var html = (function () {
var $edit = $((function () {
switch (type) {
case 'miniprogram':
var tpl = '<div>\
<div>appid<input class="layui-input block margin-bottom-10" value="{appid}" name="appid"></div>\
<div>url<input class="layui-input block margin-bottom-10" value="{url}" name="url"></div>\
<div>pagepath<input name="pagepath" class="layui-input block" value={pagepath}></div></div>';
var tpl = '<div><div>小程序的appid<input class="layui-input block margin-bottom-10" value="{appid}" name="appid"></div><div>小程序网页链接<input class="layui-input block margin-bottom-10" value="{url}" name="url"></div><div>小程序的页面路径<input name="pagepath" class="layui-input block" value={pagepath}></div></div>';
var _appid = '', _pagepath = '', _url = '';
if (content.indexOf(',') > 0) {
_appid = content.split(',')[0] || '';
@ -261,7 +218,12 @@
case 'text':
return '<div>回复内容<textarea style="resize:none;height:225px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
case 'view':
return '<div>跳转地址<textarea style="resize:none;height:225px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
var wxMenu = eval('{$GLOBALS.WechatMenuLink|default=[]|json_encode|raw}');
var wxMenuHtml = '<div>常用链接<select id="wxMenuLinkSelecter" class="layui-select full-width"><option value="">自定义地址</option>';
for (var i in wxMenu) {
wxMenuHtml += '<option value="' + wxMenu[i].link + '">' + wxMenu[i].title + '</option>';
}
return wxMenuHtml + '</select>跳转链接<textarea id="wxMenuLinkContent" style="resize:none;height:167px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
case 'keys':
return '<div>匹配内容<textarea style="resize:none;height:225px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
case 'event':
@ -283,20 +245,34 @@
}
return select.join('');
}
}).call(this);
var $html = $(html), $input = $html.find('input,textarea');
$input.on('change keyup click', function () {
// 将input值写入到span上
})());
// 参数编辑器数据输入绑定
$edit.find('input,textarea').on('keyup', function () {
$span.data(this.name, $(this).val() || $(this).html());
// 如果是小程序合并内容到span的content上
if (type === 'miniprogram') {
$span.data('content', $span.data('appid') + ',' + $span.data('url') + ',' + $span.data('pagepath'));
// 打开小程序,拼接参数并绑定
$span.data('content', [$span.data('appid'), $span.data('url'), $span.data('pagepath')].join(','));
} else if (type === 'view') {
// 跳转网页,自定义链接自动切换选择
$('#wxMenuLinkSelecter option').map(function () {
this.selected = this.value === $span.data('content');
});
}
});
$('.editor-content-input').html($html);
}).filter('input[value="{type}"]'.replace('{type}', type)).trigger('click');
// 显示参数编辑器
$('.editor-content-input').html($edit);
// 跳转网页处理选择器切换,事件监听
if (type === 'view') {
$('#wxMenuLinkSelecter option').map(function () {
this.selected = this.value === content;
});
$('body').off('change', '#wxMenuLinkSelecter').on('change', '#wxMenuLinkSelecter', function () {
$('#wxMenuLinkContent').val(this.options[this.selectedIndex].value || '#').trigger('keyup');
});
}
}).filter('input[value="' + type + '"]').trigger('click');
};
// 提交微信菜单数据
this.submit = function () {
var data = [];
$('li.parent-menu').map(function (index, item) {
@ -330,4 +306,50 @@
};
});
</script>
{/block}
{block name="style"}
<style>
.menu-editor {
left: 317px;
width: 500px;
height: 580px;
display: block;
max-width: 500px;
border-radius: 0;
box-shadow: none;
border-color: #e7e7eb;
}
.menu-editor textarea:active, .menu-editor textarea:focus {
box-shadow: none
}
.menu-editor .arrow {
top: auto !important;
bottom: 15px
}
.menu-editor .popover-title {
height: 58px;
padding: 12px;
margin-top: 0;
font-size: 14px;
line-height: 40px;
}
.menu-editor textarea, .menu-editor input[type=text] {
border-radius: 0
}
.menu-editor .menu-item-deleted {
font-weight: 400;
font-size: 12px
}
.menu-submit-container {
width: 780px;
padding-top: 40px
}
</style>
{/block}

View File

@ -1,7 +1,7 @@
{extend name='admin@public/content'}
{block name="button"}
<button data-open="{:url('add')}" class='layui-btn layui-btn-sm'>添加图文</button>
<button data-open="{:url('add')}" class='layui-btn layui-btn-sm layui-btn-primary'>添加图文</button>
{/block}
{block name='content'}

View File

@ -3,15 +3,15 @@
{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal="{:url('add')}" data-title="添加标签" class='layui-btn layui-btn-sm'> 添加标签</button>
<button data-modal="{:url('add')}" data-title="添加标签" class='layui-btn layui-btn-sm layui-btn-primary'> 添加标签</button>
<!--{/if}-->
<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'> 删除标签</button>
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'> 删除标签</button>
<!--{/if}-->
<!--{if auth("$classuri/sync")}-->
<button data-load="{:url('sync')}" class='layui-btn layui-btn-sm'> 远程获取标签</button>
<button data-load="{:url('sync')}" class='layui-btn layui-btn-sm layui-btn-primary'> 远程获取标签</button>
<!--{/if}-->
{/block}

View File

@ -13,7 +13,6 @@
// +----------------------------------------------------------------------
return [
// 数据库类型
'type' => 'mysql',
// 服务器地址
'hostname' => '127.0.0.1',

View File

@ -14,4 +14,8 @@
return [
'service_url' => 'https://service.thinkadmin.top',
// 下面参数用作微信支付
'appid' => 'wx60a43dd8161666d4',
'mch_id' => '1332187001',
'mch_key' => 'A82DC5BD1F3359081049C568D8502BC5',
];

View File

@ -115,7 +115,7 @@ class BasicAdmin extends Controller
$rows = intval($this->request->get('rows', cookie('page-rows')));
cookie('page-rows', $rows = $rows >= 10 ? $rows : 20);
// 分页数据处理
$query = $this->request->get('', '', 'urlencode');
$query = $this->request->get();
$page = $db->paginate($rows, $total, ['query' => $query]);
if (($totalNum = $page->total()) > 0) {
list($rowsHTML, $pageHTML, $maxNum) = [[], [], $page->lastPage()];

View File

@ -14,8 +14,10 @@
namespace controller;
use app\store\service\MemberService;
use service\WechatService;
use think\Controller;
use think\Db;
/**
* 微信基础控制器
@ -31,6 +33,29 @@ class BasicWechat extends Controller
*/
protected $openid;
/**
* 当前会员数据记录
* @var array
*/
protected $member = [];
/**
* 初始化会员数据记录
* @throws \think\Exception
* @throws \think\exception\PDOException
* @return array
*/
protected function initMember()
{
$openid = $this->getOpenid();
$this->member = Db::name('StoreMember')->where(['openid' => $openid])->find();
if (empty($this->member)) {
MemberService::create(['openid' => $openid]);
$this->member = Db::name('StoreMember')->where(['openid' => $openid])->find();
}
return $this->member;
}
/**
* 获取粉丝用户OPENID
* @return bool|string
@ -39,7 +64,8 @@ class BasicWechat extends Controller
*/
protected function getOpenid()
{
return WechatService::webOauth(0)['openid'];
$url = $this->request->url(true);
return WechatService::webOauth($url, 0)['openid'];
}
/**
@ -51,7 +77,8 @@ class BasicWechat extends Controller
*/
protected function getFansinfo()
{
return WechatService::webOauth(1)['fansinfo'];
$url = $this->request->url(true);
return WechatService::webOauth($url, 1)['fansinfo'];
}
}

View File

@ -0,0 +1,175 @@
<?php
// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace service;
/**
* 阿里云短信服务
* Class AlismsService
* @package service
*
* @config 需要在config目录定义aliyun.php配置文件
* @configParam aliyun.SmsAppid 阿里云短信APPID
* @configParam aliyun.SmsAppkey 阿里云短信APPKEY
*/
class AlismsService
{
/**
* 短信SDK版本信息
* @var array
*/
private static $sdkVersion = [
"RegionId" => "cn-hangzhou",
"Action" => "SendBatchSms",
"Version" => "2017-05-25",
];
/**
* 短信发送记录查询
* @param string $PhoneNumber 短信接收号码
* @param string $SendDate 短信发送日期格式Ymd支持近30天记录查询
* @param integer $PageSize 分页大小
* @param integer $CurrentPage 当前页码
* @param null|string $BizId 设置发送短信流水号(可选)
* @return bool|array
*/
public static function query($PhoneNumber, $SendDate, $PageSize = 10, $CurrentPage = 1, $BizId = null)
{
$params = [];
$params["SendDate"] = $SendDate;
$params["PageSize"] = $PageSize;
$params["CurrentPage"] = $CurrentPage;
$params["PhoneNumber"] = $PhoneNumber;
is_null($BizId) || $params["BizId"] = $BizId;
return self::request("dysmsapi.aliyuncs.com", array_merge($params, self::$sdkVersion), true);
}
/**
* 批量发送短信
* @param array $PhoneNumbers 待发送手机号
* @param string $TemplateCode 短信模板Code
* @param array $SignNames 短信签名
* @param array $TemplateParams 模板中的变量
* @param array $SmsUpExtendCodes 上行短信扩展码
* @return bool|array
*/
public static function batchSend(array $PhoneNumbers, $TemplateCode, array $SignNames, array $TemplateParams, $SmsUpExtendCodes = [])
{
$params = [];
$params["TemplateCode"] = $TemplateCode;
!empty($SmsUpExtendCodes) && $params["SmsUpExtendCodeJson"] = json_encode($SmsUpExtendCodes);
$params["TemplateParamJson"] = json_encode($TemplateParams, JSON_UNESCAPED_UNICODE);
$params["SignNameJson"] = json_encode($SignNames, JSON_UNESCAPED_UNICODE);
$params["PhoneNumberJson"] = json_encode($PhoneNumbers, JSON_UNESCAPED_UNICODE);
if (!empty($params["SmsUpExtendCodeJson"]) && is_array($params["SmsUpExtendCodeJson"])) {
$params["SmsUpExtendCodeJson"] = json_encode($params["SmsUpExtendCodeJson"], JSON_UNESCAPED_UNICODE);
}
return self::request("dysmsapi.aliyuncs.com", array_merge($params, self::$sdkVersion), true);
}
/**
* 发送短信
* @param string $PhoneNumbers 短信接收号码
* @param string $TemplateCode 短信模板Code
* @param string $SignName 短信签名
* @param array $TemplateParam 设置模板参数
* @param null|string $OutId 设置发送短信流水号(可选)
* @param null|string $SmsUpExtendCode 上行短信扩展码(可选)
* @return bool|array
*/
public static function send($PhoneNumbers, $TemplateCode, $SignName, array $TemplateParam, $OutId = null, $SmsUpExtendCode = null)
{
$params = [];
$params["SignName"] = $SignName;
$params["TemplateCode"] = $TemplateCode;
$params["PhoneNumbers"] = $PhoneNumbers;
$params['TemplateParam'] = $TemplateParam;
is_null($OutId) || $params['OutId'] = $OutId;
is_null($SmsUpExtendCode) || $params['SmsUpExtendCode'] = $SmsUpExtendCode;
if (!empty($params["TemplateParam"]) && is_array($params["TemplateParam"])) {
$params["TemplateParam"] = json_encode($params["TemplateParam"], JSON_UNESCAPED_UNICODE);
}
return self::request("dysmsapi.aliyuncs.com", array_merge($params, self::$sdkVersion), true);
}
/**
* 生成签名并发起请求
* @param $domain string API接口所在域名
* @param $params array API具体参数
* @param $security boolean 使用https
* @return bool|array 返回API接口调用结果当发生错误时返回false
*/
public static function request($domain, $params, $security = false)
{
$apiParams = array_merge([
"SignatureMethod" => "HMAC-SHA1",
"SignatureNonce" => uniqid(mt_rand(0, 0xffff), true),
"SignatureVersion" => "1.0",
"AccessKeyId" => config('aliyun.SmsAppid'),
"Timestamp" => gmdate("Y-m-d\TH:i:s\Z"),
"Format" => "JSON",
], $params);
ksort($apiParams);
$sortedQueryStringTmp = "";
foreach ($apiParams as $key => $value) {
$sortedQueryStringTmp .= "&" . self::encode($key) . "=" . self::encode($value);
}
$stringToSign = "GET&%2F&" . self::encode(substr($sortedQueryStringTmp, 1));
$sign = base64_encode(hash_hmac("sha1", $stringToSign, config('aliyun.SmsAppkey') . "&", true));
$signature = self::encode($sign);
$url = ($security ? 'https' : 'http') . "://{$domain}/?Signature={$signature}{$sortedQueryStringTmp}";
try {
return json_decode(self::fetchContent($url), true);
} catch (\Exception $e) {
return false;
}
}
/**
* 数据编码处理
* @param string $str
* @return null|string
*/
private static function encode($str)
{
$res = urlencode($str);
$res = preg_replace("/\+/", "%20", $res);
$res = preg_replace("/\*/", "%2A", $res);
$res = preg_replace("/%7E/", "~", $res);
return $res;
}
/**
* 网络请求
* @param string $url 请求URL
* @return mixed
*/
private static function fetchContent($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-sdk-client" => "php/2.0.0"]);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$rtn = curl_exec($ch);
if ($rtn === false) {
trigger_error("[CURL_" . curl_errno($ch) . "]: " . curl_error($ch), E_USER_ERROR);
}
curl_close($ch);
return $rtn;
}
}

View File

@ -76,11 +76,11 @@ class DataService
public static function save($dbQuery, $data, $key = 'id', $where = [])
{
$db = is_string($dbQuery) ? Db::name($dbQuery) : $dbQuery;
$where[] = [$key, 'eq', isset($data[$key]) ? $data[$key] : ''];
if (Db::table($db->getTable())->where($where)->count() > 0) {
return Db::table($db->getTable())->strict(false)->where($where)->update($data) !== false;
list($table, $map) = [$db->getTable(), [$key => isset($data[$key]) ? $data[$key] : '']];
if (Db::table($table)->where($where)->where($map)->count() > 0) {
return Db::table($table)->strict(false)->where($where)->where($map)->update($data) !== false;
}
return Db::table($db->getTable())->strict(false)->insert($data) !== false;
return Db::table($table)->strict(false)->insert($data) !== false;
}
/**
@ -95,18 +95,18 @@ class DataService
{
$request = app('request');
$db = is_string($dbQuery) ? Db::name($dbQuery) : $dbQuery;
list($pk, $table) = [$db->getPk(), $db->getTable()];
list($pk, $table, $map) = [$db->getPk(), $db->getTable(), []];
list($field, $value) = [$request->post('field', ''), $request->post('value', '')];
$where[] = [empty($pk) ? 'id' : $pk, 'in', explode(',', $request->post('id', ''))];
$map[] = [empty($pk) ? 'id' : $pk, 'in', explode(',', $request->post('id', ''))];
// 删除模式,如果存在 is_deleted 字段使用软删除
if ($field === 'delete') {
if (method_exists($db, 'getTableFields') && in_array('is_deleted', $db->getTableFields())) {
return Db::table($table)->where($where)->update(['is_deleted' => '1']) !== false;
return Db::table($table)->where($where)->where($map)->update(['is_deleted' => '1']) !== false;
}
return Db::table($table)->where($where)->delete() !== false;
return Db::table($table)->where($where)->where($map)->delete() !== false;
}
// 更新模式,更新指定字段内容
return Db::table($table)->where($where)->update([$field => $value]) !== false;
return Db::table($table)->where($where)->where($map)->update([$field => $value]) !== false;
}
}

View File

@ -73,7 +73,7 @@ class NodeService
public static function checkAuthNode($node)
{
list($module, $controller, $action) = explode('/', str_replace(['?', '=', '&'], '/', $node . '///'));
$currentNode = strtolower(trim("{$module}/{$controller}/{$action}", '/'));
$currentNode = self::parseNodeStr("{$module}/{$controller}") . strtolower("/{$action}");
if (session('user.username') === 'admin' || stripos($node, 'admin/index') === 0) {
return true;
}
@ -129,13 +129,27 @@ class NodeService
}
foreach (get_class_methods($className) as $funcName) {
if (strpos($funcName, '_') !== 0 && $funcName !== 'initialize') {
$nodes[] = strtolower("{$matches[1]}/{$matches[2]}/{$funcName}");
$nodes[] = self::parseNodeStr("{$matches[1]}/{$matches[2]}") . '/' . strtolower($funcName);
}
}
}
return $nodes;
}
/**
* 驼峰转下划线规则
* @param string $node
* @return string
*/
public static function parseNodeStr($node)
{
$tmp = [];
foreach (explode('/', $node) as $name) {
$tmp[] = strtolower(trim(preg_replace("/[A-Z]/", "_\\0", $name), "_"));
}
return trim(join('/', $tmp), '/');
}
/**
* 获取所有PHP文件
* @param string $dirPath 目录

View File

@ -50,6 +50,7 @@ class SoapService
* @param string $name SOAP调用方法名
* @param array|string $arguments SOAP调用参数
* @return array|string|bool
* @throws \think\Exception
*/
public function __call($name, $arguments)
{
@ -57,8 +58,8 @@ class SoapService
return $this->soap->__soapCall($name, $arguments);
} catch (\Exception $e) {
Log::error("Soap Error. Call {$name} Method --- " . $e->getMessage());
throw new Exception($e->getMessage(), $e->getCode());
}
return false;
}
}

View File

@ -75,12 +75,13 @@ class WechatService
}
throw new Exception("Class '{$class}' not found");
case 'thr':
default:
list($appid, $appkey) = [sysconf('wechat_thr_appid'), sysconf('wechat_thr_appkey')];
$token = strtolower("{$name}-{$appid}-{$appkey}");
$location = config('wechat.service_url') . "/wechat/api.client/soap/{$token}.html";
$params = ['uri' => strtolower($name), 'location' => $location, 'trace' => true];
return new SoapService(null, $params);
default:
throw new Exception('请在后台配置微信对接授权模式!');
}
}
@ -88,19 +89,21 @@ class WechatService
* 获取微信网页JSSDK
* @param null|string $url JS签名地址
* @return array
* @throws Exception
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public static function webJsSDK($url = null)
{
$signUrl = is_null($url) ? app('request')->url(true) : $url;
switch (strtolower(sysconf('wechat_type'))) {
case 'api':
return WechatService::script()->getJsSign(is_null($url) ? app('request')->url(true) : $url);
return WechatService::script()->getJsSign($signUrl);
case 'thr':
return WechatService::wechat()->jsSign($signUrl);
default:
return WechatService::wechat()->jsSign(is_null($url) ? app('request')->url(true) : $url);
throw new Exception('请在后台配置微信对接授权模式!');
}
}
@ -135,15 +138,14 @@ class WechatService
if (isset($token['openid'])) {
session("{$appid}_openid", $openid = $token['openid']);
if (empty($fullMode) && request()->get('rcode')) {
redirect(decode(request()->get('rcode')))->send();
redirect(decode(request()->get('rcode')), [], 301)->send();
}
session("{$appid}_fansinfo", $fansinfo = $wechat->getUserInfo($token['access_token'], $openid));
empty($fansinfo) || FansService::set($fansinfo);
}
redirect(decode(request()->get('rcode')))->send();
redirect(decode(request()->get('rcode')), [], 301)->send();
break;
case 'thr':
default:
$service = self::wechat();
$result = $service->oauth(session_id(), $url, $fullMode);
session("{$appid}_openid", $openid = $result['openid']);
@ -156,6 +158,9 @@ class WechatService
redirect($result['url'], [], 301)->send();
}
exit("window.location.href='{$result['url']}'");
default:
throw new Exception('请在后台配置微信对接授权模式!');
}
}
@ -173,7 +178,7 @@ class WechatService
case 'thr':
return sysconf('wechat_thr_appid');
default:
return '';
throw new Exception('请在后台配置微信对接授权模式!');
}
}

View File

@ -17,5 +17,8 @@ namespace think;
// 加载基础文件
require __DIR__ . '/thinkphp/base.php';
// think文件检查防止TP目录计算异常
file_exists('think') || touch('think');
// 执行应用并响应
Container::get('app', [__DIR__ . '/application/'])->run()->send();

59
route/demo.php Normal file
View File

@ -0,0 +1,59 @@
<?php
// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
use think\facade\Route;
// 不执行下面的路由
return [];
/* 测试环境禁止操作路由绑定 */
Route::post('admin/user/pass', function () {
return json(['code' => 0, 'msg' => '测试环境禁修改用户密码!']);
});
Route::post('admin/index/pass', function () {
return json(['code' => 0, 'msg' => '测试环境禁修改用户密码!']);
});
Route::post('admin/config/index', function () {
return json(['code' => 0, 'msg' => '测试环境禁修改系统配置操作!']);
});
Route::post('admin/config/file', function () {
return json(['code' => 0, 'msg' => '测试环境禁修改文件配置操作!']);
});
Route::post('admin/menu/index', function () {
return json(['code' => 0, 'msg' => '测试环境禁排序菜单操作!']);
});
Route::post('admin/menu/add', function () {
return json(['code' => 0, 'msg' => '测试环境禁添加菜单操作!']);
});
Route::post('admin/menu/edit', function () {
return json(['code' => 0, 'msg' => '测试环境禁编辑菜单操作!']);
});
Route::post('admin/menu/forbid', function () {
return json(['code' => 0, 'msg' => '测试环境禁止禁用菜单操作!']);
});
Route::post('admin/menu/del', function () {
return json(['code' => 0, 'msg' => '测试环境禁止删除菜单操作!']);
});
Route::post('wechat/config/index', function () {
return json(['code' => 0, 'msg' => '测试环境禁止修改微信配置操作!']);
});
Route::post('admin/node/save', function () {
return json(['code' => 0, 'msg' => '测试环境禁止修改节点数据操作!']);
});
Route::post('wechat/menu/edit', function () {
return json(['code' => 0, 'msg' => '测试环境禁止修改微信菜单操作!']);
});
Route::get('wechat/menu/cancel', function () {
return json(['code' => 0, 'msg' => '测试环境禁止删除微信菜单操作!']);
});

View File

@ -12,48 +12,16 @@
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
use think\facade\Route;
/**
* 模块路由及配置检测并加载
* @include module/init.php
* @author Anyon<zoujingli@qq.com>
*/
foreach (scandir(env('app_path')) as $dir) {
if ($dir[0] !== '.') {
$filename = realpath(env('app_path') . "{$dir}/init.php");
$filename && file_exists($filename) && include($filename);
}
}
/* 去除下面注释可启用禁用功能 */
return [];
/* 测试环境禁止操作路由绑定 */
Route::post('admin/user/pass', function () {
return json(['code' => 0, 'msg' => '测试环境禁修改用户密码!']);
});
Route::post('admin/index/pass', function () {
return json(['code' => 0, 'msg' => '测试环境禁修改用户密码!']);
});
Route::post('admin/config/index', function () {
return json(['code' => 0, 'msg' => '测试环境禁修改系统配置操作!']);
});
Route::post('admin/config/file', function () {
return json(['code' => 0, 'msg' => '测试环境禁修改文件配置操作!']);
});
Route::post('admin/menu/index', function () {
return json(['code' => 0, 'msg' => '测试环境禁排序菜单操作!']);
});
Route::post('admin/menu/add', function () {
return json(['code' => 0, 'msg' => '测试环境禁添加菜单操作!']);
});
Route::post('admin/menu/edit', function () {
return json(['code' => 0, 'msg' => '测试环境禁编辑菜单操作!']);
});
Route::post('admin/menu/forbid', function () {
return json(['code' => 0, 'msg' => '测试环境禁止禁用菜单操作!']);
});
Route::post('admin/menu/del', function () {
return json(['code' => 0, 'msg' => '测试环境禁止删除菜单操作!']);
});
Route::post('wechat/config/index', function () {
return json(['code' => 0, 'msg' => '测试环境禁止修改微信配置操作!']);
});
Route::post('admin/node/save', function () {
return json(['code' => 0, 'msg' => '测试环境禁止修改节点数据操作!']);
});
Route::post('wechat/menu/edit', function () {
return json(['code' => 0, 'msg' => '测试环境禁止修改微信菜单操作!']);
});
Route::get('wechat/menu/cancel', function () {
return json(['code' => 0, 'msg' => '测试环境禁止删除微信菜单操作!']);
});

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
CKEditor 4
==========
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
http://ckeditor.com - See LICENSE.md for license information.
CKEditor is a text editor to be used inside web pages. It's not a replacement
for desktop text editors like Word or OpenOffice, but a component to be used as
part of web applications and websites.
## Documentation
The full editor documentation is available online at the following address:
http://docs.ckeditor.com
## Installation
Installing CKEditor is an easy task. Just follow these simple steps:
1. **Download** the latest version from the CKEditor website:
http://ckeditor.com. You should have already completed this step, but be
sure you have the very latest version.
2. **Extract** (decompress) the downloaded file into the root of your website.
**Note:** CKEditor is by default installed in the `ckeditor` folder. You can
place the files in whichever you want though.
## Checking Your Installation
The editor comes with a few sample pages that can be used to verify that
installation proceeded properly. Take a look at the `samples` directory.
To test your installation, just call the following page at your website:
http://<your site>/<CKEditor installation path>/samples/index.html
For example:
http://www.example.com/ckeditor/samples/index.html

View File

@ -1,6 +1,6 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=d;d=g;g=m}var k=[];d=d||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(arguments.callee,100)},0)},

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
body
@ -113,8 +113,7 @@ span[lang]
figure
{
text-align: center;
border: solid 1px #ccc;
border-radius: 2px;
outline: solid 1px #ccc;
background: rgba(0,0,0,0.05);
padding: 10px;
margin: 10px 20px;

View File

@ -0,0 +1,63 @@
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
af.js Found: 62 Missing: 4
ar.js Found: 51 Missing: 15
bg.js Found: 58 Missing: 8
bn.js Found: 40 Missing: 26
bs.js Found: 29 Missing: 37
ca.js Found: 61 Missing: 5
cs.js Found: 66 Missing: 0
cy.js Found: 66 Missing: 0
da.js Found: 66 Missing: 0
de.js Found: 66 Missing: 0
el.js Found: 59 Missing: 7
en-au.js Found: 38 Missing: 28
en-ca.js Found: 37 Missing: 29
en-gb.js Found: 61 Missing: 5
eo.js Found: 66 Missing: 0
es.js Found: 66 Missing: 0
et.js Found: 66 Missing: 0
eu.js Found: 48 Missing: 18
fa.js Found: 66 Missing: 0
fi.js Found: 66 Missing: 0
fo.js Found: 66 Missing: 0
fr-ca.js Found: 42 Missing: 24
fr.js Found: 66 Missing: 0
gl.js Found: 40 Missing: 26
gu.js Found: 66 Missing: 0
he.js Found: 66 Missing: 0
hi.js Found: 43 Missing: 23
hr.js Found: 66 Missing: 0
hu.js Found: 63 Missing: 3
is.js Found: 41 Missing: 25
it.js Found: 66 Missing: 0
ja.js Found: 62 Missing: 4
ka.js Found: 62 Missing: 4
km.js Found: 40 Missing: 26
ko.js Found: 40 Missing: 26
lt.js Found: 66 Missing: 0
lv.js Found: 40 Missing: 26
mk.js Found: 0 Missing: 66
mn.js Found: 40 Missing: 26
ms.js Found: 39 Missing: 27
nb.js Found: 66 Missing: 0
nl.js Found: 65 Missing: 1
no.js Found: 66 Missing: 0
pl.js Found: 66 Missing: 0
pt-br.js Found: 66 Missing: 0
pt.js Found: 52 Missing: 14
ro.js Found: 61 Missing: 5
ru.js Found: 66 Missing: 0
sk.js Found: 49 Missing: 17
sl.js Found: 48 Missing: 18
sr-latn.js Found: 40 Missing: 26
sr.js Found: 40 Missing: 26
sv.js Found: 62 Missing: 4
th.js Found: 40 Missing: 26
tr.js Found: 66 Missing: 0
ug.js Found: 66 Missing: 0
uk.js Found: 66 Missing: 0
vi.js Found: 66 Missing: 0
zh-cn.js Found: 66 Missing: 0
zh.js Found: 58 Missing: 8

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More