Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xxmp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chan
xxmp
Commits
229b47eb
Commit
229b47eb
authored
May 07, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加会员折扣
parent
d9da0bd3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
489 additions
and
0 deletions
+489
-0
memberLevel.inc.php
addons/longbing_company/inc/web/manage/memberLevel.inc.php
+132
-0
memberLeveledit.inc.php
...s/longbing_company/inc/web/manage/memberLeveledit.inc.php
+22
-0
module.php
addons/longbing_company/module.php
+2
-0
index.html
addons/longbing_company/template/manage/index.html
+15
-0
memberLevel.html
addons/longbing_company/template/manage/memberLevel.html
+176
-0
memberLevelEdit.html
addons/longbing_company/template/manage/memberLevelEdit.html
+142
-0
No files found.
addons/longbing_company/inc/web/manage/memberLevel.inc.php
0 → 100644
View file @
229b47eb
<?php
//dezend by http://www.yunlu99.com/
global
$_GPC
;
global
$_W
;
define
(
'ROOT_PATH'
,
IA_ROOT
.
'/addons/'
.
$_W
[
'current_module'
][
'name'
]
.
'/'
);
is_file
(
ROOT_PATH
.
'/inc/we7.php'
)
||
exit
(
'Access Denied Longbing'
);
require_once
ROOT_PATH
.
'/inc/we7.php'
;
$uniacid
=
$_W
[
'uniacid'
];
$module_name
=
$_W
[
'current_module'
][
'name'
];
$companyEdit
=
$this
->
createWebUrl
(
'manage/memberLeveledit'
);
$redis_sup_v3
=
false
;
$redis_server_v3
=
false
;
include_once
$_SERVER
[
'DOCUMENT_ROOT'
]
.
'/addons/longbing_company/images/phpqrcode/func_longbing.php'
;
if
(
function_exists
(
'longbing_check_redis'
))
{
$config
=
$_W
[
'config'
][
'setting'
][
'redis'
];
$password
=
''
;
if
(
$config
&&
isset
(
$config
[
'requirepass'
])
&&
$config
[
'requirepass'
])
{
$password
=
$config
[
'requirepass'
];
}
if
(
$config
&&
isset
(
$config
[
'server'
])
&&
$config
[
'server'
]
&&
isset
(
$config
[
'port'
])
&&
$config
[
'port'
])
{
list
(
$redis_sup_v3
,
$redis_server_v3
)
=
longbing_check_redis
(
$config
[
'server'
],
$config
[
'port'
],
$password
);
}
}
if
(
$_GPC
[
'action'
]
==
'down'
)
{
$item
=
pdo_get
(
'longbing_company_company'
,
array
(
'id'
=>
$_GPC
[
'id'
]));
if
(
!
$item
||
empty
(
$item
))
{
message
(
'未找到该数据'
,
''
,
'error'
);
}
$result
=
pdo_update
(
'longbing_company_company'
,
array
(
'status'
=>
0
,
'update_time'
=>
time
()),
array
(
'id'
=>
$_GPC
[
'id'
]));
if
(
$result
)
{
if
(
$redis_sup_v3
)
{
$redis_server_v3
->
flushDB
();
}
message
(
'下架成功'
,
$this
->
createWebUrl
(
'manage/company'
),
'success'
);
}
message
(
'下架失败'
,
''
,
'error'
);
}
if
(
$_GPC
[
'action'
]
==
'up'
)
{
$item
=
pdo_get
(
'longbing_company_company'
,
array
(
'id'
=>
$_GPC
[
'id'
]));
if
(
!
$item
||
empty
(
$item
))
{
message
(
'未找到该数据'
,
''
,
'error'
);
}
$result
=
pdo_update
(
'longbing_company_company'
,
array
(
'status'
=>
1
,
'update_time'
=>
time
()),
array
(
'id'
=>
$_GPC
[
'id'
]));
if
(
$result
)
{
if
(
$redis_sup_v3
)
{
$redis_server_v3
->
flushDB
();
}
message
(
'上架成功'
,
$this
->
createWebUrl
(
'manage/company'
),
'success'
);
}
message
(
'上架失败'
,
''
,
'error'
);
}
if
(
$_GPC
[
'action'
]
==
'delete'
)
{
$id
=
$_GPC
[
'id'
];
$info
=
pdo_get
(
'longbing_company_company'
,
array
(
'id'
=>
$_GPC
[
'id'
]));
if
(
!
$info
||
empty
(
$info
))
{
message
(
'未找到数据'
,
''
,
'error'
);
}
$result
=
pdo_update
(
'longbing_company_company'
,
array
(
'status'
=>
-
1
,
'update_time'
=>
time
()),
array
(
'id'
=>
$_GPC
[
'id'
]));
if
(
$result
)
{
if
(
$redis_sup_v3
)
{
$redis_server_v3
->
flushDB
();
}
message
(
'删除成功'
,
$this
->
createWebUrl
(
'manage/company'
),
'success'
);
}
message
(
'删除失败'
,
''
,
'error'
);
}
if
(
$_GPC
[
'action'
]
==
'region'
){
$parent_id
=
isset
(
$_GPC
[
"id"
])
?
$_GPC
[
"id"
]
:
1
;
$sql
=
"select * from "
.
tablename
(
'sys_region'
)
.
" where parent_id ="
.
$parent_id
;
$list
=
pdo_fetchall
(
$sql
);
exit
(
json_encode
(
array
(
'errno'
=>
0
,
'message'
=>
''
,
'data'
=>
$list
)));
}
if
(
$_GPC
[
'action'
]
==
'edit'
)
{
$time
=
time
();
foreach
(
$_GPC
[
'formData'
]
as
$k
=>
$v
)
{
$data
[
$k
]
=
$v
;
}
$id
=
$_GPC
[
'id'
];
$result
=
false
;
if
(
$id
)
{
$result
=
pdo_update
(
'longbing_company_member_level'
,
$data
,
array
(
'id'
=>
$id
));
}
else
{
$result
=
pdo_insert
(
'longbing_company_member_level'
,
$data
);
}
if
(
$result
)
{
if
(
$redis_sup_v3
)
{
$redis_server_v3
->
flushDB
();
}
message
(
'编辑成功'
,
$this
->
createWebUrl
(
'manage/memberlevel'
),
'success'
);
}
message
(
'编辑失败'
,
''
,
'error'
);
}
$limit
=
array
(
1
,
15
);
$where
=
array
(
'isdel'
=>
0
);
$curr
=
1
;
if
(
isset
(
$_GPC
[
'page'
]))
{
$limit
[
0
]
=
$_GPC
[
'page'
];
$curr
=
$_GPC
[
'page'
];
}
$company
=
pdo_getslice
(
'longbing_company_member_level'
,
$where
,
$limit
,
$count
);
$perPage
=
15
;
load
()
->
func
(
'tpl'
);
include
$this
->
template
(
'manage/memberLevel'
);
?>
addons/longbing_company/inc/web/manage/memberLeveledit.inc.php
0 → 100644
View file @
229b47eb
<?php
//dezend by http://www.yunlu99.com/
global
$_GPC
;
global
$_W
;
define
(
'ROOT_PATH'
,
IA_ROOT
.
'/addons/'
.
$_W
[
'current_module'
][
'name'
]
.
'/'
);
is_file
(
ROOT_PATH
.
'/inc/we7.php'
)
||
exit
(
'Access Denied Longbing'
);
require_once
ROOT_PATH
.
'/inc/we7.php'
;
$uniacid
=
$_W
[
'uniacid'
];
$module_name
=
$_W
[
'current_module'
][
'name'
];
$id
=
$_GPC
[
'id'
];
$company
=
array
();
if
(
$id
)
{
$company
=
pdo_get
(
'longbing_company_member_level'
,
array
(
'id'
=>
$id
));
if
(
!
$company
||
empty
(
$company
))
{
$id
=
0
;
}
}
load
()
->
func
(
'tpl'
);
include
$this
->
template
(
'manage/memberLevelEdit'
);
?>
addons/longbing_company/module.php
View file @
229b47eb
...
...
@@ -58,6 +58,8 @@ class longbing_companyModule extends WeModule
$usersList
=
$this
->
createWebUrl
(
'manage/users'
);
$typeList
=
$this
->
createWebUrl
(
'manage/type'
);
$goodsList
=
$this
->
createWebUrl
(
'manage/goods'
);
$levelList
=
$this
->
createWebUrl
(
'manage/memberLevel'
);
$leveledit
=
$this
->
createWebUrl
(
'manage/memberLeveledit'
);
$addGoods
=
$this
->
createWebUrl
(
'manage/goodsEdit'
);
$orderList
=
$this
->
createWebUrl
(
'manage/orders'
);
$timelineList
=
$this
->
createWebUrl
(
'manage/timeline'
);
...
...
addons/longbing_company/template/manage/index.html
View file @
229b47eb
...
...
@@ -198,6 +198,21 @@
</dd>
</dl>
</li>
<li
data-name=
"goods"
class=
"layui-nav-item"
>
<a
href=
"javascript:;"
lay-tips=
"商品管理"
lay-direction=
"2"
>
<!--<i class="layui-icon layui-icon-component" style="color: #898989"></i>-->
<img
src=
"../../../addons/{$module_name}/images/icon/4.png"
class=
"icon-img"
>
<cite
style=
"color: #898989"
>
会员管理
</cite>
</a>
<dl
class=
"layui-nav-child"
style=
"background-color: #fff !important;"
>
<dd
data-name=
"console3"
>
<a
lay-href=
"{$levelList}"
style=
"color: #898989"
>
等级折扣列表
</a>
</dd>
<dd
data-name=
"console4"
>
<a
lay-href=
"{$leveledit}"
style=
"color: #898989"
>
添加等级折扣
</a>
</dd>
</dl>
</li>
<li
data-name=
"timeline"
class=
"layui-nav-item"
>
<a
href=
"javascript:;"
lay-tips=
"动态管理"
lay-direction=
"2"
>
...
...
addons/longbing_company/template/manage/memberLevel.html
0 → 100644
View file @
229b47eb
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<title></title>
<meta
name=
"renderer"
content=
"webkit"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
>
<link
rel=
"stylesheet"
href=
"../../../addons/{$module_name}/images/layuiadmin/layui/css/layui.css"
media=
"all"
>
<link
rel=
"stylesheet"
href=
"../../../addons/{$module_name}/images/layuiadmin/style/admin.css"
media=
"all"
>
<link
rel=
"stylesheet"
href=
"../../../addons/{$module_name}/images/css/main.css"
media=
"all"
>
</head>
<body>
<div
class=
"layui-fluid"
>
<div
class=
"layui-row layui-col-space15"
>
<div
class=
"layui-col-md12"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
等级折扣列表
</div>
<div
class=
"layui-card-body"
>
<div
class=
"div-search-body"
>
<a
class=
"layui-btn"
href=
"{$companyEdit}&id=0"
>
<i
class=
"layui-icon"
>

</i>
添加等级折扣
</a>
</div>
<table
class=
"layui-table"
>
<thead>
<tr>
<th>
ID
</th>
<th>
等级名称
</th>
<th>
图标
</th>
<th>
等级
</th>
<th>
说明
</th>
<th>
折扣
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
{loop $company $item}
<tr>
<td>
{$item['id']}
</td>
<td>
{$item['name']}
</td>
<td>
{$item['icon']}
</td>
<td>
{$item['level']}
</td>
<td>
{$item['describe']}
</td>
<td>
{$item['discount']}
</td>
<td>
<button
type=
"button"
class=
"layui-btn layui-btn-xs btn-edit-item"
itemId=
"{$item['id']}"
>
编辑
</button>
</td>
</tr>
{/loop}
</tbody>
</table>
<div
id=
"dataTable"
></div>
</div>
</div>
</div>
</div>
</div>
<script
src=
"../../../addons/{$module_name}/images/layuiadmin/layui/layui.js"
></script>
<script
src=
"../../../addons/{$module_name}/images/js/jquery.min.js"
></script>
<script>
var
keyword
=
$
(
'#inputSearch'
).
val
();
layui
.
use
([
'layer'
,
'laypage'
],
function
()
{
var
layer
=
layui
.
layer
,
laypage
=
layui
.
laypage
;
//执行一个laypage实例
laypage
.
render
({
elem
:
'dataTable'
//注意,这里的 test1 是 ID,不用加 # 号
,
count
:
{
$count
}
//数据总数,从服务端得到
,
curr
:
{
$curr
}
,
limit
:
{
$perPage
}
//每页显示的条数
,
layout
:
[
'count'
,
'prev'
,
'page'
,
'next'
,
'refresh'
,
'skip'
]
,
jump
:
function
(
obj
,
first
)
{
//obj包含了当前分页的所有参数,比如:
console
.
log
(
obj
.
curr
);
//得到当前页,以便向服务端请求对应页的数据。
//首次不执行
if
(
!
first
)
{
//do something
layer
.
load
();
window
.
location
.
href
=
"{php echo $this->createWebUrl('manage/company')}"
+
"&page="
+
obj
.
curr
+
"&keyword="
+
keyword
;
// window.location.href = "{php echo $this->createWebUrl('cards')}" + "&page=" + obj.curr;
}
}
});
});
// 删除
$
(
'.btn-delete-item'
).
click
(
function
()
{
var
id
=
$
(
this
).
attr
(
'itemId'
);
if
(
!
id
)
{
layer
.
msg
(
'获取参数失败!'
);
return
false
;
}
layer
.
open
({
content
:
'是否删除?'
,
yes
:
function
(
index
,
layero
)
{
layer
.
close
(
index
);
//如果设定了yes回调,需进行手工关闭
layer
.
load
();
var
url
=
"{php echo $this->createWebUrl('manage/company')}"
;
var
data
=
{
action
:
'delete'
,
id
:
id
};
postData
(
url
,
data
);
}
});
});
// 编辑
$
(
'.btn-edit-item'
).
click
(
function
()
{
var
id
=
$
(
this
).
attr
(
'itemId'
);
if
(
!
id
)
{
layer
.
msg
(
'获取参数失败!'
);
return
false
;
}
layer
.
load
();
var
url
=
"{php echo $this->createWebUrl('manage/memberLevelEdit')}"
+
"&id="
+
id
;
window
.
location
.
href
=
url
;
});
// 提交
var
uploading
;
function
btnUpload
(
obj
)
{
if
(
uploading
){
alert
(
"文件正在上传中,请稍候"
);
return
false
;
}
layer
.
load
();
file
=
obj
.
files
[
0
]
var
form
=
new
FormData
();
// FormData 对象
form
.
append
(
"file"
,
file
);
form
.
append
(
"action"
,
"import"
);
var
url
=
"{php echo $this->createWebUrl('manage/excel')}"
;
$
.
ajax
({
url
:
url
,
type
:
'POST'
,
cache
:
false
,
data
:
form
,
processData
:
false
,
contentType
:
false
,
dataType
:
"json"
,
beforeSend
:
function
(){
uploading
=
true
;
},
success
:
function
(
data
)
{
alert
(
data
.
message
);
//layer.msg(data.message);
uploading
=
false
;
layer
.
closeAll
();
}
});
return
false
;
}
</script>
<script
src=
"../../../addons/{$module_name}/images/js/main.js"
></script>
</body>
</html>
addons/longbing_company/template/manage/memberLevelEdit.html
0 → 100644
View file @
229b47eb
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<title></title>
<meta
name=
"renderer"
content=
"webkit"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
>
<link
rel=
"stylesheet"
href=
"../../../addons/{$module_name}/images/layuiadmin/layui/css/layui.css"
media=
"all"
>
<link
rel=
"stylesheet"
href=
"../../../addons/{$module_name}/images/layuiadmin/style/admin.css"
media=
"all"
>
<link
rel=
"stylesheet"
href=
"../../../addons/{$module_name}/images/css/main.css"
media=
"all"
>
<!--<script src="../../../addons/{$module_name}/images/js/jquery.min.js"></script>-->
<link
href=
"./resource/css/bootstrap.min.css?v=20170426"
rel=
"stylesheet"
>
<link
href=
"./resource/css/common.css?v=20170426"
rel=
"stylesheet"
>
<script
type=
"text/javascript"
>
if
(
navigator
.
appName
==
'Microsoft Internet Explorer'
){
if
(
navigator
.
userAgent
.
indexOf
(
"MSIE 5.0"
)
>
0
||
navigator
.
userAgent
.
indexOf
(
"MSIE 6.0"
)
>
0
||
navigator
.
userAgent
.
indexOf
(
"MSIE 7.0"
)
>
0
)
{
alert
(
'您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.'
);
}
}
window
.
sysinfo
=
{
{
if
!
empty
(
$_W
[
'uniacid'
])}
'uniacid'
:
'{$_W['
uniacid
']}'
,{
/
if
}
{
if
!
empty
(
$_W
[
'acid'
])}
'acid'
:
'{$_W['
acid
']}'
,{
/
if
}
{
if
!
empty
(
$_W
[
'openid'
])}
'openid'
:
'{$_W['
openid
']}'
,{
/
if
}
{
if
!
empty
(
$_W
[
'uid'
])}
'uid'
:
'{$_W['
uid
']}'
,{
/
if
}
'isfounder'
:
{
if
!
empty
(
$_W
[
'isfounder'
])}
1
{
else
}
0
{
/if}
,
'family'
:
'{IMS_FAMILY}'
,
'siteroot'
:
'{$_W['
siteroot
']}'
,
'siteurl'
:
'{$_W['
siteurl
']}'
,
'attachurl'
:
'{$_W['
attachurl
']}'
,
'attachurl_local'
:
'{$_W['
attachurl_local
']}'
,
'attachurl_remote'
:
'{$_W['
attachurl_remote
']}'
,
'module'
:
{
'url'
:
'{if defined('
MODULE_URL
')}{MODULE_URL}{/if}'
,
'name'
:
'{if defined('
IN_MODULE
')}{IN_MODULE}{/if}'
},
'cookie'
:
{
'pre'
:
'{$_W['
config
']['
cookie
']['
pre
']}'
},
'account'
:
{
php
echo
json_encode
(
$_W
[
'account'
])},
'server'
:
{
'php'
:
'{php echo phpversion()}'
},
};
</script>
<script>
var
require
=
{
urlArgs
:
'v=20170426'
};
</script>
<script
type=
"text/javascript"
src=
"./resource/js/lib/jquery-1.11.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"./resource/js/lib/bootstrap.min.js"
></script>
<script
type=
"text/javascript"
src=
"./resource/js/app/util.js?v=20170426"
></script>
<script
type=
"text/javascript"
src=
"./resource/js/app/common.min.js?v=20170426"
></script>
<script
type=
"text/javascript"
src=
"./resource/js/require.js?v=20170426"
></script>
</head>
<body>
<div
class=
"layui-fluid"
>
<div
class=
"layui-row layui-col-space15"
>
<div
class=
"layui-col-md12"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
公司数据管理
</div>
<div
class=
"layui-card-body"
>
<form
class=
"layui-form"
action=
""
onsubmit=
"return false"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
等级名称
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"name"
required
lay-verify=
"required"
placeholder=
"请输入公司名称"
autocomplete=
"off"
class=
"layui-input"
value=
"{$company['name']}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
图标
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"icon"
required
lay-verify=
"required"
placeholder=
"请输入公司简称"
autocomplete=
"off"
class=
"layui-input"
value=
"{$company['icon']}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
等级
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"level"
required
lay-verify=
"required"
placeholder=
"请输入公司地址"
autocomplete=
"off"
class=
"layui-input"
value=
"{$company['level']}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
说明
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"describe"
required
lay-verify=
"required"
placeholder=
"请输入说明"
autocomplete=
"off"
class=
"layui-input"
value=
"{$company['describe']}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
折扣
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"discount"
required
lay-verify=
"required"
placeholder=
"请输入折扣"
autocomplete=
"off"
class=
"layui-input"
value=
"{$company['discount']}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"formSub"
>
立即提交
</button>
<button
type=
"reset"
class=
"layui-btn layui-btn-primary"
>
重置
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script
src=
"../../../addons/{$module_name}/images/layuiadmin/layui/layui.js"
></script>
<script>
layui
.
use
([
'layer'
,
'form'
],
function
()
{
var
layer
=
layui
.
layer
,
form
=
layui
.
form
form
.
on
(
'submit(formSub)'
,
function
(
data
){
var
formData
=
data
.
field
;
layer
.
load
();
var
url
=
"{php echo $this->createWebUrl('manage/memberLevel')}"
;
var
id
=
'{$id}'
;
var
data
=
{
action
:
'edit'
,
formData
:
formData
};
if
(
id
>
0
)
{
data
.
id
=
id
;
}
postData
(
url
,
data
);
return
false
;
});
});
function
goBackUrl
()
{
history
.
back
();
}
</script>
<script
src=
"../../../addons/{$module_name}/images/js/main.js"
></script>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment