dever пре 3 година
родитељ
комит
6b4c846074

+ 123 - 0
service/agent/database/member.php

@@ -0,0 +1,123 @@
+<?php
+
+$type = array
+(
+	1 => '用户',
+    2 => '代理商',
+    3 => '创客',
+    4 => '消客',
+);
+
+$role = array
+(
+    1 => '用户',
+    2 => '街道',
+    3 => '区县',
+    4 => '城市',
+    5 => '创服',
+    6 => '创客',
+    7 => '消客',
+);
+
+return array
+(
+    # 表名
+    'name' => 'member',
+    # 显示给用户看的名称
+    'lang' => '代理商管理',
+    'order' => 100,
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list'        => true,
+        ),
+
+        'role'      => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '角色',
+            'default'   => '',
+            'desc'      => '角色',
+            'match'     => 'is_numeric',
+            'update'    => 'checkbox',
+            'option'    => $role,
+            'list'      => true,
+        ),
+
+        'name'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '名称',
+            'default'   => '',
+            'desc'      => '名称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'mobile'      => array
+        (
+            'type'      => 'bigint-11',
+            'name'      => '手机号',
+            'default'   => '',
+            'desc'      => '请输入手机号',
+            'match'     => Dever::rule('mobile'),
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'avatar'        => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '头像',
+            'default'   => '',
+            'desc'      => '请选择头像',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'place'     => '150',
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '创建时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            //'insert'    => true,
+            'search'    => 'date',
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 1 - 0
service/agent/index.php

@@ -0,0 +1 @@
+index.php

+ 2 - 0
service/boot.php

@@ -0,0 +1,2 @@
+<?php
+include(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../boot.php');

+ 194 - 0
service/setting/database/area.php

@@ -0,0 +1,194 @@
+<?php
+$type = array
+(
+    1 => '普通代理',
+    2 => '区域门店代理',
+    3 => '特殊代理',
+);
+
+$area = array
+(
+	1 => '城市',
+	2 => '区县',
+	3 => '街道',
+);
+
+$opset = array
+(
+	1 => '是',
+	2 => '否',
+);
+
+return array
+(
+    # 表名
+    'name' => 'role',
+    # 显示给用户看的名称
+    'lang' => '代理商角色',
+    # 后台菜单排序
+    'order' => 2,
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list'      => true,
+            'order'     => 'desc',
+        ),
+        
+        'name'      => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '名称',
+            'default'   => '',
+            'desc'      => '名称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'short_name'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '简称',
+            'default'   => '',
+            'desc'      => '简称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'desc'      => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '描述',
+            'default'   => '',
+            'desc'      => '描述',
+            'match'     => 'is_string',
+            'update'    => 'textarea',
+            //'search'    => 'fulltext',
+            //'list'      => true,
+        ),
+
+        'type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '代理类型',
+            'default'   => '1',
+            'desc'      => '代理类型',
+            'match'     => 'is_numeric',
+            //'update'  	=> 'radio',
+            'option'    => $type,
+            'search'    => 'select',
+            'list'      => true,
+            'control'	=> 'type',
+        ),
+
+        'area'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '区域',
+            'default'   => '-1',
+            'desc'      => '区域',
+            'match'     => 'is_numeric',
+            //'update'  	=> 'radio',
+            'option'    => $area,
+            'show'		=> 'type=2',
+        ),
+
+        'profit'      => array
+        (
+            'type'      => 'varchar-15',
+            'name'      => '收益-区域内门店利润百分比,这里直接输入数字即可,如输入10,就是10%',
+            'default'   => '0',
+            'desc'      => '收益',
+            'match'     => 'is_string',
+            'update'    => Dever::input('area') > 0 ? 'text' : false,
+            'show'		=> 'type=2',
+        ),
+
+        'opset'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '用户可升级-是否允许用户升级该角色',
+            'default'   => '1',
+            'desc'      => '用户可升级',
+            'match'     => 'is_numeric',
+            //'update'  	=> 'radio',
+            'option'    => $opset,
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '创建时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'default' => array
+	(
+		'col' => 'id,name,short_name,`desc`,type,area,opset,state,cdate',
+		'value' => array
+		(
+			'1,"普通用户", "用户", "注册但未注册成功代理商角色的用户", 1, -1, 2, 1,' . DEVER_TIME,
+			'2,"街道代理商", "街道", "一个街道区域的代理商。获得区域内门店利润5%收益。", 2, 1, 1, 1,' . DEVER_TIME,
+			'3,"区县代理商", "区县", "一线城市的区,与二三线城市的县级代理商。获得区域内门店利润3%收益。", 2, 2, 1, 1,' . DEVER_TIME,
+			'4,"城市代理商", "城市", "一个城市代理商,有一二三线城市的区分。获得区域内门店利润1%收益。", 2, 3, 1, 1,' . DEVER_TIME,
+			'5,"创服代理商", "创服", "在开创本系统时的一个代理商角色,以后此角色不新增,要保留,因为其中还有一些权益未兑换。", 3, -1, 2, 1,' . DEVER_TIME,
+			'6,"创客会员", "创客", "有分销能力的会员,但不产生代理商收益。", 1, -1, 1, 1,' . DEVER_TIME,
+			'7,"消客会员", "消客", "能带动产品销售量的会员。", 1, -1, 1, 1,' . DEVER_TIME,
+		),
+	),
+
+    'manage' => array
+    (
+    	'insert' => false,
+        'delete' => false,
+        'edit' => false,
+        'list_button' => array
+        (
+        	'fast' => array('编辑', '"role&where_id={id}&oper_save_jump=role&oper_table=role&oper_parent=role&area={area}"'),
+
+        	'list1' => array('奖励', '"role_reward&search_option_role_id={id}&oper_table=role"'),
+
+        	//'list2' => array('权益', '"role_goods&search_option_role_id={id}&oper_table=role"'),
+        )
+    ),
+
+    'request' => array
+    (
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'type' => array('yes', 'in'),
+                //'state' => 1,
+            ),
+            'type' => 'all',
+            'col' => '*|id',
+        ),
+    ),
+);

+ 72 - 0
service/setting/database/base.php

@@ -0,0 +1,72 @@
+<?php
+
+$home_top_type = array
+(
+	1 => '显示',
+	2 => '不显示',
+);
+
+return array
+(
+	# 表名
+	'name' => 'base',
+	# 显示给用户看的名称
+	'lang' => '系统配置',
+	'order' => 1,
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '平台ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+		),
+		
+		'name'		=> array
+		(
+			'type' 		=> 'varchar-32',
+			'name' 		=> '系统名称',
+			'default' 	=> '',
+			'desc' 		=> '请输入系统名称',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+		),
+		
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+
+		'cdate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '录入时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+			# 只有insert时才生效
+			'insert'	=> true,
+		),
+	),
+
+	'default' => array
+	(
+		'col' => 'name,cdate',
+		'value' => array
+		(
+			'"代理商管理系统",' . time(),
+		),
+	),
+
+	'manage' => array
+	(
+		# 后台管理不要列表页
+		'list' => 'update',
+	),
+);

+ 194 - 0
service/setting/database/role.php

@@ -0,0 +1,194 @@
+<?php
+$type = array
+(
+    1 => '普通代理',
+    2 => '区域门店代理',
+    3 => '特殊代理',
+);
+
+$area = array
+(
+	1 => '城市',
+	2 => '区县',
+	3 => '街道',
+);
+
+$opset = array
+(
+	1 => '是',
+	2 => '否',
+);
+
+return array
+(
+    # 表名
+    'name' => 'role',
+    # 显示给用户看的名称
+    'lang' => '代理商角色',
+    # 后台菜单排序
+    'order' => 2,
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list'      => true,
+            'order'     => 'desc',
+        ),
+        
+        'name'      => array
+        (
+            'type'      => 'varchar-200',
+            'name'      => '名称',
+            'default'   => '',
+            'desc'      => '名称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'short_name'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '简称',
+            'default'   => '',
+            'desc'      => '简称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'desc'      => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '描述',
+            'default'   => '',
+            'desc'      => '描述',
+            'match'     => 'is_string',
+            'update'    => 'textarea',
+            //'search'    => 'fulltext',
+            //'list'      => true,
+        ),
+
+        'type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '代理类型',
+            'default'   => '1',
+            'desc'      => '代理类型',
+            'match'     => 'is_numeric',
+            //'update'  	=> 'radio',
+            'option'    => $type,
+            'search'    => 'select',
+            'list'      => true,
+            'control'	=> 'type',
+        ),
+
+        'area'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '区域',
+            'default'   => '-1',
+            'desc'      => '区域',
+            'match'     => 'is_numeric',
+            //'update'  	=> 'radio',
+            'option'    => $area,
+            'show'		=> 'type=2',
+        ),
+
+        'profit'      => array
+        (
+            'type'      => 'varchar-15',
+            'name'      => '收益-区域内门店利润百分比,这里直接输入数字即可,如输入10,就是10%',
+            'default'   => '0',
+            'desc'      => '收益',
+            'match'     => 'is_string',
+            'update'    => Dever::input('area') > 0 ? 'text' : false,
+            'show'		=> 'type=2',
+        ),
+
+        'opset'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '用户可升级-是否允许用户升级该角色',
+            'default'   => '1',
+            'desc'      => '用户可升级',
+            'match'     => 'is_numeric',
+            //'update'  	=> 'radio',
+            'option'    => $opset,
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '创建时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'default' => array
+	(
+		'col' => 'id,name,short_name,`desc`,type,area,opset,state,cdate',
+		'value' => array
+		(
+			'1,"普通用户", "用户", "注册但未注册成功代理商角色的用户", 1, -1, 2, 1,' . DEVER_TIME,
+			'2,"街道代理商", "街道", "一个街道区域的代理商。获得区域内门店利润5%收益。", 2, 1, 1, 1,' . DEVER_TIME,
+			'3,"区县代理商", "区县", "一线城市的区,与二三线城市的县级代理商。获得区域内门店利润3%收益。", 2, 2, 1, 1,' . DEVER_TIME,
+			'4,"城市代理商", "城市", "一个城市代理商,有一二三线城市的区分。获得区域内门店利润1%收益。", 2, 3, 1, 1,' . DEVER_TIME,
+			'5,"创服代理商", "创服", "在开创本系统时的一个代理商角色,以后此角色不新增,要保留,因为其中还有一些权益未兑换。", 3, -1, 2, 1,' . DEVER_TIME,
+			'6,"创客会员", "创客", "有分销能力的会员,但不产生代理商收益。", 1, -1, 1, 1,' . DEVER_TIME,
+			'7,"消客会员", "消客", "能带动产品销售量的会员。", 1, -1, 1, 1,' . DEVER_TIME,
+		),
+	),
+
+    'manage' => array
+    (
+    	'insert' => false,
+        'delete' => false,
+        'edit' => false,
+        'list_button' => array
+        (
+        	'fast' => array('编辑', '"role&where_id={id}&oper_save_jump=role&oper_table=role&oper_parent=role&area={area}"'),
+
+        	'list1' => array('奖励', '"role_reward&search_option_role_id={id}&oper_table=role"'),
+
+        	//'list2' => array('权益', '"role_goods&search_option_role_id={id}&oper_table=role"'),
+        )
+    ),
+
+    'request' => array
+    (
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'type' => array('yes', 'in'),
+                //'state' => 1,
+            ),
+            'type' => 'all',
+            'col' => '*|id',
+        ),
+    ),
+);

+ 212 - 0
service/setting/database/role_reward.php

@@ -0,0 +1,212 @@
+<?php
+
+$role = function()
+{
+    $info = Dever::db('setting/role')->select();
+    return $info;
+};
+
+$value_type = array
+(
+    1 => '百分比',
+    2 => '数值',
+);
+
+$is_give = array
+(
+	1 => '是',
+	2 => '否',
+);
+
+$type = array
+(
+	1 => '街道',
+	5 => '分润创客名额',
+);
+
+return array
+(
+    # 表名
+    'name' => 'role_reward',
+    # 显示给用户看的名称
+    'lang' => '奖励管理',
+    'menu' => false,
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'update'    => 'hidden',
+            //'list'        => true,
+        ),
+
+        'role_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '代理商角色',
+            'default'   => '',
+            'desc'      => '代理商角色',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'search'    => 'hidden',
+            'value'     => Dever::input('search_option_role_id'),
+            'list'      => 'Dever::load("setting/role-one#name", {role_id})',
+        ),
+
+        't_role_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '推荐角色',
+            'default'   => '',
+            'desc'      => '推荐角色',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'search'    => 'select',
+            'option'	=> $role,
+            'list'      => 'Dever::load("setting/role-one#name", {t_role_id})',
+        ),
+
+        'num'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '推荐个数-每推荐多少个,奖励多少数值,这里填写推荐个数',
+            'default'   => '1',
+            'desc'      => '推荐个数',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'value'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '推荐奖励数值-如果是百分比,这里输入10,就是奖励10%,如果是数值,这里以元为单位',
+            'default'   => '0',
+            'desc'      => '推荐奖励数值',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'value_type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '奖励数值类型',
+            'default'   => '1',
+            'desc'      => '奖励数值类型',
+            'match'     => 'is_numeric',
+            'update'  	=> 'radio',
+            'option'    => $value_type,
+            'search'    => 'select',
+            'list'      => true,
+            'control'	=> 'type',
+        ),
+
+        'is_give'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '是否有额外奖励',
+            'default'   => '2',
+            'desc'      => '是否有额外奖励',
+            'match'     => 'is_numeric',
+            'update'  	=> 'radio',
+            'option'    => $is_give,
+            'control'	=> 'is_give',
+        ),
+
+        'give'      => array
+        (
+            'type'      => 'text-1000',
+            'name'      => '额外奖励',
+            'default'   => '',
+            'desc'      => '额外奖励',
+            'match'     => 'is_string',
+            'show'		=> 'is_give=1',
+            'update'    => array
+            (
+                array
+                (
+                    'col'       => 'num',
+                    'name'      => '推荐个数',
+                    'default'   => '0',
+                    'desc'      => '推荐个数',
+                    'match'     => 'is_string',
+                    'update'    => 'text',
+                ),
+
+                array
+                (
+                    'col'       => 'type',
+                    'name'      => '奖励类型',
+                    'default'   => '1',
+                    'desc'      => '奖励类型',
+                    'match'     => 'is_string',
+                    'update'  	=> 'radio',
+            		'option'    => $type,
+                ),
+
+                array
+                (
+                    'col'       => 'value',
+                    'name'      => '奖励数值',
+                    'default'   => '0',
+                    'desc'      => '奖励数值',
+                    'match'     => 'is_string',
+                    'update'    => 'text',
+                ),
+
+                array
+                (
+                    'col'       => 'value_type',
+                    'name'      => '数值类型',
+                    'default'   => '1',
+                    'desc'      => '数值类型',
+                    'match'     => 'is_string',
+                    'update'  	=> 'radio',
+            		'option'    => $value_type,
+                ),
+
+                
+            ),
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '创建时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            //'insert'    => true,
+            'search'    => 'date',
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 8 - 0
service/setting/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'setting');
+define('DEVER_APP_LANG', '基础配置');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 10);
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-tower layui-icon-component');
+include(DEVER_APP_PATH . '../boot.php');