Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
T
taote
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
李达
taote
Commits
963a47b7
提交
963a47b7
authored
3 年前
作者:
duanyinglei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加会员管理模块
上级
cb7672e6
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
120 行增加
和
272 行删除
+120
-272
Material.php
application/admin/controller/Material.php
+84
-124
Operators.php
application/admin/controller/Operators.php
+1
-0
User.php
application/admin/controller/user/User.php
+15
-21
edit.html
application/admin/view/user/user/edit.html
+16
-114
user.js
public/assets/js/backend/user/user.js
+4
-13
没有找到文件。
application/admin/controller/Material.php
浏览文件 @
963a47b7
...
@@ -2,13 +2,9 @@
...
@@ -2,13 +2,9 @@
namespace
app\admin\controller
;
namespace
app\admin\controller
;
use
app\admin\library\Auth
;
use
app\common\controller\Backend
;
use
app\common\controller\Backend
;
use
PhpOffice\PhpSpreadsheet\Cell\Coordinate
;
use
think\Db
;
use
PhpOffice\PhpSpreadsheet\Reader\Csv
;
use
think\Session
;
use
PhpOffice\PhpSpreadsheet\Reader\Xls
;
use
PhpOffice\PhpSpreadsheet\Reader\Xlsx
;
use
think\exception\PDOException
;
/**
/**
*
*
...
@@ -31,141 +27,105 @@ class Material extends Backend
...
@@ -31,141 +27,105 @@ class Material extends Backend
}
}
public
function
import
()
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 排除前台提交过来的字段
* @param $params
* @return array
*/
protected
function
preExcludeFields
(
$params
)
{
{
$file
=
$this
->
request
->
request
(
'file'
);
if
(
is_array
(
$this
->
excludeFields
))
{
if
(
!
$file
)
{
foreach
(
$this
->
excludeFields
as
$field
)
{
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
'file'
));
if
(
key_exists
(
$field
,
$params
))
{
}
unset
(
$params
[
$field
]);
$filePath
=
ROOT_PATH
.
DS
.
'public'
.
DS
.
$file
;
if
(
!
is_file
(
$filePath
))
{
$this
->
error
(
__
(
'No results were found'
));
}
//实例化reader
$ext
=
pathinfo
(
$filePath
,
PATHINFO_EXTENSION
);
if
(
!
in_array
(
$ext
,
[
'csv'
,
'xls'
,
'xlsx'
]))
{
$this
->
error
(
__
(
'Unknown data format'
));
}
if
(
$ext
===
'csv'
)
{
$file
=
fopen
(
$filePath
,
'r'
);
$filePath
=
tempnam
(
sys_get_temp_dir
(),
'import_csv'
);
$fp
=
fopen
(
$filePath
,
"w"
);
$n
=
0
;
while
(
$line
=
fgets
(
$file
))
{
$line
=
rtrim
(
$line
,
"
\n\r\0
"
);
$encoding
=
mb_detect_encoding
(
$line
,
[
'utf-8'
,
'gbk'
,
'latin1'
,
'big5'
]);
if
(
$encoding
!=
'utf-8'
)
{
$line
=
mb_convert_encoding
(
$line
,
'utf-8'
,
$encoding
);
}
if
(
$n
==
0
||
preg_match
(
'/^".*"$/'
,
$line
))
{
fwrite
(
$fp
,
$line
.
"
\n
"
);
}
else
{
fwrite
(
$fp
,
'"'
.
str_replace
([
'"'
,
','
],
[
'""'
,
'","'
],
$line
)
.
"
\"\n
"
);
}
}
$n
++
;
}
}
fclose
(
$file
)
||
fclose
(
$fp
);
$reader
=
new
Csv
();
}
elseif
(
$ext
===
'xls'
)
{
$reader
=
new
Xls
();
}
else
{
}
else
{
$reader
=
new
Xlsx
();
if
(
key_exists
(
$this
->
excludeFields
,
$params
))
{
}
unset
(
$params
[
$this
->
excludeFields
]);
//导入文件首行类型,默认是注释,如果需要使用字段名称请使用name
$importHeadType
=
isset
(
$this
->
importHeadType
)
?
$this
->
importHeadType
:
'comment'
;
$table
=
$this
->
model
->
getQuery
()
->
getTable
();
$database
=
\think\Config
::
get
(
'database.database'
);
$fieldArr
=
[];
$list
=
db
()
->
query
(
"SELECT COLUMN_NAME,COLUMN_COMMENT FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ? AND TABLE_SCHEMA = ?"
,
[
$table
,
$database
]);
foreach
(
$list
as
$k
=>
$v
)
{
if
(
$importHeadType
==
'comment'
)
{
$fieldArr
[
$v
[
'COLUMN_COMMENT'
]]
=
$v
[
'COLUMN_NAME'
];
}
else
{
$fieldArr
[
$v
[
'COLUMN_NAME'
]]
=
$v
[
'COLUMN_NAME'
];
}
}
}
}
return
$params
;
}
//加载文件
/**
$insert
=
[];
* 查看
try
{
*/
if
(
!
$PHPExcel
=
$reader
->
load
(
$filePath
))
{
public
function
index
()
$this
->
error
(
__
(
'Unknown data format'
));
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if
(
$this
->
request
->
request
(
'keyField'
))
{
return
$this
->
selectpage
();
}
}
$currentSheet
=
$PHPExcel
->
getSheet
(
0
);
//读取文件中的第一个工作表
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$allColumn
=
$currentSheet
->
getHighestDataColumn
();
//取得最大的列号
$admin_id
=
session
::
get
(
"admin"
)[
"id"
]
;
$allRow
=
$currentSheet
->
getHighestRow
();
//取得一共有多少行
$admin
=
[];
$maxColumnNumber
=
Coordinate
::
columnIndexFromString
(
$allColumn
);
if
(
$admin_id
!=
1
){
$fields
=
[];
$admin
=
[
"admin_id"
=>
$admin_id
];
for
(
$currentRow
=
1
;
$currentRow
<=
1
;
$currentRow
++
)
{
for
(
$currentColumn
=
1
;
$currentColumn
<=
$maxColumnNumber
;
$currentColumn
++
)
{
$val
=
$currentSheet
->
getCellByColumnAndRow
(
$currentColumn
,
$currentRow
)
->
getValue
();
$fields
[]
=
$val
;
}
}
}
$list
=
$this
->
model
->
where
(
$where
)
->
where
(
$admin
)
->
order
(
$sort
,
$order
)
->
paginate
(
$limit
);
for
(
$currentRow
=
2
;
$currentRow
<=
$allRow
;
$currentRow
++
)
{
$result
=
array
(
"total"
=>
$list
->
total
(),
"rows"
=>
$list
->
items
());
$values
=
[];
return
json
(
$result
);
for
(
$currentColumn
=
1
;
$currentColumn
<=
$maxColumnNumber
;
$currentColumn
++
)
{
$val
=
$currentSheet
->
getCellByColumnAndRow
(
$currentColumn
,
$currentRow
)
->
getValue
();
$values
[]
=
is_null
(
$val
)
?
''
:
$val
;
}
$row
=
[];
$temp
=
array_combine
(
$fields
,
$values
);
foreach
(
$temp
as
$k
=>
$v
)
{
if
(
isset
(
$fieldArr
[
$k
])
&&
$k
!==
''
)
{
$row
[
$fieldArr
[
$k
]]
=
$v
;
}
}
if
(
$row
)
{
$insert
[]
=
$row
;
}
}
}
catch
(
Exception
$exception
)
{
$this
->
error
(
$exception
->
getMessage
());
}
if
(
!
$insert
)
{
$this
->
error
(
__
(
'No rows were updated'
));
}
}
return
$this
->
view
->
fetch
();
try
{
}
//是否包含admin_id字段
/**
$has_admin_id
=
false
;
* 添加
foreach
(
$fieldArr
as
$name
=>
$key
)
{
*/
if
(
$key
==
'admin_id'
)
{
public
function
add
(){
$has_admin_id
=
true
;
//设置过滤方法
break
;
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
}
if
(
$this
->
request
->
isAjax
())
{
}
$data
=
$_POST
[
"row"
];
if
(
$has_admin_id
)
{
$insert
=
DB
::
name
(
"material"
)
->
insert
(
$data
);
$auth
=
Auth
::
instance
();
if
(
$insert
>
0
)
{
foreach
(
$insert
as
&
$val
)
{
$this
->
success
();
if
(
!
isset
(
$val
[
'admin_id'
])
||
empty
(
$val
[
'admin_id'
]))
{
}
else
{
$val
[
'admin_id'
]
=
$auth
->
isLogin
()
?
$auth
->
id
:
0
;
$this
->
error
(
"添加失败"
);
}
}
}
}
$this
->
model
->
saveAll
(
$insert
);
}
catch
(
PDOException
$exception
)
{
$msg
=
$exception
->
getMessage
();
if
(
preg_match
(
"/.+Integrity constraint violation: 1062 Duplicate entry '(.+)' for key '(.+)'/is"
,
$msg
,
$matches
))
{
$msg
=
"导入失败,包含【
{
$matches
[
1
]
}
】的记录已存在"
;
};
$this
->
error
(
$msg
);
}
catch
(
Exception
$e
)
{
$this
->
error
(
$e
->
getMessage
());
}
}
return
$this
->
view
->
fetch
();
$this
->
success
();
}
}
/**
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 删除
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
*/
// public function
public
function
del
(
$ids
=
""
){
if
(
!
$this
->
request
->
isPost
())
{
$this
->
error
(
__
(
"Invalid parameters"
));
}
$ids
=
$ids
?
$ids
:
$this
->
request
->
post
(
"ids"
);
if
(
$ids
)
{
$adminIds
=
$this
->
getDataLimitAdminIds
();
if
(
is_array
(
$adminIds
))
{
$this
->
model
->
where
(
$this
->
dataLimitField
,
'in'
,
$adminIds
);
}
$operators
=
$this
->
model
->
where
([
"id"
=>
$ids
])
->
delete
();
if
(
$operators
){
$this
->
success
();
}
else
{
$this
->
error
(
"删除失败"
);
}
}
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
'ids'
));
}
}
}
This diff is collapsed.
Click to expand it.
application/admin/controller/Operators.php
浏览文件 @
963a47b7
...
@@ -148,6 +148,7 @@ class Operators extends Backend
...
@@ -148,6 +148,7 @@ class Operators extends Backend
Db
::
commit
();
Db
::
commit
();
$this
->
success
();
$this
->
success
();
}
else
{
}
else
{
Db
::
rollback
();
$this
->
error
(
"删除失败"
);
$this
->
error
(
"删除失败"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
application/admin/controller/user/User.php
浏览文件 @
963a47b7
...
@@ -4,6 +4,8 @@ namespace app\admin\controller\user;
...
@@ -4,6 +4,8 @@ namespace app\admin\controller\user;
use
app\common\controller\Backend
;
use
app\common\controller\Backend
;
use
app\common\library\Auth
;
use
app\common\library\Auth
;
use
think\Session
;
use
think\Db
;
/**
/**
* 会员管理
* 会员管理
...
@@ -39,12 +41,21 @@ class User extends Backend
...
@@ -39,12 +41,21 @@ class User extends Backend
if
(
$this
->
request
->
request
(
'keyField'
))
{
if
(
$this
->
request
->
request
(
'keyField'
))
{
return
$this
->
selectpage
();
return
$this
->
selectpage
();
}
}
$id
=
Session
::
get
(
"admin"
)[
"id"
];
$id_where
=
[];
if
(
$id
!=
1
){
$id_group
=
DB
::
name
(
"operators"
)
->
where
([
"admin_id"
=>
$id
])
->
column
(
"id"
);
$id_where
=
[
"user.operators_id"
=>
[
"in"
,
$id_group
]];
}
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$list
=
$this
->
model
$list
=
$this
->
model
->
with
(
'group'
)
->
field
(
"fa_user.*,o.name as o_name"
)
->
join
(
"operators o"
,
"o.id = fa_user.operators_id"
)
->
where
(
$where
)
->
where
(
$where
)
->
where
(
$id_where
)
->
order
(
$sort
,
$order
)
->
order
(
$sort
,
$order
)
->
paginate
(
$limit
);
->
paginate
(
$limit
);
foreach
(
$list
as
$k
=>
$v
)
{
foreach
(
$list
as
$k
=>
$v
)
{
$v
->
avatar
=
$v
->
avatar
?
cdnurl
(
$v
->
avatar
,
true
)
:
letter_avatar
(
$v
->
nickname
);
$v
->
avatar
=
$v
->
avatar
?
cdnurl
(
$v
->
avatar
,
true
)
:
letter_avatar
(
$v
->
nickname
);
$v
->
hidden
([
'password'
,
'salt'
]);
$v
->
hidden
([
'password'
,
'salt'
]);
...
@@ -75,31 +86,14 @@ class User extends Backend
...
@@ -75,31 +86,14 @@ class User extends Backend
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
request
->
isPost
())
{
$this
->
token
();
$this
->
token
();
}
}
$row
=
$this
->
model
->
get
(
$ids
);
$row
=
$this
->
model
->
field
(
"fa_user.*,o.name as o_name"
)
->
join
(
"operators o"
,
"fa_user.operators_id = o.id"
)
->
where
(
"fa_user.id"
,
$ids
)
->
find
(
);
$this
->
modelValidate
=
true
;
$this
->
modelValidate
=
true
;
if
(
!
$row
)
{
if
(
!
$row
)
{
$this
->
error
(
__
(
'No Results were found'
));
$this
->
error
(
__
(
'No Results were found'
));
}
}
$this
->
view
->
assign
(
'groupList'
,
build_select
(
'row[group_id]'
,
\app\admin\model\UserGroup
::
column
(
'id,name'
),
$row
[
'group_id'
],
[
'class'
=>
'form-control selectpicker'
])
);
$this
->
view
->
assign
(
"row"
,
$row
);
return
parent
::
edit
(
$ids
);
return
$this
->
view
->
fetch
(
);
}
}
/**
* 删除
*/
public
function
del
(
$ids
=
""
)
{
if
(
!
$this
->
request
->
isPost
())
{
$this
->
error
(
__
(
"Invalid parameters"
));
}
$ids
=
$ids
?
$ids
:
$this
->
request
->
post
(
"ids"
);
$row
=
$this
->
model
->
get
(
$ids
);
$this
->
modelValidate
=
true
;
if
(
!
$row
)
{
$this
->
error
(
__
(
'No Results were found'
));
}
Auth
::
instance
()
->
delete
(
$row
[
'id'
]);
$this
->
success
();
}
}
}
This diff is collapsed.
Click to expand it.
application/admin/view/user/user/edit.html
浏览文件 @
963a47b7
<form
id=
"edit-form"
class=
"form-horizontal"
role=
"form"
data-toggle=
"validator"
method=
"POST"
action=
""
>
<form
id=
"edit-form"
class=
"form-horizontal"
role=
"form"
data-toggle=
"validator"
method=
"POST"
action=
""
>
{:token()}
{:token()}
<input
type=
"hidden"
name=
"row[id]"
value=
"{$row.id}"
>
<input
type=
"hidden"
name=
"row[id]"
value=
"{$row.id}"
>
<div
class=
"form-group"
>
<label
for=
"c-group_id"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Group')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
{$groupList}
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-username"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Username')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-username"
data-rule=
"required"
class=
"form-control"
name=
"row[username]"
type=
"text"
value=
"{$row.username|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-nickname"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Nickname')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-nickname"
data-rule=
"required"
class=
"form-control"
name=
"row[nickname]"
type=
"text"
value=
"{$row.nickname|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-password"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Password')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-password"
data-rule=
"password"
class=
"form-control"
name=
"row[password]"
type=
"text"
value=
""
placeholder=
"{:__('Leave password blank if dont want to change')}"
autocomplete=
"new-password"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-email"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Email')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-email"
data-rule=
""
class=
"form-control"
name=
"row[email]"
type=
"text"
value=
"{$row.email|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"c-mobile"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Mobile')}:
</label>
<label
for=
"c-mobile"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Mobile')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<div
class=
"col-xs-12 col-sm-4"
>
...
@@ -38,107 +8,39 @@
...
@@ -38,107 +8,39 @@
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"c-avatar"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Avatar')}:
</label>
<label
for=
"c-nickname"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Nickname')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"c-avatar"
data-rule=
""
class=
"form-control"
size=
"50"
name=
"row[avatar]"
type=
"text"
value=
"{$row.avatar}"
>
<div
class=
"input-group-addon no-border no-padding"
>
<span><button
type=
"button"
id=
"faupload-avatar"
class=
"btn btn-danger faupload"
data-input-id=
"c-avatar"
data-mimetype=
"image/gif,image/jpeg,image/png,image/jpg,image/bmp"
data-multiple=
"false"
data-preview-id=
"p-avatar"
><i
class=
"fa fa-upload"
></i>
{:__('Upload')}
</button></span>
<span><button
type=
"button"
id=
"fachoose-avatar"
class=
"btn btn-primary fachoose"
data-input-id=
"c-avatar"
data-mimetype=
"image/*"
data-multiple=
"false"
><i
class=
"fa fa-list"
></i>
{:__('Choose')}
</button></span>
</div>
<span
class=
"msg-box n-right"
for=
"c-avatar"
></span>
</div>
<ul
class=
"row list-inline faupload-preview"
id=
"p-avatar"
></ul>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-level"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Level')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-level"
data-rule=
"required"
class=
"form-control"
name=
"row[level]"
type=
"number"
value=
"{$row.level}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-gender"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Gender')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
{:build_radios('row[gender]', ['1'=>__('Male'), '0'=>__('Female')], $row['gender'])}
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-birthday"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Birthday')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-birthday"
data-rule=
""
class=
"form-control datetimepicker"
data-date-format=
"YYYY-MM-DD"
data-use-current=
"true"
name=
"row[birthday]"
type=
"text"
value=
"{$row.birthday}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-bio"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Bio')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-bio"
data-rule=
""
class=
"form-control"
name=
"row[bio]"
type=
"text"
value=
"{$row.bio|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-money"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Money')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-money"
data-rule=
"required"
class=
"form-control"
name=
"row[money]"
type=
"number"
value=
"{$row.money}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-score"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Score')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-score"
data-rule=
"required"
class=
"form-control"
name=
"row[score]"
type=
"number"
value=
"{$row.score}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-successions"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Successions')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-successions"
data-rule=
"required"
class=
"form-control"
name=
"row[successions]"
type=
"number"
value=
"{$row.successions}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-maxsuccessions"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Maxsuccessions')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-maxsuccessions"
data-rule=
"required"
class=
"form-control"
name=
"row[maxsuccessions]"
type=
"number"
value=
"{$row.maxsuccessions}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-prevtime"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Prevtime')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-prevtime"
data-rule=
"required"
class=
"form-control datetimepicker"
data-date-format=
"YYYY-MM-DD HH:mm:ss"
data-use-current=
"true"
name=
"row[prevtime]"
type=
"text"
value=
"{$row.prevtime|datetime}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"c-logintime"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Logintime')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-
logintime"
data-rule=
"required"
class=
"form-control datetimepicker"
data-date-format=
"YYYY-MM-DD HH:mm:ss"
data-use-current=
"true"
name=
"row[logintime]"
type=
"text"
value=
"{$row.logintime|datetime
}"
>
<input
id=
"c-
nickname"
data-rule=
"required"
class=
"form-control"
name=
"row[nickname]"
type=
"text"
value=
"{$row.nickname|htmlentities
}"
>
</div>
</div>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label for="c-money" class="control-label col-xs-12 col-sm-2">粉丝数量</label>-->
<!-- <div class="col-xs-12 col-sm-4">-->
<!-- <input id="c-money" data-rule="required" class="form-control" name="row[money]" type="number" value="{$row.money}">-->
<!-- </div>-->
<!-- </div>-->
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"c-
loginip"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Loginip')}:
</label>
<label
for=
"c-
score"
class=
"control-label col-xs-12 col-sm-2"
>
推广页ID
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-
loginip"
data-rule=
"required"
class=
"form-control"
name=
"row[loginip]"
type=
"text"
value=
"{$row.loginip
}"
>
<input
id=
"c-
score"
data-rule=
"required"
class=
"form-control"
name=
"row[popularize_id]"
type=
"number"
value=
"{$row.popularize_id
}"
>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"c-
loginfailure"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Loginfailure')}:
</label>
<label
for=
"c-
successions"
class=
"control-label col-xs-12 col-sm-2"
>
推广页链接
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-
loginfailure"
data-rule=
"required"
class=
"form-control"
name=
"row[loginfailure]"
type=
"number"
value=
"{$row.loginfailure
}"
>
<input
id=
"c-
successions"
data-rule=
"required"
class=
"form-control"
name=
"row[popularize_url]"
type=
"text"
value=
"{$row.popularize_url
}"
>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"c-
joinip"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Joinip')}:
</label>
<label
for=
"c-
maxsuccessions"
class=
"control-label col-xs-12 col-sm-2"
>
所属运营商
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-
joinip"
data-rule=
"required"
class=
"form-control"
name=
"row[joinip]"
type=
"text"
value=
"{$row.joinip
}"
>
<input
id=
"c-
maxsuccessions"
data-rule=
"required"
class=
"form-control"
name=
"row[o_name]"
type=
"text"
value=
"{$row.o_name
}"
>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"c-
jointime"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Jo
intime')}:
</label>
<label
for=
"c-
logintime"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('log
intime')}:
</label>
<div
class=
"col-xs-12 col-sm-4"
>
<div
class=
"col-xs-12 col-sm-4"
>
<input
id=
"c-jointime"
data-rule=
"required"
class=
"form-control datetimepicker"
data-date-format=
"YYYY-MM-DD HH:mm:ss"
data-use-current=
"true"
name=
"row[jointime]"
type=
"text"
value=
"{$row.jointime|datetime}"
>
<input
id=
"c-logintime"
data-rule=
"required"
class=
"form-control datetimepicker"
data-date-format=
"YYYY-MM-DD HH:mm:ss"
data-use-current=
"true"
name=
"row[logintime]"
type=
"text"
value=
"{$row.logintime}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"content"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Status')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
{:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
</div>
</div>
</div>
</div>
<div
class=
"form-group layer-footer"
>
<div
class=
"form-group layer-footer"
>
...
...
This diff is collapsed.
Click to expand it.
public/assets/js/backend/user/user.js
浏览文件 @
963a47b7
...
@@ -26,21 +26,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
...
@@ -26,21 +26,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{
checkbox
:
true
},
{
checkbox
:
true
},
{
field
:
'id'
,
title
:
__
(
'Id'
),
sortable
:
true
},
{
field
:
'id'
,
title
:
__
(
'Id'
),
sortable
:
true
},
{
field
:
'group.name'
,
title
:
__
(
'Group'
)},
{
field
:
'group.name'
,
title
:
__
(
'Group'
)},
{
field
:
'username'
,
title
:
__
(
'Username'
),
operate
:
'LIKE'
},
{
field
:
'nickname'
,
title
:
__
(
'Nickname'
),
operate
:
'LIKE'
},
{
field
:
'email'
,
title
:
__
(
'Email'
),
operate
:
'LIKE'
},
{
field
:
'mobile'
,
title
:
__
(
'Mobile'
),
operate
:
'LIKE'
},
{
field
:
'mobile'
,
title
:
__
(
'Mobile'
),
operate
:
'LIKE'
},
{
field
:
'avatar'
,
title
:
__
(
'Avatar'
),
events
:
Table
.
api
.
events
.
image
,
formatter
:
Table
.
api
.
formatter
.
image
,
operate
:
false
},
{
field
:
'nickname'
,
title
:
__
(
'Nickname'
),
operate
:
'LIKE'
},
{
field
:
'level'
,
title
:
__
(
'Level'
),
operate
:
'BETWEEN'
,
sortable
:
true
},
{
field
:
'operators_id'
,
title
:
"运营商ID"
,
operate
:
'LIKE'
},
{
field
:
'gender'
,
title
:
__
(
'Gender'
),
visible
:
false
,
searchList
:
{
1
:
__
(
'Male'
),
0
:
__
(
'Female'
)}},
{
field
:
'popularize_id'
,
title
:
"推广页ID"
,
operate
:
'LIKE'
},
{
field
:
'score'
,
title
:
__
(
'Score'
),
operate
:
'BETWEEN'
,
sortable
:
true
},
{
field
:
'o_name'
,
title
:
"运营商"
,
operate
:
'LIKE'
},
{
field
:
'successions'
,
title
:
__
(
'Successions'
),
visible
:
false
,
operate
:
'BETWEEN'
,
sortable
:
true
},
{
field
:
'maxsuccessions'
,
title
:
__
(
'Maxsuccessions'
),
visible
:
false
,
operate
:
'BETWEEN'
,
sortable
:
true
},
{
field
:
'logintime'
,
title
:
__
(
'Logintime'
),
formatter
:
Table
.
api
.
formatter
.
datetime
,
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
sortable
:
true
},
{
field
:
'logintime'
,
title
:
__
(
'Logintime'
),
formatter
:
Table
.
api
.
formatter
.
datetime
,
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
sortable
:
true
},
{
field
:
'loginip'
,
title
:
__
(
'Loginip'
),
formatter
:
Table
.
api
.
formatter
.
search
},
{
field
:
'jointime'
,
title
:
__
(
'Jointime'
),
formatter
:
Table
.
api
.
formatter
.
datetime
,
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
sortable
:
true
},
{
field
:
'joinip'
,
title
:
__
(
'Joinip'
),
formatter
:
Table
.
api
.
formatter
.
search
},
{
field
:
'status'
,
title
:
__
(
'Status'
),
formatter
:
Table
.
api
.
formatter
.
status
,
searchList
:
{
normal
:
__
(
'Normal'
),
hidden
:
__
(
'Hidden'
)}},
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
]
]
]
]
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论