123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759 |
- <?php
- $role = function()
- {
- $array = array();
- $data = Dever::load('setting/role-state');
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $status = array
- (
- 1 => array('name' => '未认证', 'style' => 'font-weight:bold;color:#436EEE'),
- 2 => array('name' => '正常', 'style' => 'font-weight:bold;color:green'),
- //3 => '驳回',
- //4 => '已删除',
- 5 => array('name' => '已禁用', 'style' => 'font-weight:bold;color:#CD3700'),
- );
- $type = array
- (
- 1 => '个人',
- 2 => '公司',
- );
- $prize_type = array
- (
- 1 => '名额外',
- 2 => '名额内',
- );
- $is_shop = array
- (
- 1 => '无法修改',
- 2 => '可以修改',
- );
- $import = array
- (
- 1 => '最新系统',
- 2 => 'v2旧系统导入',
- 3 => 'v1旧系统导入',
- );
- $is_area = array
- (
- 1 => '是',
- 2 => '否',
- );
- $source_id = function()
- {
- $array = array
- (
- -1 => array
- (
- 'id' => '-1',
- 'name' => '无来源',
- ),
- );
- $data = Dever::load('setting/source-state');
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $level = function()
- {
- $array = array
- (
- -1 => array
- (
- 'id' => -1,
- 'name' => '普通',
- ),
- );
- $data = Dever::load('setting/level-state');
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $info = '';
- $button = array();
- $list_button = array();
- $list_button['list'] = array('查看详情', '"member_area&mid={id}&page_type=1&[refer]"');
- /*
- if (Dever::load('manage/auth')->checkFunc('agent.member', 'edit6', '查看关系图谱')) {
- $list_button['list1'] = array('查看关系图谱',Dever::url('lib/manage.relation?mid={id}&[refer].manage', 'agent'));
- }
- */
- # id小于50000为导入的数据
- return array
- (
- # 表名
- 'name' => 'member',
- # 显示给用户看的名称
- 'lang' => '代理商管理',
- 'order' => 100,
- 'auto' => 50000,
- 'config_type' => $type,
- 'config_status' => $status,
- 'info' => $info,
- 'start' => array
- (
- 'update' => 'agent/lib/manage.updateArea',
- ),
- # 数据结构
- 'struct' => array
- (
-
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => '代理商姓名/手机号',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- //'list' => true,
- 'search' => array
- (
- 'api' => 'agent/member-getSearch',
- 'col' => 'col',
- 'result' => 'id',
- 'search' => 'id',
- ),
- 'list_name' => '代理商信息',
- 'list' => 'Dever::load("agent/lib/member.getOne", {id}, "agent/member", true)',
- ),
- 'name' => array
- (
- 'type' => 'varchar-100',
- 'name' => '代理商姓名',
- 'default' => '',
- 'desc' => '姓名',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'rdate' => array
- (
- 'type' => 'int-11',
- 'name' => '认证时间',
- 'match' => 'option',
- 'default' => '0',
- 'desc' => '',
- 'update' => 'date',
- 'callback' => 'maketime',
- // 'list' => '{rdate} > 0 ? date("Y-m-d H:i", {rdate}) : "无"',
- 'list' => 'Dever::load("agent/lib/member.set_rdate", {id})',
- 'list_order' => 100,
- ),
- 'avatar' => array
- (
- 'type' => 'varchar-150',
- 'name' => '头像',
- 'default' => '',
- 'desc' => '请选择头像',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '1',
- //'place' => '150',
- ),
- 'mobile' => array
- (
- 'type' => 'bigint-11',
- 'name' => '手机号',
- 'default' => '',
- 'desc' => '请输入手机号',
- 'match' => Dever::rule('mobile'),
- 'update' => 'hidden',
- //'search' => 'fulltext',
- //'list' => true,
- ),
- 'email' => array
- (
- 'type' => 'varchar-150',
- 'name' => '邮箱',
- 'default' => '',
- 'desc' => '请输入邮箱',
- 'match' => 'option||' . Dever::rule('email'),
- 'update' => 'text',
- ),
- 'username' => array
- (
- 'type' => 'varchar-100',
- 'name' => '昵称',
- 'default' => '',
- 'desc' => '昵称',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'birthday' => array
- (
- 'type' => 'int-11',
- 'name' => '生日',
- 'default' => '',
- 'match' => 'option',
- 'desc' => '生日',
- 'update' => 'time',
- 'callback' => 'maketime',
- ),
- 'password' => array
- (
- 'type' => 'varchar-50',
- 'name' => '密码',
- 'default' => '',
- 'desc' => '请输入密码',
- 'match' => 'option',
- 'update' => 'password',
- 'callback' => 'sha1',
- ),
- 'parent_mid' => array
- (
- 'type' => 'int-11',
- 'name' => '上级姓名/手机号',
- 'default' => '-1',
- 'desc' => '邀请人',
- 'match' => 'is_string',
- //'update' => 'text',
- 'search' => array
- (
- 'api' => 'agent/member-getSearch',
- 'col' => 'col',
- 'result' => 'id',
- 'search' => 'parent_mid',
- ),
- 'list_name' => '上级信息',
- 'list' => 'Dever::load("agent/lib/member.getOne", {parent_mid})',
- ),
- 'source_id' => array
- (
- 'type' => 'int-11',
- 'name' => '注册来源',
- 'default' => '-1',
- 'desc' => '注册来源',
- 'match' => 'is_numeric',
- 'search' => 'select',
- //'update' => 'checkbox',
- 'option' => $source_id,
- ),
- 'code' => array
- (
- 'type' => 'varchar-50',
- 'name' => '邀请码',
- 'default' => '',
- 'desc' => '代理商邀请码',
- 'match' => 'option',
- //'update' => 'text',
- 'list_order'=>1,
- ),
- 'role' => array
- (
- 'type' => 'int-11',
- 'name' => '代理角色',
- 'default' => '',
- 'desc' => '代理角色',
- 'match' => 'is_numeric',
- 'search' => 'select',
- 'update' => 'select',
- 'option' => $role,
- ),
- 'level_id' => array
- (
- 'type' => 'int-11',
- 'name' => '代理商等级',
- 'default' => '-1',
- 'desc' => '代理商等级',
- 'match' => 'is_numeric',
- 'search' => 'select',
- 'update' => 'select',
- 'option' => $level,
- //'list' => true,
- ),
- 'is_area' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否有代理区域',
- 'default' => '1',
- 'desc' => '是否有代理区域',
- 'match' => 'is_numeric',
- 'option' => $is_area,
- //'update' => 'radio',
- ),
- 'area' => array
- (
- 'type' => 'varchar-500',
- 'name' => '代理区域',
- 'default' => '',
- 'desc' => '代理区域',
- 'match' => 'option',
- 'search' => 'linkage',
- 'update' => 'linkage',
- 'option' => Dever::url('api.get?level_total=4', 'area'),
- ),
- 'is_shop' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '门店是否可以修改',
- 'default' => '2',
- 'desc' => '门店是否可以修改',
- 'match' => 'is_numeric',
- 'option' => $is_shop,
- 'update' => 'radio',
- ),
- 'shop_id' => array
- (
- 'type' => 'int-11',
- 'name' => '所属门店',
- 'default' => '',
- 'desc' => '所属门店',
- 'match' => 'is_numeric',
- 'update' => 'select',
- 'update_search' => 'shop/lib/manage.search',
- ),
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '类型',
- 'default' => '1',
- 'desc' => '类型',
- 'match' => 'is_numeric',
- 'option' => $type,
- 'update' => 'radio',
- 'control' => 'type',
- ),
- 'sign' => array
- (
- 'type' => 'varchar-150',
- 'name' => '手写签名',
- 'default' => '',
- 'desc' => '手写签名',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '7',
- ),
- 'idcard' => array
- (
- 'type' => 'varchar-32',
- 'name' => '身份证号码',
- 'default' => '',
- 'desc' => '身份证号码',
- 'match' => Dever::rule('idcard'),
- 'update' => 'text',
- ),
- 'idcard_front' => array
- (
- 'type' => 'varchar-150',
- 'name' => '身份证正面',
- 'default' => '',
- 'desc' => '身份证正面',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '8',
- //'place' => '660*660',
- ),
- 'idcard_back' => array
- (
- 'type' => 'varchar-150',
- 'name' => '身份证背面',
- 'default' => '',
- 'desc' => '身份证背面',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '8',
- //'place' => '660*660',
- ),
- 'company_name' => array
- (
- 'type' => 'varchar-100',
- 'name' => '公司名称',
- 'default' => '',
- 'desc' => '公司名称',
- 'match' => 'is_string',
- 'update' => 'text',
- //'search' => 'fulltext',
- //'list' => true,
- 'show' => 'type=2',
- ),
- 'company_pic' => array
- (
- 'type' => 'varchar-150',
- 'name' => '营业执照',
- 'default' => '',
- 'desc' => '营业执照',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '8',
- //'place' => '660*660',
- 'show' => 'type=2',
- ),
- 'company_number' => array
- (
- 'type' => 'varchar-80',
- 'name' => '营业执照号码',
- 'default' => '',
- 'desc' => '营业执照号码',
- 'match' => 'is_string',
- 'update' => 'text',
- 'show' => 'type=2',
- ),
- 'address' => array
- (
- 'type' => 'varchar-800',
- 'name' => '地址',
- 'default' => '',
- 'desc' => '地址',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'cash' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '余额',
- 'default' => '0',
- 'desc' => '余额',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'list_name' => '余额<br />直推业绩<br />团队业绩',
- 'list' => '"{cash}<br />{sell}<br />{group_sell}"',
- ),
- 'sell' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '直推业绩',
- 'default' => '0',
- 'desc' => '销售业绩',
- 'match' => 'is_numeric',
- 'update' => 'text',
- ),
- 'group_sell' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '团队业绩',
- 'default' => '0',
- 'desc' => '团队销售业绩',
- 'match' => 'is_numeric',
- 'update' => 'text',
- ),
- 'old_group_sell' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '历史团队业绩',
- 'default' => '0',
- 'desc' => '历史团队业绩',
- 'match' => 'is_numeric',
- 'update' => 'text',
- ),
- 'old_agentdownnum' => array
- (
- 'type' => 'int-11',
- 'name' => '历史直推人数',
- 'default' => '0',
- 'desc' => '历史团队业绩',
- 'match' => 'is_numeric',
- 'update' => 'text',
- ),
- 'old_pwd' => array
- (
- 'type' => 'varchar-32',
- 'name' => 'pwd',
- 'default' => '',
- 'desc' => 'pwd',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'old_salt' => array
- (
- 'type' => 'varchar-32',
- 'name' => 'salt',
- 'default' => '',
- 'desc' => 'salt',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'status' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '状态',
- 'match' => 'is_numeric',
- 'option' => $status,
- 'search' => 'select',
- 'list' => true,
- ),
- 'import' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否导入',
- 'default' => '1',
- 'desc' => '是否导入',
- 'match' => 'is_numeric',
- 'option' => $import,
- 'update' => 'radio',
- ),
- 'prize_type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否名额内',
- 'default' => '1',
- 'desc' => '是否名额内',
- 'match' => 'is_numeric',
- 'option' => $prize_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',
- ),
- ),
- 'alter' => array
- (
- 5 => array
- (
- array('update', 'cash', 'cash', 'decimal-11,2 0 余额'),
- array('update', 'sell', 'sell', 'decimal-11,2 0 直推业绩'),
- array('update', 'group_sell', 'group_sell', 'decimal-11,2 0 团队业绩'),
- array('update', 'old_group_sell', 'old_group_sell', 'decimal-11,2 0 历史团队业绩'),
- ),
- 'version' => 5,
- ),
- 'index' => array
- (
- 1 => array
- (
- 'parent_mid' => 'parent_mid',
- ),
-
- # 版本号 更改版本号会更新当前表的索引
- 'version' => 1,
- ),
- 'manage' => array
- (
- 'insert' => false,
- 'delete' => false,
- 'edit' => false,
- 'button' => $button,
- 'list_button' => $list_button,
- ),
- 'request' => array
- (
- 'getInfo' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'status' => 2,
- 'state' => 1,
- ),
- 'order' => array('id' => 'desc'),
- 'type' => 'one',
- 'col' => '*',
- ),
- 'getData' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'idcard' => 'yes',
- 'id' => array('yes', '!='),
- 'status' => array('yes', 'in'),
- 'state' => 1,
- ),
- 'order' => array('id' => 'desc'),
- 'type' => 'all',
- 'page' => array(20, 'list'),
- 'col' => '*',
- ),
- 'upCash' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'id' => 'yes',
- ),
- 'set' => array
- (
- 'cash' => array('yes', '+='),
- ),
- ),
- 'upSell' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'id' => 'yes',
- ),
- 'set' => array
- (
- 'cash' => array('yes', '+='),
- 'upcol' => array('yes-sell', '+='),
- 'level_id' => 'yes',
- ),
- ),
- 'upGroupSell' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'id' => 'yes',
- ),
- 'set' => array
- (
- 'cash' => array('yes', '+='),
- 'upcol' => array('yes-group_sell', '+='),
- 'level_id' => 'yes',
- ),
- ),
- 'upGroupSellOne' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'id' => 'yes',
- ),
- 'set' => array
- (
- 'sell' => array('yes', '+='),
- 'group_sell' => array('yes', '+='),
- ),
- ),
- # 获取订单数量
- 'getNum' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'start' => array('yes-cdate', '>='),
- 'end' => array('yes-cdate', '<='),
- 'fstart' => array('yes-rdate', '>='),
- 'fend' => array('yes-rdate', '<='),
- 'status' => 'yes',
- 'role' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'count',
- 'col' => '*',
- ),
- 'getSearch' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'col' => array('yes-mobile,name', 'like'),
- ),
- 'type' => 'all',
- 'col' => '*|id',
- ),
- 'getShopAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'shop_id' => array('yes','>='),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'col' => '*',
- ),
- 'getCount' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => 'yes',
- 'role' => 'yes',
- 'prize_type' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'count',
- 'col' => '*',
- ),
- 'getOutAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => 'yes',
- 'role' => 'yes',
- 'prize_type' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'col' => '*',
- ),
- ),
- );
|