Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
400ad10a
ShopXO
项目概览
jcy2004x
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
400ad10a
编写于
6月 11, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
管理员列表优化
上级
8b5b2228
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
485 addition
and
333 deletion
+485
-333
application/admin/controller/Admin.php
application/admin/controller/Admin.php
+24
-40
application/admin/controller/Goods.php
application/admin/controller/Goods.php
+1
-0
application/admin/controller/Goodscomments.php
application/admin/controller/Goodscomments.php
+1
-0
application/admin/controller/Order.php
application/admin/controller/Order.php
+1
-1
application/admin/controller/Orderaftersale.php
application/admin/controller/Orderaftersale.php
+1
-1
application/admin/controller/User.php
application/admin/controller/User.php
+1
-0
application/admin/form/Admin.php
application/admin/form/Admin.php
+185
-0
application/admin/view/default/admin/index.html
application/admin/view/default/admin/index.html
+9
-146
application/admin/view/default/admin/module/operate.html
application/admin/view/default/admin/module/operate.html
+15
-0
application/admin/view/default/admin/save_info.html
application/admin/view/default/admin/save_info.html
+11
-1
application/admin/view/default/goods/save_info.html
application/admin/view/default/goods/save_info.html
+94
-77
application/api/controller/Plugins.php
application/api/controller/Plugins.php
+1
-1
application/index/controller/Plugins.php
application/index/controller/Plugins.php
+1
-1
application/lang/zh-cn.php
application/lang/zh-cn.php
+6
-0
application/service/AdminService.php
application/service/AdminService.php
+41
-55
application/service/PluginsAdminService.php
application/service/PluginsAdminService.php
+12
-0
application/service/PluginsService.php
application/service/PluginsService.php
+6
-0
application/tags.php
application/tags.php
+43
-7
public/static/index/default/css/common.css
public/static/index/default/css/common.css
+2
-2
thinkphp/library/think/Controller.php
thinkphp/library/think/Controller.php
+30
-1
未找到文件。
application/admin/controller/Admin.php
浏览文件 @
400ad10a
...
...
@@ -50,48 +50,31 @@ class Admin extends Common
// 权限校验
$this
->
IsPower
();
// 参数
$params
=
input
();
// 条件
$where
=
AdminService
::
AdminListWhere
(
$params
);
// 总数
$total
=
AdminService
::
AdminTotal
(
$where
);
$total
=
AdminService
::
AdminTotal
(
$
this
->
form_
where
);
// 分页
$number
=
MyC
(
'admin_page_number'
,
10
,
true
);
$page_params
=
array
(
'number'
=>
$number
,
$page_params
=
[
'number'
=>
$this
->
page_size
,
'total'
=>
$total
,
'where'
=>
$params
,
'page'
=>
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
,
'where'
=>
$this
->
data_request
,
'page'
=>
$this
->
page
,
'url'
=>
MyUrl
(
'admin/admin/index'
),
)
;
]
;
$page
=
new
\
base\Page
(
$page_params
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
// 获取
管理员
列表
// 获取
数据
列表
$data_params
=
[
'where'
=>
$
where
,
'where'
=>
$this
->
form_
where
,
'm'
=>
$page
->
GetPageStarNumber
(),
'n'
=>
$number
,
];
$data
=
AdminService
::
AdminList
(
$data_params
);
$this
->
assign
(
'data_list'
,
$data
[
'data'
]);
// 角色
$role_params
=
[
'where'
=>
[
'is_enable'
=>
1
],
'field'
=>
'id,name'
,
'n'
=>
$this
->
page_size
,
];
$role
=
AdminService
::
RoleList
(
$role_params
);
$this
->
assign
(
'role_list'
,
$role
[
'data'
]);
// 性别
$this
->
assign
(
'common_gender_list'
,
lang
(
'common_gender_list'
));
$ret
=
AdminService
::
AdminList
(
$data_params
);
$this
->
assign
(
'params'
,
$params
);
// 基础参数赋值
$this
->
assign
(
'params'
,
$this
->
data_request
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
return
$this
->
fetch
();
}
...
...
@@ -108,7 +91,7 @@ class Admin extends Common
$this
->
IsLogin
();
// 参数
$params
=
input
()
;
$params
=
$this
->
data_request
;
// 不是操作自己的情况下
if
(
!
isset
(
$params
[
'id'
])
||
$params
[
'id'
]
!=
$this
->
admin
[
'id'
])
...
...
@@ -144,6 +127,7 @@ class Admin extends Common
$this
->
assign
(
'id'
,
isset
(
$params
[
'id'
])
?
$params
[
'id'
]
:
0
);
$this
->
assign
(
'common_gender_list'
,
lang
(
'common_gender_list'
));
$this
->
assign
(
'common_admin_status_list'
,
lang
(
'common_admin_status_list'
));
// 管理员编辑页面钩子
$hook_name
=
'plugins_view_admin_admin_save'
;
...
...
@@ -181,7 +165,7 @@ class Admin extends Common
$this
->
IsLogin
();
// 参数
$params
=
input
(
'post.'
)
;
$params
=
$this
->
data_post
;
// 不是操作自己的情况下
if
(
!
isset
(
$params
[
'id'
])
||
$params
[
'id'
]
!=
$this
->
admin
[
'id'
])
...
...
@@ -217,7 +201,7 @@ class Admin extends Common
$this
->
IsPower
();
// 开始操作
$params
=
input
(
'post.'
)
;
$params
=
$this
->
data_post
;
$params
[
'admin'
]
=
$this
->
admin
;
return
AdminService
::
AdminDelete
(
$params
);
}
...
...
@@ -264,7 +248,7 @@ class Admin extends Common
}
// 开始操作
$params
=
input
(
'post.'
)
;
$params
=
$this
->
data_post
;
return
AdminService
::
Login
(
$params
);
}
...
...
application/admin/controller/Goods.php
浏览文件 @
400ad10a
...
...
@@ -74,6 +74,7 @@ class Goods extends Common
];
$ret
=
GoodsService
::
GoodsList
(
$data_params
);
// 基础参数赋值
$this
->
assign
(
'params'
,
$this
->
data_request
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
...
...
application/admin/controller/Goodscomments.php
浏览文件 @
400ad10a
...
...
@@ -71,6 +71,7 @@ class Goodscomments extends Common
];
$ret
=
GoodsCommentsService
::
GoodsCommentsList
(
$data_params
);
// 基础参数赋值
$this
->
assign
(
'params'
,
$this
->
data_request
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
...
...
application/admin/controller/Order.php
浏览文件 @
400ad10a
...
...
@@ -80,7 +80,7 @@ class Order extends Common
];
$this
->
assign
(
'buy_payment_list'
,
PaymentService
::
BuyPaymentList
(
$pay_where
));
//
参数
//
基础参数赋值
$this
->
assign
(
'params'
,
$this
->
data_request
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
...
...
application/admin/controller/Orderaftersale.php
浏览文件 @
400ad10a
...
...
@@ -77,7 +77,7 @@ class Orderaftersale extends Common
// 静态数据
$this
->
assign
(
'common_order_aftersale_refundment_list'
,
lang
(
'common_order_aftersale_refundment_list'
));
//
参数
//
基础参数赋值
$this
->
assign
(
'params'
,
$this
->
data_request
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
...
...
application/admin/controller/User.php
浏览文件 @
400ad10a
...
...
@@ -75,6 +75,7 @@ class User extends Common
// Excel地址
$this
->
assign
(
'excel_url'
,
MyUrl
(
'admin/user/excelexport'
,
$this
->
data_request
));
// 基础参数赋值
$this
->
assign
(
'params'
,
$this
->
data_request
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
...
...
application/admin/form/Admin.php
0 → 100644
浏览文件 @
400ad10a
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\form
;
use
app\service\AdminService
;
/**
* 管理员动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-11
* @desc description
*/
class
Admin
{
// 基础条件
public
$condition_base
=
[];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-11
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Run
(
$params
=
[])
{
return
[
// 基础配置
'base'
=>
[
'key_field'
=>
'id'
,
'status_field'
=>
'status'
,
'is_search'
=>
1
,
'search_url'
=>
MyUrl
(
'admin/admin/index'
),
'is_delete'
=>
1
,
'delete_url'
=>
MyUrl
(
'admin/admin/delete'
),
'delete_key'
=>
'ids'
,
],
// 表单配置
'form'
=>
[
[
'view_type'
=>
'checkbox'
,
'is_checked'
=>
0
,
'checked_text'
=>
'反选'
,
'not_checked_text'
=>
'全选'
,
'align'
=>
'center'
,
'width'
=>
80
,
'is_not_show'
=>
1
,
'not_data'
=>
[
1
],
'not_key'
=>
'id'
,
],
[
'label'
=>
'管理员'
,
'view_type'
=>
'field'
,
'view_key'
=>
'username'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'like'
,
],
],
[
'label'
=>
'状态'
,
'view_type'
=>
'field'
,
'view_key'
=>
'status_text'
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'form_name'
=>
'status'
,
'where_type'
=>
'in'
,
'data'
=>
lang
(
'common_admin_status_list'
),
'data_key'
=>
'value'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'性别'
,
'view_type'
=>
'field'
,
'view_key'
=>
'gender_text'
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'form_name'
=>
'gender'
,
'where_type'
=>
'in'
,
'data'
=>
lang
(
'common_gender_list'
),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'手机'
,
'view_type'
=>
'field'
,
'view_key'
=>
'mobile'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'like'
,
],
],
[
'label'
=>
'角色组'
,
'view_type'
=>
'field'
,
'view_key'
=>
'role_name'
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'form_name'
=>
'role_id'
,
'where_type'
=>
'in'
,
'data'
=>
$this
->
GetRoleList
(),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'登录次数'
,
'view_type'
=>
'field'
,
'view_key'
=>
'login_total'
,
'search_config'
=>
[
'form_type'
=>
'section'
,
],
],
[
'label'
=>
'最后登录时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'login_time'
,
'search_config'
=>
[
'form_type'
=>
'datetime'
,
],
],
[
'label'
=>
'创建时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'add_time'
,
'search_config'
=>
[
'form_type'
=>
'datetime'
,
],
],
[
'label'
=>
'更新时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'upd_time'
,
'search_config'
=>
[
'form_type'
=>
'datetime'
,
],
],
[
'label'
=>
'操作'
,
'view_type'
=>
'operate'
,
'view_key'
=>
'admin/module/operate'
,
'align'
=>
'center'
,
'fixed'
=>
'right'
,
],
],
];
}
/**
* 获取角色组列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-11
* @desc description
*/
public
function
GetRoleList
()
{
// 角色
$params
=
[
'where'
=>
[
'is_enable'
=>
1
],
'field'
=>
'id,name'
,
];
$res
=
AdminService
::
RoleList
(
$params
);
return
$res
[
'data'
];
}
}
?>
\ No newline at end of file
application/admin/view/default/admin/index.html
浏览文件 @
400ad10a
{{include file="public/header" /}}
<!-- 继承公共的 form -->
{{extend name="public/module/form" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<!-- form start -->
<form
class=
"am-form form-validation form-search"
method=
"post"
action=
"{{:MyUrl('admin/admin/index')}}"
request-type=
"form"
>
<div
class=
"thin"
>
<div
class=
"am-input-group am-input-group-sm am-fl so"
>
<input
type=
"text"
autocomplete=
"off"
name=
"keywords"
class=
"am-radius"
placeholder=
"用户名/手机"
value=
"{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}"
/>
<span
class=
"am-input-group-btn"
>
<button
class=
"am-btn am-btn-default am-radius"
type=
"submit"
data-am-loading=
"{spinner:'circle-o-notch', loadingText:'搜索中...'}"
>
搜索
</button>
</span>
</div>
<label
class=
"am-fl thin_sub more-submit"
>
更多筛选条件
{{if isset($params['is_more']) and $params['is_more'] eq 1}}
<input
type=
"checkbox"
name=
"is_more"
value=
"1"
id=
"is_more"
checked
/>
<i
class=
"am-icon-angle-up"
></i>
{{else /}}
<input
type=
"checkbox"
name=
"is_more"
value=
"1"
id=
"is_more"
/>
<i
class=
"am-icon-angle-down"
></i>
{{/if}}
</label>
</div>
<table
class=
"so-list more-where {{if !isset($params['is_more'])}}none{{/if}}"
>
<tbody>
<tr>
<td>
<span>
权限:
</span>
<select
name=
"role_id"
class=
"chosen-select"
data-placeholder=
"权限组..."
>
<option
value=
"-1"
>
权限组...
</option>
{{foreach $role_list as $v}}
<option
value=
"{{$v.id}}"
{{
if
isset
($
params
['
role_id
'])
and
$
params
['
role_id
']
eq
$
v
['
id
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
</select>
</td>
<td>
<span>
性别:
</span>
<select
name=
"gender"
class=
"chosen-select"
data-placeholder=
"性别..."
>
<option
value=
"-1"
>
性别...
</option>
{{foreach $common_gender_list as $v}}
<option
value=
"{{$v.id}}"
{{
if
isset
($
params
['
gender
'])
and
$
params
['
gender
']
eq
$
v
['
id
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
</select>
</td>
<tr>
<td
class=
"time"
>
<span>
时间:
</span>
<span>
<input
type=
"text"
autocomplete=
"off"
name=
"time_start"
class=
"am-form-field am-input-sm am-radius Wdate"
placeholder=
"起始时间"
value=
"{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}"
data-validation-message=
"日期格式有误"
onclick=
"WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})"
autocomplete=
"off"
/><i
class=
"am-icon-calendar"
></i>
</span>
<em
class=
"text-grey"
>
~
</em>
<span>
<input
type=
"text"
autocomplete=
"off"
name=
"time_end"
class=
"am-form-field am-input-sm am-radius Wdate"
placeholder=
"结束时间"
value=
"{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}"
pattern=
"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
data-validation-message=
"日期格式有误"
onclick=
"WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})"
autocomplete=
"off"
/><i
class=
"am-icon-calendar"
></i>
</span>
</td>
<td>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius am-btn-xs btn-loading-example"
data-am-loading=
"{spinner:'circle-o-notch', loadingText:'搜索中...'}"
>
搜索
</button>
<a
href=
"{{:MyUrl('admin/admin/index')}}"
class=
"am-btn am-btn-warning am-radius am-btn-sm reset-submit"
>
清除条件
</a>
</td>
</tr>
</tr>
</tbody>
</table>
</form>
<!-- form end -->
<!-- operation start -->
<div
class=
"am-g am-margin-top-sm"
>
<!-- 表单顶部操作栏 -->
{{block name="form_operate_top"}}
<a
href=
"{{:MyUrl('admin/admin/saveinfo')}}"
class=
"am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"
>
新增
</a>
</div>
<!-- operation end -->
<!-- list start -->
<div
class=
"am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm"
>
<table
class=
"am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap am-table-td-fixed-last"
>
<thead>
<tr>
<th>
管理员
</th>
<th>
性别
</th>
<th>
登录次数
</th>
<th>
手机号码
</th>
<th>
权限组
</th>
<th>
最后登录时间
</th>
<th>
创建时间
</th>
<th
class=
"am-text-center"
data-width=
"170"
>
操作
</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr
id=
"data-list-{{$v.id}}"
>
<td>
{{$v.username}}
</td>
<td
class=
"am-text-middle"
>
{{:lang('common_gender_list')[$v['gender']]['name']}}
</td>
<td
class=
"am-text-middle"
>
{{$v.login_total}}
</td>
<td
class=
"am-text-middle"
>
{{if empty($v['mobile'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.mobile}}{{/if}}
</td>
<td
class=
"am-text-middle"
>
{{$v.role_name}}
</td>
<td
class=
"am-text-middle"
>
{{if $v['login_total'] eq 0}}
未登录
{{else /}}
{{:date('Y-m-d H:i:s', $v['login_time'])}}
{{/if}}
</td>
<td
class=
"am-text-middle"
>
{{:date('Y-m-d H:i:s', $v['add_time'])}}
</td>
<td
class=
"am-operate-grid"
data-width=
"170"
>
<div
class=
"am-scrollable-vertical"
>
{{if $v['id'] eq 1}}
<span
class=
"cr-ccc"
>
不可操作
</span>
{{else /}}
<a
class=
"am-btn am-btn-secondary am-btn-xs am-radius"
href=
"{{:MyUrl('admin/admin/saveinfo', array('id'=>$v['id']))}}"
>
<i
class=
"am-icon-edit"
></i>
<span>
编辑
</span>
</a>
{{if $v['id'] neq $admin['id']}}
<button
class=
"am-btn am-btn-danger am-btn-xs am-radius submit-delete"
data-url=
"{{:MyUrl('admin/admin/delete')}}"
data-id=
"{{$v.id}}"
>
<i
class=
"am-icon-trash-o"
></i>
<span>
删除
</span>
</button>
{{/if}}
{{/if}}
</div>
</td>
</tr>
{{/foreach}}
{{/if}}
</tbody>
</table>
{{if empty($data_list)}}
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有相关数据
</div>
{{/if}}
</div>
<!-- list end -->
<!-- page start -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
<!-- page end -->
</div>
</div>
<!-- right content end -->
{{include file="public/footer" /}}
\ No newline at end of file
<!-- 父级内容 -->
{__block__}
{{/block}}
\ No newline at end of file
application/admin/view/default/admin/module/operate.html
0 → 100644
浏览文件 @
400ad10a
<!-- 操作栏 -->
{{if $module_data['id'] eq 1}}
<span
class=
"cr-ccc"
>
不可操作
</span>
{{else /}}
<a
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-btn-block"
href=
"{{:MyUrl('admin/admin/saveinfo', array('id'=>$module_data['id']))}}"
>
<i
class=
"am-icon-edit"
></i>
<span>
编辑
</span>
</a>
{{if $module_data['id'] neq $admin['id']}}
<button
type=
"button"
class=
"am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete"
data-url=
"{{:MyUrl('admin/admin/delete')}}"
data-id=
"{{$module_data.id}}"
data-key=
"ids"
>
<i
class=
"am-icon-trash-o"
></i>
<span>
删除
</span>
</button>
{{/if}}
{{/if}}
\ No newline at end of file
application/admin/view/default/admin/save_info.html
浏览文件 @
400ad10a
...
...
@@ -27,6 +27,8 @@
<label>
手机号码
</label>
<input
type=
"text"
placeholder=
"手机号码"
name=
"mobile"
pattern=
"{{:lang('common_regex_mobile')}}"
data-validation-message=
"手机号码格式错误"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.mobile}}"
{{/
if
}}
/>
</div>
{{include file="lib/gender" /}}
{{if !isset($data['id']) or $admin['id'] neq $data['id']}}
<div
class=
"am-form-group"
>
<label>
权限组
</label>
...
...
@@ -38,7 +40,15 @@
</select>
</div>
{{/if}}
{{include file="lib/gender" /}}
<div
class=
"am-form-group"
>
<label>
状态
</label>
<select
name=
"status"
class=
"am-radius chosen-select"
data-validation-message=
"请选择用户状态"
required
>
{{foreach :lang('common_admin_status_list') as $v}}
<option
value=
"{{$v.value}}"
{{
if
isset
($
data
['
status
'])
and
$
data
['
status
']
eq
$
v
['
value
']}}
selected
{{
else
/}}{{
if
!
isset
($
data
['
status
'])
and
isset
($
v
['
checked
'])
and
$
v
['
checked
']
eq
true
}}
selected
{{/
if
}}{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
</select>
</div>
<!-- 插件扩展数据 start -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
...
...
application/admin/view/default/goods/save_info.html
浏览文件 @
400ad10a
...
...
@@ -578,10 +578,21 @@
{{/if}}
{{if !empty($v['element'])}}
{{foreach $v.element as $element}}
{{if !empty($element['name'])}}
<div
class=
"am-form-group"
>
<label
class=
"block"
>
{{$element.title}}{{if !empty($element['desc'])}}
<span
class=
"am-form-group-label-tips"
>
{{$element.desc}}
</span>
{{/if}}
</label>
{{if !empty($element['title']) or !empty($element['desc'])}}
<label
class=
"block"
>
{{if !empty($element['title'])}}
{{$element.title}}
{{/if}}
{{if !empty($element['desc'])}}
<span
class=
"am-form-group-label-tips"
>
{{$element.desc}}
</span>
{{/if}}
</label>
{{/if}}
{{switch element.element}}
{{case input}}
{{if isset($element['type'])}}
{{if in_array($element['type'], ['radio', 'checkbox']) and !empty($element['element_data']) and is_array($element['element_data'])}}
{{foreach $element.element_data as $element_data_key=>$element_data}}
<label
class=
"{{if isset($element['is_block']) and $element['is_block'] eq 1}}am-{{$element.type}}{{else /}}am-{{$element.type}}-inline{{/if}}"
>
...
...
@@ -617,6 +628,9 @@
{{
if
isset
($
element
['
is_required
'])
and
$
element
['
is_required
']
eq
1}}
required
{{/
if
}}
/>
{{/if}}
{{else /}}
<p
class=
"am-text-danger"
>
element input-type 配置有误
</p>
{{/if}}
{{/case}}
{{case select}}
{{if !empty($element['element_data']) and is_array($element['element_data'])}}
...
...
@@ -668,6 +682,9 @@
{{/case}}
{{/switch}}
</div>
{{else /}}
<p
class=
"am-text-danger"
>
element form-name 配置有误
</p>
{{/if}}
{{/foreach}}
{{/if}}
</div>
...
...
application/api/controller/Plugins.php
浏览文件 @
400ad10a
...
...
@@ -65,7 +65,7 @@ class Plugins extends Common
'error_msg'
=>
'应用操作方法有误'
,
],
];
$ret
=
ParamsChecked
(
$
this
->
data_request
,
$p
);
$ret
=
ParamsChecked
(
$
params
[
'data_request'
]
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
5000
);
...
...
application/index/controller/Plugins.php
浏览文件 @
400ad10a
...
...
@@ -64,7 +64,7 @@ class Plugins extends Common
'error_msg'
=>
'应用操作方法有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
$ret
=
ParamsChecked
(
$params
[
'data_request'
]
,
$p
);
if
(
$ret
!==
true
)
{
if
(
IS_AJAX
)
...
...
application/lang/zh-cn.php
浏览文件 @
400ad10a
...
...
@@ -350,6 +350,12 @@ return array(
4
=>
array
(
'value'
=>
4
,
'name'
=>
'销售+自提'
,
'is_ext'
=>
1
),
),
// 管理员状态
'common_admin_status_list'
=>
array
(
0
=>
array
(
'value'
=>
0
,
'name'
=>
'正常'
,
'checked'
=>
true
),
1
=>
array
(
'value'
=>
1
,
'name'
=>
'无效'
),
),
// 色彩值
'common_color_list'
=>
array
(
...
...
application/service/AdminService.php
浏览文件 @
400ad10a
...
...
@@ -42,55 +42,30 @@ class AdminService
$data
=
Db
::
name
(
'Admin'
)
->
where
(
$where
)
->
field
(
$field
)
->
order
(
$order_by
)
->
limit
(
$m
,
$n
)
->
select
();
if
(
!
empty
(
$data
))
{
// 获取当前用户角色名称
$roles
=
Db
::
name
(
'Role'
)
->
where
(
'id'
,
'in'
,
array_column
(
$data
,
'role_id'
))
->
column
(
'name'
,
'id'
);
// 数据处理
$common_gender_list
=
lang
(
'common_gender_list'
);
$common_admin_status_list
=
lang
(
'common_admin_status_list'
);
foreach
(
$data
as
&
$v
)
{
$v
[
'role_name'
]
=
Db
::
name
(
'Role'
)
->
where
([
'id'
=>
$v
[
'role_id'
]])
->
value
(
'name'
);
}
}
return
DataReturn
(
'处理成功'
,
0
,
$data
);
}
// 所在角色组
$v
[
'role_name'
]
=
isset
(
$roles
[
$v
[
'role_id'
]])
?
$roles
[
$v
[
'role_id'
]]
:
''
;
/**
* 管理员列表条件
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-10T22:16:29+0800
* @param [array] $params [输入参数]
*/
public
static
function
AdminListWhere
(
$params
=
[])
{
$where
=
[];
if
(
!
empty
(
$params
[
'keywords'
]))
{
$where
[]
=
[
'username|mobile'
,
'like'
,
'%'
.
$params
[
'keywords'
]
.
'%'
];
}
// 性别
$v
[
'gender_text'
]
=
isset
(
$common_gender_list
[
$v
[
'gender'
]])
?
$common_gender_list
[
$v
[
'gender'
]][
'name'
]
:
''
;
// 是否更多条件
if
(
isset
(
$params
[
'is_more'
])
&&
$params
[
'is_more'
]
==
1
)
{
if
(
isset
(
$params
[
'role_id'
])
&&
$params
[
'role_id'
]
>
-
1
)
{
$where
[]
=
[
'role_id'
,
'='
,
intval
(
$params
[
'role_id'
])];
}
// 状态
$v
[
'status_text'
]
=
isset
(
$common_admin_status_list
[
$v
[
'status'
]])
?
$common_admin_status_list
[
$v
[
'status'
]][
'name'
]
:
''
;
// 等值
if
(
isset
(
$params
[
'gender'
])
&&
$params
[
'gender'
]
>
-
1
)
{
$
where
[]
=
[
'gender'
,
'='
,
intval
(
$params
[
'gender'
])]
;
// 时间
$v
[
'login_time'
]
=
empty
(
$v
[
'login_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'login_time'
]);
$v
[
'add_time'
]
=
empty
(
$v
[
'add_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'add_time'
]);
$
v
[
'upd_time'
]
=
empty
(
$v
[
'upd_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'upd_time'
])
;
}
if
(
!
empty
(
$params
[
'time_start'
]))
{
$where
[]
=
[
'add_time'
,
'>'
,
strtotime
(
$params
[
'time_start'
])];
}
if
(
!
empty
(
$params
[
'time_end'
]))
{
$where
[]
=
[
'add_time'
,
'<'
,
strtotime
(
$params
[
'time_end'
])];
}
}
return
$where
;
return
DataReturn
(
'处理成功'
,
0
,
$data
);
}
/**
...
...
@@ -152,6 +127,12 @@ class AdminService
'checked_data'
=>
[
0
,
1
,
2
],
'error_msg'
=>
'性别值范围不正确'
,
],
[
'checked_type'
=>
'in'
,
'key_name'
=>
'status'
,
'checked_data'
=>
array_column
(
lang
(
'common_admin_status_list'
),
'value'
),
'error_msg'
=>
'状态值范围不正确'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
...
...
@@ -221,6 +202,7 @@ class AdminService
'login_pwd'
=>
LoginPwdEncryption
(
$params
[
'login_pwd'
],
$salt
),
'mobile'
=>
isset
(
$params
[
'mobile'
])
?
$params
[
'mobile'
]
:
''
,
'gender'
=>
intval
(
$params
[
'gender'
]),
'status'
=>
intval
(
$params
[
'status'
]),
'role_id'
=>
intval
(
$params
[
'role_id'
]),
'add_time'
=>
time
(),
];
...
...
@@ -277,6 +259,7 @@ class AdminService
$data
=
[
'mobile'
=>
isset
(
$params
[
'mobile'
])
?
$params
[
'mobile'
]
:
''
,
'gender'
=>
intval
(
$params
[
'gender'
]),
'status'
=>
intval
(
$params
[
'status'
]),
'upd_time'
=>
time
(),
];
...
...
@@ -316,26 +299,29 @@ class AdminService
*/
public
static
function
AdminDelete
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'删除id有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
// 参数是否有误
if
(
empty
(
$params
[
'ids'
]))
{
return
DataReturn
(
$ret
,
-
1
);
return
DataReturn
(
'商品id有误'
,
-
1
);
}
// 是否数组
if
(
!
is_array
(
$params
[
'ids'
]))
{
$params
[
'ids'
]
=
explode
(
','
,
$params
[
'ids'
]);
}
// 是否包含删除超级管理员
if
(
in_array
(
1
,
$params
[
'ids'
]))
{
return
DataReturn
(
'超级管理员不可删除'
,
-
1
);
}
// 删除操作
if
(
Db
::
name
(
'Admin'
)
->
delete
(
intval
(
$params
[
'id'
])
))
if
(
Db
::
name
(
'Admin'
)
->
where
([
'id'
=>
$params
[
'ids'
]])
->
delete
(
))
{
return
DataReturn
(
'删除成功'
);
}
return
DataReturn
(
'删除失败
或资源不存在
'
,
-
100
);
return
DataReturn
(
'删除失败'
,
-
100
);
}
/**
...
...
application/service/PluginsAdminService.php
浏览文件 @
400ad10a
...
...
@@ -557,6 +557,12 @@ use think\Controller;
*/
class Admin extends Controller
{
// 构造方法
public function __construct(\$params = [])
{
parent::__construct();
}
// 后台管理入口
public function index(\$params = [])
{
...
...
@@ -621,6 +627,12 @@ use think\Controller;
*/
class Index extends Controller
{
// 构造方法
public function __construct(\$params = [])
{
parent::__construct();
}
// 前端页面入口
public function index(\$params = [])
{
...
...
application/service/PluginsService.php
浏览文件 @
400ad10a
...
...
@@ -246,6 +246,12 @@ class PluginsService
{
return
DataReturn
(
'应用方法未定义['
.
$action
.
']'
,
-
1
);
}
// 调用方法仅传递请求参数
if
(
isset
(
$params
[
'data_request'
]))
{
$params
=
$params
[
'data_request'
];
}
return
DataReturn
(
'验证成功'
,
0
,
$obj
->
$action
(
$params
));
}
}
...
...
application/tags.php
浏览文件 @
400ad10a
...
...
@@ -32,21 +32,57 @@ return array (
'log_write'
=>
array
(
),
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_users_center_left_menu_handle'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_header_navigation_top_right_handle'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_order_status_change_history_success_handle'
=>
array
(
0
=>
'app\\plugins\\neworderemail\\Hook'
,
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_order_aftersale_audit_handle_end'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_site_extraction_address_list'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_buy_order_insert_end'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_goods_spec_extends_handle'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_view_admin_user_save'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_user_save_handle'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_
service_order_pay_launch_handl
e'
=>
'plugins_
view_goods_detail_base_buy_nav_min_insid
e'
=>
array
(
0
=>
'app\\plugins\\
neworderemail
\\Hook'
,
0
=>
'app\\plugins\\
distribution
\\Hook'
,
),
'plugins_
admin_js
'
=>
'plugins_
view_goods_detail_photo_within
'
=>
array
(
0
=>
'app\\plugins\\
orderremind
\\Hook'
,
0
=>
'app\\plugins\\
distribution
\\Hook'
,
),
'plugins_
admin_view_common
_bottom'
=>
'plugins_
view_goods_detail_base
_bottom'
=>
array
(
0
=>
'app\\plugins\\
orderremind
\\Hook'
,
0
=>
'app\\plugins\\
distribution
\\Hook'
,
),
);
?>
\ No newline at end of file
public/static/index/default/css/common.css
浏览文件 @
400ad10a
...
...
@@ -133,7 +133,7 @@ color: #F5F5F2;font-size: 12px;cursor:pointer;border-radius:0px 0px; position: a
.goods-category-s
.category-content
{
position
:
relative
;
width
:
150px
;
float
:
left
;
z-index
:
113
;
background
:
#fff
;
top
:
45px
;}
.goods-category-s
.category-content
.all-goods
{
display
:
block
;
padding
:
0
;
border-radius
:
5px
5px
0
0
;
font-weight
:
600
;
line-height
:
36px
;
width
:
150px
;
height
:
36px
;
padding
:
0
;
border-radius
:
5px
5px
0
0
;
color
:
#fff
;
text-align
:
center
;
font
:
16px
/
36px
"Microsoft YaHei"
;}
.goods-category-s
.category-content
.all-goods
em
{
font
:
12px
/
36px
"Microsoft YaHei"
;
}
.category-content
.category
{
width
:
150px
;
border-top
:
none
;
background
:
#2b2b2b
;
box-shadow
:
8px
0
7px
-3px
rgba
(
0
,
0
,
0
,
.3
);
max-height
:
360px
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
}
.category-content
.category
{
width
:
150px
;
border-top
:
none
;
background
:
#2b2b2b
;
box-shadow
:
8px
0
7px
-3px
rgba
(
0
,
0
,
0
,
.3
);
}
.category-content
.down-ico
{
position
:
absolute
;
top
:
48px
;
left
:
95px
;
width
:
10px
;
height
:
6px
;
background-position
:
0
-131px
;
z-index
:
11111
;
}
.category-content
.category-list
li
{
height
:
36px
;
margin-top
:
-2px
;
z-index
:
113
;
border-top
:
1px
solid
#333
;
border-bottom
:
1px
solid
#252525
}
.category-content
.category-list
li
.first
{
margin-top
:
0
;
}
...
...
@@ -198,7 +198,7 @@ color: #F5F5F2;font-size: 12px;cursor:pointer;border-radius:0px 0px; position: a
/* 分类 */
#goods-category
.category-content
{
position
:
relative
;
width
:
180px
;
float
:
left
;
z-index
:
113
;
top
:
45px
;
}
#goods-category
.category-content
.all-goods
{
width
:
180px
;
}
.category-content
.category
{
width
:
180px
;
max-height
:
430px
;
}
.category-content
.category
{
width
:
180px
;
}
.category-content
.category-info
{
padding-left
:
12px
;
width
:
180px
;
overflow
:
hidden
;
}
.category-content
.menu-item
{
left
:
179px
;
height
:
430px
;
}
.category-content
.category-list
li
{
height
:
43px
;
}
...
...
thinkphp/library/think/Controller.php
浏览文件 @
400ad10a
...
...
@@ -58,7 +58,7 @@ class Controller
* 构造方法
* @access public
*/
public
function
__construct
(
App
$app
=
null
)
/*
public function __construct(App $app = null)
{
$this->app = $app ?: Container::get('app');
$this->request = $this->app['request'];
...
...
@@ -69,6 +69,35 @@ class Controller
$this->registerMiddleware();
// 前置操作方法 即将废弃
foreach ((array) $this->beforeActionList as $method => $options) {
is_numeric($method) ?
$this->beforeAction($options) :
$this->beforeAction($method, $options);
}
}*/
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-11
* @desc description
* @param [type] $app [description]
*/
public
function
__construct
(
$app
=
null
)
{
// 实例化控制器,构造方法参数可传非对象数据
$this
->
app
=
is_object
(
$app
)
?
$app
:
Container
::
get
(
'app'
);
$this
->
request
=
$this
->
app
[
'request'
];
$this
->
view
=
$this
->
app
[
'view'
];
// 控制器初始化
$this
->
initialize
();
$this
->
registerMiddleware
();
// 前置操作方法 即将废弃
foreach
((
array
)
$this
->
beforeActionList
as
$method
=>
$options
)
{
is_numeric
(
$method
)
?
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录