Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
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
wangtao
projecttwo
Commits
2704d431
Commit
2704d431
authored
May 30, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理后台 看板
parent
44a5c681
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
577 additions
and
152 deletions
+577
-152
BaseController.php
app/BaseController.php
+144
-96
AdminBase.php
app/admin/controller/AdminBase.php
+9
-0
Index.php
app/admin/controller/Index.php
+129
-23
Course.php
app/admin/controller/course/Course.php
+1
-0
index.html
app/admin/view/caiwu/withdrawal/index.html
+12
-9
index.html
app/admin/view/course/course/index.html
+7
-7
index.html
app/admin/view/index/index.html
+1
-0
main.html
app/admin/view/index/main.html
+256
-2
index.html
app/admin/view/project/project/index.html
+6
-5
index.html
app/admin/view/users/business/index.html
+6
-5
index.html
app/admin/view/users/school/index.html
+6
-5
No files found.
app/BaseController.php
View file @
2704d431
...
...
@@ -8,9 +8,12 @@
* ---------------------------------------------------------------------------
*/
declare
(
strict_types
=
1
);
namespace
app
;
use
think\App
;
use
think\facade\Cache
;
use
think\facade\Db
;
use
think\Response
;
use
think\facade\View
;
use
think\exception\HttpResponseException
;
...
...
@@ -78,6 +81,28 @@ abstract class BaseController
$this
->
__auth
();
// 控制器初始化
$this
->
__init
();
$this
->
logon
();
//访问量
$this
->
__website
();
}
protected
function
__website
()
{
$ip
=
$this
->
request
->
ip
();
$websitelog
=
Cache
::
get
(
'webistelog:'
.
$ip
);
if
(
empty
(
$websitelog
))
{
$url
=
substr
(
vhtmlspecialchars
(
strip_sql
(
$this
->
request
->
url
())),
0
,
200
);
$a
=
substr
(
vhtmlspecialchars
(
strip_sql
(
request
()
->
header
(
'user-agent'
))),
0
,
200
);
$data
[
'ip'
]
=
$ip
;
$data
[
'url'
]
=
$url
;
$data
[
'user_agent'
]
=
$a
;
$data
[
'logtime'
]
=
time
();
Db
::
name
(
'webiste_log'
)
->
insert
(
$data
);
Db
::
name
(
'webiste'
)
->
where
(
'id'
,
1
)
->
setInc
(
'unique_visitors'
);
Cache
::
set
(
'webistelog:'
.
$ip
,
$ip
,
72000
);
}
}
/**
...
...
@@ -86,45 +111,50 @@ abstract class BaseController
protected
function
__home
()
{
// 前台统一开关 需后台配置参数 开关类型:site_close 和 文本域类型:site_close_tip
if
(
vconfig
(
'site_close'
))
$this
->
exitMsg
(
vconfig
(
'site_close_tip'
,
'系统升级维护中,请稍后访问!'
),
400
);
if
(
vconfig
(
'site_close'
))
$this
->
exitMsg
(
vconfig
(
'site_close_tip'
,
'系统升级维护中,请稍后访问!'
),
400
);
// 获取会员信息
$this
->
memUser
=
session
(
VT_MEMBER
);
}
/**
* 验证(登录、权限)
*/
protected
function
__auth
(){}
*/
protected
function
__auth
()
{
}
/**
* 初始化
*/
protected
function
__init
(){}
*/
protected
function
__init
()
{
}
/**
* 空方法
*/
*/
public
function
__call
(
$name
,
$arg
)
{
$this
->
exitMsg
(
'Method does not exist'
,
400
);
$this
->
exitMsg
(
'Method does not exist'
,
400
);
}
/**
* 日志/在线处理
* @access protected
* @param
string $tip
提示
* @param
string $tip
提示
*/
protected
function
logon
(
string
$tip
=
''
)
{
$flag1
=
vconfig
(
'home_log'
,
0
);
$flag2
=
in_array
(
vconfig
(
'online_on'
,
0
),[
2
,
3
]);
if
(
$flag1
||
$flag2
)
$url
=
substr
(
vhtmlspecialchars
(
strip_sql
(
$this
->
request
->
url
())),
0
,
200
);
$flag1
=
vconfig
(
'home_log'
,
0
);
$flag2
=
in_array
(
vconfig
(
'online_on'
,
0
),
[
2
,
3
]);
if
(
$flag1
||
$flag2
)
$url
=
substr
(
vhtmlspecialchars
(
strip_sql
(
$this
->
request
->
url
())),
0
,
200
);
/*访问日志*/
if
(
$flag1
)
{
\app\model\system\SystemWebLog
::
add
([
'url'
=>
$url
.
$tip
,
'username'
=>
$this
->
memUser
[
'username'
]
??
''
,
'ip'
=>
$this
->
request
->
ip
()]);
if
(
$flag1
)
{
\app\model\system\SystemWebLog
::
add
([
'url'
=>
$url
.
$tip
,
'username'
=>
$this
->
memUser
[
'username'
]
??
''
,
'ip'
=>
$this
->
request
->
ip
()]);
}
/**/
/*在线统计【0:关闭全部 1:开启后台 2:开启会员 3:开启全部】*/
if
(
$flag2
)
{
if
(
$flag2
)
{
\app\model\system\SystemOnline
::
recod
(
$this
->
memUser
,
$url
);
}
/**/
}
...
...
@@ -132,7 +162,7 @@ abstract class BaseController
/**
* 模板赋值
* @access protected
* @param
string|array $vars
赋值表达式/数组
* @param
string|array $vars
赋值表达式/数组
*/
protected
final
function
assign
(
...
$vars
)
{
...
...
@@ -142,9 +172,9 @@ abstract class BaseController
/**
* 模板渲染
* @access protected
* @param
string $tmp
模板名称
* @param
string $tip
提示
* @param
bool $logon
记录日志
* @param
string $tmp
模板名称
* @param
string $tip
提示
* @param
bool $logon
记录日志
*/
protected
final
function
fetch
(
string
$tmp
=
''
,
string
$tip
=
''
,
bool
$logon
=
true
)
{
...
...
@@ -155,7 +185,7 @@ abstract class BaseController
/**
* 重定向
* @access protected
* @param
string $args
重定向地址
* @param
string $args
重定向地址
* @throws HttpResponseException
*/
protected
final
function
redirect
(
...
$args
)
...
...
@@ -166,20 +196,20 @@ abstract class BaseController
/**
* 中断反馈信息
* @access protected
* @param
string $m
信息字符
* @param
int $c
状态值 400前台关闭 401 Ajax请求未登陆 303网址请求未登录
* @param
array $d
数组信息
* @param
array $h
发送的Header信息
* @param
string $m
信息字符
* @param
int $c
状态值 400前台关闭 401 Ajax请求未登陆 303网址请求未登录
* @param
array $d
数组信息
* @param
array $h
发送的Header信息
* @throws HttpResponseException
*/
protected
final
function
exitMsg
(
$m
,
$c
=
0
,
$d
=
[],
$h
=
[])
{
if
(
$c
==
400
)
{
$re
=
Response
::
create
(
ROOT_PATH
.
'app/v_msg.tpl'
,
'view'
)
->
assign
([
'msg'
=>
$m
,
'site'
=>
vconfig
(
'site_title'
)])
->
header
(
$h
);
}
else
if
(
$c
==
303
)
{
$re
=
Response
::
create
(
ROOT_PATH
.
'app/v_msg.tpl'
,
'view'
)
->
assign
([
'msg'
=>
$m
,
'site'
=>
vconfig
(
'site_title'
),
'url'
=>
$d
[
'url'
]])
->
header
(
$h
);
}
else
{
$rs
=
json_encode
([
'code'
=>
$c
,
'msg'
=>
$m
,
'data'
=>
$d
,
'token'
=>
$this
->
token
]);
if
(
$c
==
400
)
{
$re
=
Response
::
create
(
ROOT_PATH
.
'app/v_msg.tpl'
,
'view'
)
->
assign
([
'msg'
=>
$m
,
'site'
=>
vconfig
(
'site_title'
)])
->
header
(
$h
);
}
else
if
(
$c
==
303
)
{
$re
=
Response
::
create
(
ROOT_PATH
.
'app/v_msg.tpl'
,
'view'
)
->
assign
([
'msg'
=>
$m
,
'site'
=>
vconfig
(
'site_title'
),
'url'
=>
$d
[
'url'
]])
->
header
(
$h
);
}
else
{
$rs
=
json_encode
([
'code'
=>
$c
,
'msg'
=>
$m
,
'data'
=>
$d
,
'token'
=>
$this
->
token
]);
$re
=
Response
::
create
(
$rs
)
->
header
(
$h
);
}
throw
new
HttpResponseException
(
$re
);
...
...
@@ -188,39 +218,39 @@ abstract class BaseController
/**
* 返回组信息
* @access protected
* @param
string|array|obj $msg
信息字符
* @param
int $code
状态码
* @param
array $data
数组信息
* @param
int $scode
页头状态码
* @param
array $header
头部
* @param
array $options
参数
* @param
string|array|obj $msg
信息字符
* @param
int $code
状态码
* @param
array $data
数组信息
* @param
int $scode
页头状态码
* @param
array $header
头部
* @param
array $options
参数
* @return html/json
*/
protected
final
function
returnMsg
(
$msg
=
''
,
$code
=
0
,
$data
=
[],
$scode
=
200
,
$header
=
[],
$options
=
[])
{
$msg
=
is_object
(
$msg
)
?
$msg
->
toArray
()
:
$msg
;
if
(
is_array
(
$msg
))
{
if
(
isset
(
$msg
[
'total'
]))
{
//分页模式
$data
=
$msg
[
'data'
];
if
(
is_array
(
$msg
))
{
if
(
isset
(
$msg
[
'total'
]))
{
//分页模式
$data
=
$msg
[
'data'
];
$count
=
$msg
[
'total'
];
$data
[
'msg'
]
=
$msg
[
'msg'
]
??
''
;
}
else
{
}
else
{
$data
=
$msg
;
}
$msg
=
$data
[
'msg'
]
??
''
;
$msg
=
$data
[
'msg'
]
??
''
;
$code
=
$data
[
'code'
]
??
$code
;
unset
(
$data
[
'msg'
],
$data
[
'code'
]);
unset
(
$data
[
'msg'
],
$data
[
'code'
]);
$data
=
$data
[
'data'
]
??
$data
;
}
elseif
(
$this
->
msgTpl
===
''
)
{
}
elseif
(
$this
->
msgTpl
===
''
)
{
$this
->
logon
((
string
)
$msg
);
}
$token
=
$this
->
token
;
$count
=
isset
(
$count
)
?
$count
:
(
is_array
(
$data
)
?
count
(
$data
)
:
1
);
if
(
$this
->
msgTpl
)
{
if
(
$this
->
msgTpl
)
{
$this
->
assign
(
compact
(
'code'
,
'msg'
,
'data'
,
'count'
,
'token'
));
return
$this
->
fetch
(
$this
->
msgTpl
);
}
else
{
}
else
{
return
json
(
compact
(
'code'
,
'msg'
,
'data'
,
'count'
,
'token'
),
$scode
,
$header
,
$options
);
}
}
...
...
@@ -228,82 +258,92 @@ abstract class BaseController
/**
* 带模板反馈提示
* @access protected
* @param
string $msg
提示信息
* @param
int $tpl
提示模板
* @param
string $url
跳转的地址
* @param
string $msg
提示信息
* @param
int $tpl
提示模板
* @param
string $url
跳转的地址
*/
protected
final
function
returnTpl
(
$msg
=
''
,
$tpl
=
''
,
$url
=
''
)
{
$tpl
=
$tpl
?:
(
$this
->
request
->
isMobile
()
?
'err'
:
ROOT_PATH
.
'app/v_msg.tpl'
);
$this
->
assign
([
'msg'
=>
$msg
,
'url'
=>
$url
]);
$this
->
assign
([
'msg'
=>
$msg
,
'url'
=>
$url
]);
return
$this
->
fetch
(
$tpl
);
}
/**
* 获取指定的参数 过滤方法后执行【key / *或?表非空时验证或$表非空时验证不规范则置空不中断 / 规则(e邮箱m手机c身份证p密码u帐号n姓名i数串a插件名v配置名)或位数范围如{1,3} / 提示(传入优先) / 合法的字符集0,1..串 默认0:字母数字汉字下划线 1:数字 2:小写字母 3:大写字母 4:汉字 5:任何非空白字符 / 允许的字符】
* @access protected
* @param
array $name
变量名 /a转数组 /d整数 /f浮点 /b布尔 /s字符串 /u网址净化 /h全净化去标签 /c转为HTML实体 /r转为2位小数 /*验证【默认允许:汉字|字母|数字|下划线|空格.#-】
* @param
mixed $type
方法类型 默认 post
* @param
string|array $filter
过滤方法 默认 strip_sql
* @param
bool $bin
是否以传入数组为准 默认是
* @param
array $name
变量名 /a转数组 /d整数 /f浮点 /b布尔 /s字符串 /u网址净化 /h全净化去标签 /c转为HTML实体 /r转为2位小数 /*验证【默认允许:汉字|字母|数字|下划线|空格.#-】
* @param
mixed $type
方法类型 默认 post
* @param
string|array $filter
过滤方法 默认 strip_sql
* @param
bool $bin
是否以传入数组为准 默认是
* @return array
*/
protected
final
function
only
(
$name
=
[],
$type
=
'post'
,
$filter
=
'strip_sql'
,
$bin
=
true
)
{
if
(
isset
(
$name
[
'@token'
]))
{
if
(
!
env
(
'APP_DEBUG'
))
{
$arr
=
array_merge
([
$this
->
tokenName
,
[]],
(
array
)
$name
[
'@token'
]);
$this
->
request
->
checkToken
(
$arr
[
0
],
$arr
[
1
])
===
false
&&
$this
->
exitMsg
(
"Token错误"
);
if
(
isset
(
$name
[
'@token'
]))
{
if
(
!
env
(
'APP_DEBUG'
))
{
$arr
=
array_merge
([
$this
->
tokenName
,
[]],
(
array
)
$name
[
'@token'
]);
$this
->
request
->
checkToken
(
$arr
[
0
],
$arr
[
1
])
===
false
&&
$this
->
exitMsg
(
"Token错误"
);
$this
->
token
=
token
(
$this
->
tokenName
);
}
unset
(
$name
[
'@token'
]);
if
(
!
$name
)
return
[];
if
(
!
$name
)
return
[];
}
$item
=
[];
$data
=
$this
->
request
->
$type
(
false
);
$preg
=
[
'e'
=>
[
2
=>
'email'
,
3
=>
'邮箱地址格式错误'
,
4
=>
''
,
5
=>
''
],
'm'
=>
[
2
=>
'mobile'
,
3
=>
'手机号码格式错误'
,
4
=>
''
,
5
=>
''
],
'c'
=>
[
2
=>
'idcard'
,
3
=>
'身份证号格式错误'
,
4
=>
''
,
5
=>
''
],
'p'
=>
[
2
=>
'{6,16}'
,
3
=>
'密码'
,
4
=>
'5'
,
5
=>
''
],
'u'
=>
[
2
=>
'{4,30}'
,
3
=>
'帐号'
,
4
=>
'1,2,3'
,
5
=>
'._@'
],
'n'
=>
[
2
=>
'{2,30}'
,
3
=>
'姓名'
,
4
=>
'0'
,
5
=>
' .'
],
'i'
=>
[
2
=>
'{1,30}'
,
3
=>
'数串'
,
4
=>
'1'
,
5
=>
','
],
'a'
=>
[
2
=>
'{3,20}'
,
3
=>
'插件名'
,
4
=>
'1,2'
,
5
=>
''
],
'v'
=>
[
2
=>
'{2,20}'
,
3
=>
'配置名'
,
4
=>
'1,2,3'
,
5
=>
'_'
]
'e'
=>
[
2
=>
'email'
,
3
=>
'邮箱地址格式错误'
,
4
=>
''
,
5
=>
''
],
'm'
=>
[
2
=>
'mobile'
,
3
=>
'手机号码格式错误'
,
4
=>
''
,
5
=>
''
],
'c'
=>
[
2
=>
'idcard'
,
3
=>
'身份证号格式错误'
,
4
=>
''
,
5
=>
''
],
'p'
=>
[
2
=>
'{6,16}'
,
3
=>
'密码'
,
4
=>
'5'
,
5
=>
''
],
'u'
=>
[
2
=>
'{4,30}'
,
3
=>
'帐号'
,
4
=>
'1,2,3'
,
5
=>
'._@'
],
'n'
=>
[
2
=>
'{2,30}'
,
3
=>
'姓名'
,
4
=>
'0'
,
5
=>
' .'
],
'i'
=>
[
2
=>
'{1,30}'
,
3
=>
'数串'
,
4
=>
'1'
,
5
=>
','
],
'a'
=>
[
2
=>
'{3,20}'
,
3
=>
'插件名'
,
4
=>
'1,2'
,
5
=>
''
],
'v'
=>
[
2
=>
'{2,20}'
,
3
=>
'配置名'
,
4
=>
'1,2,3'
,
5
=>
'_'
]
];
foreach
(
$name
as
$key
=>
$val
)
{
foreach
(
$name
as
$key
=>
$val
)
{
$default
=
''
;
$sub
=
[
''
,
''
,
''
,
''
,
'0'
,
' .#-'
];
// 对应['key','转换类型|验证符*或?','验证规则','提示','合法的字符集','允许的字符']
if
(
strpos
(
$val
,
'/'
))
{
$sub
=
[
''
,
''
,
''
,
''
,
'0'
,
' .#-'
];
// 对应['key','转换类型|验证符*或?','验证规则','提示','合法的字符集','允许的字符']
if
(
strpos
(
$val
,
'/'
))
{
$sub
=
explode
(
'/'
,
$val
)
+
$sub
;
$val
=
$sub
[
0
];
}
$flag
=
true
;
//用于是否 $filter 过滤控制
if
(
is_int
(
$key
))
{
if
(
is_int
(
$key
))
{
$key
=
$val
;
if
(
$key
[
0
]
==
'@'
){
$flag
=
false
;
$key
=
ltrim
(
$key
,
'@'
);}
if
(
!
key_exists
(
$key
,
$data
)
&&
!
$sub
[
1
]){
if
(
$key
[
0
]
==
'@'
)
{
$flag
=
false
;
$key
=
ltrim
(
$key
,
'@'
);
}
if
(
!
key_exists
(
$key
,
$data
)
&&
!
$sub
[
1
])
{
$item
[
$key
]
=
$default
;
continue
;
}
}
else
{
}
else
{
$default
=
$val
;
if
(
$key
[
0
]
==
'@'
){
$flag
=
false
;
$key
=
ltrim
(
$key
,
'@'
);}
if
(
$key
[
0
]
==
'@'
)
{
$flag
=
false
;
$key
=
ltrim
(
$key
,
'@'
);
}
}
$v
=
$data
[
$key
]
??
$default
;
if
(
$sub
[
1
])
{
if
(
$sub
[
1
])
{
$must
=
$msg
=
true
;
// $must:是否必须验证 $msg:是否验证不规范时中断反馈提示
if
(
in_array
(
$sub
[
1
],[
'?'
,
'$'
])){
$must
=
$v
?
true
:
false
;
if
(
$sub
[
1
]
==
'$'
)
$msg
=
false
;
$sub
[
1
]
=
'*'
;}
switch
(
$sub
[
1
]){
if
(
in_array
(
$sub
[
1
],
[
'?'
,
'$'
]))
{
$must
=
$v
?
true
:
false
;
if
(
$sub
[
1
]
==
'$'
)
$msg
=
false
;
$sub
[
1
]
=
'*'
;
}
switch
(
$sub
[
1
])
{
case
'a'
:
$v
=
$v
?
(
array
)
$v
:
[];
$v
=
$v
?
(
array
)
$v
:
[];
break
;
case
'd'
:
$v
=
(
int
)
$v
;
$v
=
(
int
)
$v
;
break
;
case
'u'
:
$v
=
strip_html
(
$v
,
0
);
$v
=
strip_html
(
$v
,
0
);
break
;
case
'h'
:
$v
=
strip_html
(
$v
);
...
...
@@ -315,37 +355,45 @@ abstract class BaseController
$v
=
dround
(
$v
);
break
;
case
'*'
:
if
(
$sub
[
2
]
==
'p'
)
$must
=
is_md5
(
$v
)
?
false
:
$must
;
$tip
=
$sub
[
3
];
if
(
isset
(
$preg
[
$sub
[
2
]])){
$sub
=
$preg
[
$sub
[
2
]]
+
$sub
;
$tip
=
$tip
?:
$sub
[
3
];}
$reg
=
explode
(
','
,
$sub
[
4
]);
if
(
$must
&&
!
is_preg
(
$v
,
$sub
[
2
],
$reg
,
$sub
[
5
])){
if
(
$msg
){
$tip
=
$tip
?:
"字段
{
$key
}
不合规范"
;
$txt
=
[
'汉字字母数字下划线'
,
'数字'
,
'小写字母'
,
'大写字母'
,
'汉字'
,
'任何非空白字符'
];
if
(
$reg
[
0
]
!==
''
){
$str
=
''
;
foreach
(
$reg
as
$i
){
$str
.=
(
$txt
[
$i
]
??
''
)
.
'、'
;}
$tip
=
$tip
.
'必须由'
.
(
str_replace
([
'{'
,
','
,
'}'
],[
''
,
'-'
,
''
],
$sub
[
2
]))
.
'位'
.
rtrim
(
$str
,
'、'
)
.
(
$sub
[
5
]
?
'和'
.
str_replace
(
' '
,
'空格'
,
$sub
[
5
])
:
''
)
.
'组成'
;
if
(
$sub
[
2
]
==
'p'
)
$must
=
is_md5
(
$v
)
?
false
:
$must
;
$tip
=
$sub
[
3
];
if
(
isset
(
$preg
[
$sub
[
2
]]))
{
$sub
=
$preg
[
$sub
[
2
]]
+
$sub
;
$tip
=
$tip
?:
$sub
[
3
];
}
$reg
=
explode
(
','
,
$sub
[
4
]);
if
(
$must
&&
!
is_preg
(
$v
,
$sub
[
2
],
$reg
,
$sub
[
5
]))
{
if
(
$msg
)
{
$tip
=
$tip
?:
"字段
{
$key
}
不合规范"
;
$txt
=
[
'汉字字母数字下划线'
,
'数字'
,
'小写字母'
,
'大写字母'
,
'汉字'
,
'任何非空白字符'
];
if
(
$reg
[
0
]
!==
''
)
{
$str
=
''
;
foreach
(
$reg
as
$i
)
{
$str
.=
(
$txt
[
$i
]
??
''
)
.
'、'
;
}
$tip
=
$tip
.
'必须由'
.
(
str_replace
([
'{'
,
','
,
'}'
],
[
''
,
'-'
,
''
],
$sub
[
2
]))
.
'位'
.
rtrim
(
$str
,
'、'
)
.
(
$sub
[
5
]
?
'和'
.
str_replace
(
' '
,
'空格'
,
$sub
[
5
])
:
''
)
.
'组成'
;
}
$this
->
exitMsg
(
$tip
);
}
else
{
}
else
{
$v
=
''
;
}
}
break
;
case
'f'
:
$v
=
(
float
)
$v
;
$v
=
(
float
)
$v
;
break
;
case
'b'
:
$v
=
(
boolean
)
$v
;
$v
=
(
boolean
)
$v
;
break
;
case
's'
:
if
(
is_scalar
(
$v
))
{
$v
=
(
string
)
$v
;
}
else
{
if
(
is_scalar
(
$v
))
{
$v
=
(
string
)
$v
;
}
else
{
throw
new
\InvalidArgumentException
(
'variable type error:'
.
gettype
(
$v
));
}
break
;
}
if
(
$sub
[
1
]
!=
'*'
&&
$sub
[
2
]
&&
!
$v
)
$this
->
exitMsg
(
$sub
[
2
]);
if
(
$sub
[
1
]
!=
'*'
&&
$sub
[
2
]
&&
!
$v
)
$this
->
exitMsg
(
$sub
[
2
]);
}
$item
[
$key
]
=
$flag
?
call_user_func
(
$filter
,
$v
)
:
$v
;
}
...
...
app/admin/controller/AdminBase.php
View file @
2704d431
...
...
@@ -49,6 +49,15 @@ abstract class AdminBase extends BaseController
*/
protected
function
__home
()
{
}
/**
* 覆盖无需业务
*/
protected
function
__website
()
{
}
/**
...
...
app/admin/controller/Index.php
View file @
2704d431
...
...
@@ -7,14 +7,16 @@
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\admin\controller
;
use
app\job\Jobtask
;
use
app\model\system\SystemDict
as
Dict
;
use
app\model\system\SystemMenus
as
Menus
;
use
app\model\system\SystemCategory
as
Category
;
use
think\facade\Db
;
use
think\facade\Queue
;
use
Carbon\Carbon
;
/**
* 后台主控制器
...
...
@@ -27,72 +29,176 @@ class Index extends AdminBase
*/
public
function
index
()
{
$this
->
assign
([
"appMap"
=>
$this
->
appMap
,
"appMap"
=>
$this
->
appMap
,
"tokenName"
=>
$this
->
tokenName
]);
return
$this
->
fetch
(
''
,
''
,
false
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
/**
* 后台主面板
* @return mixed
*/
public
function
main
()
{
$business_dsh_count
=
Db
::
name
(
'business'
)
->
where
([
'is_del'
=>
'0'
,
'status'
=>
0
])
->
count
();
//企业资料待审核
$school_dsh_count
=
Db
::
name
(
'school'
)
->
where
([
'is_del'
=>
'0'
,
'status'
=>
0
])
->
count
();
//学校资料待审核
$course_dsh_count
=
Db
::
name
(
'sh_course'
)
->
where
([
'is_del'
=>
'0'
,
'status'
=>
1
])
->
count
();
//课程待审核
$project_dsh_count
=
Db
::
name
(
'project'
)
->
where
([
'sh_status'
=>
0
])
->
where
(
'deletetime'
,
'NUll'
)
->
count
();
//项目待审核
$tixian_dsh_count
=
Db
::
name
(
'user_withdrawal'
)
->
where
([
'sh_status'
=>
0
])
->
where
(
'deletetime'
,
'NUll'
)
->
count
();
//提现待审核
$tixian_dk_dsh_count
=
Db
::
name
(
'user_withdrawal'
)
->
where
([
'sh_status'
=>
2
,
'dk_status'
=>
0
])
->
where
(
'deletetime'
,
'NUll'
)
->
count
();
//打款待审核
$data
[
'business_dsh_count'
]
=
$business_dsh_count
??
0
;
$data
[
'school_dsh_count'
]
=
$school_dsh_count
??
0
;
$data
[
'course_dsh_count'
]
=
$course_dsh_count
??
0
;
$data
[
'project_dsh_count'
]
=
$project_dsh_count
??
0
;
$data
[
'tixian_dsh_count'
]
=
$tixian_dsh_count
??
0
;
$data
[
'tixian_dk_dsh_count'
]
=
$tixian_dk_dsh_count
??
0
;
$visitors_sum
=
Db
::
name
(
'webiste'
)
->
where
(
'id'
,
1
)
->
value
(
'unique_visitors'
);
//总访问量
$todayStart
=
Carbon
::
today
()
->
timestamp
;
// 今日开始时间(00:00:00)
$todayEnd
=
Carbon
::
today
()
->
endOfDay
()
->
timestamp
;
// 今日结束时间(23:59:59)
$map
[]
=
[
'logtime'
,
'>='
,
$todayStart
];
$map
[]
=
[
'logtime'
,
'<='
,
$todayEnd
];
$day_visitors
=
Db
::
name
(
'webiste_log'
)
->
where
(
$map
)
->
count
();
//今日访问量
$payment_sum_money
=
Db
::
name
(
'payment'
)
->
where
(
'pay_status'
,
1
)
->
sum
(
'pay_amount'
);
//总销售金额
$monthStart
=
Carbon
::
now
()
->
startOfMonth
()
->
timestamp
;
// 本月1号 00:00:00
$monthEnd
=
Carbon
::
now
()
->
endOfMonth
()
->
timestamp
;
// 本月最后一天 23:59:59
$map
=
[];
$map
[]
=
[
'pay_time'
,
'>='
,
$monthStart
];
$map
[]
=
[
'pay_time'
,
'<='
,
$monthEnd
];
$map
[]
=
[
'pay_status'
,
'='
,
1
];
$month_sum_money
=
Db
::
name
(
'payment'
)
->
where
(
$map
)
->
sum
(
'pay_amount'
);
//月销售金额
$payment_sum_count
=
Db
::
name
(
'payment'
)
->
where
(
'pay_status'
,
1
)
->
count
();
//订单量
$map
=
[];
$map
[]
=
[
'pay_time'
,
'>='
,
$monthStart
];
$map
[]
=
[
'pay_time'
,
'<='
,
$monthEnd
];
$map
[]
=
[
'pay_status'
,
'='
,
1
];
$month_payment_count
=
Db
::
name
(
'payment'
)
->
where
(
$map
)
->
sum
(
'pay_amount'
);
//月订单量
$user_sum_count
=
Db
::
name
(
'user'
)
->
where
(
'is_del'
,
0
)
->
count
();
//总用户数量
$map
=
[];
$map
[]
=
[
'reg_time'
,
'>='
,
$todayStart
];
$map
[]
=
[
'reg_time'
,
'<='
,
$todayEnd
];
$user_day_count
=
Db
::
name
(
'user'
)
->
where
(
$map
)
->
count
();
//今日新增用户量
$course_sum_tvclick_count
=
Db
::
name
(
'course'
)
->
where
(
'is_del'
,
0
)
->
sum
(
'tvclick'
);
//课程总播放量
$course_sum_count
=
Db
::
name
(
'course'
)
->
where
(
'is_del'
,
0
)
->
count
();
//课程数量
$data
[
'visitors_sum'
]
=
$visitors_sum
;
$data
[
'day_visitors'
]
=
$day_visitors
;
$data
[
'payment_sum_money'
]
=
$payment_sum_money
;
$data
[
'month_sum_money'
]
=
$month_sum_money
;
$data
[
'payment_sum_count'
]
=
$payment_sum_count
;
$data
[
'month_payment_count'
]
=
$month_payment_count
;
$data
[
'user_sum_count'
]
=
$user_sum_count
;
$data
[
'user_day_count'
]
=
$user_day_count
;
$data
[
'course_sum_tvclick_count'
]
=
$course_sum_tvclick_count
;
$data
[
'course_sum_count'
]
=
$course_sum_count
;
//统计图
// 如果需要每天的起始和结束时间戳
$recent15DaysRanges
=
[];
for
(
$i
=
0
;
$i
<
15
;
$i
++
)
{
$day
=
Carbon
::
now
()
->
subDays
(
$i
);
$recent15DaysRanges
[]
=
[
'start'
=>
$day
->
startOfDay
()
->
timestamp
,
'end'
=>
$day
->
endOfDay
()
->
timestamp
,
'date'
=>
date
(
'm-d'
,
$day
->
timestamp
)
];
}
$add_user_category
=
array_column
(
$recent15DaysRanges
,
'date'
);
$add_user_series
=
[];
foreach
(
$recent15DaysRanges
as
$k
=>
$v
)
{
$map
=
[];
$map
[]
=
[
'reg_time'
,
'>='
,
$v
[
'start'
]];
$map
[]
=
[
'reg_time'
,
'<='
,
$v
[
'end'
]];
$map
[]
=
[
'is_del'
,
'='
,
0
];
$add_user_series
[]
=
Db
::
name
(
'user'
)
->
where
(
$map
)
->
count
();
//新增用户量
}
$data
[
'add_user_category'
]
=
$add_user_category
?
json_encode
(
$add_user_category
)
:
[];
$data
[
'add_user_series'
]
=
$add_user_series
?
json_encode
(
$add_user_series
)
:
[];
//销售金额
$add_payment_category
=
$add_user_category
;
$add_payment_series
=
[];
foreach
(
$recent15DaysRanges
as
$k
=>
$v
)
{
$map
=
[];
$map
[]
=
[
'pay_time'
,
'>='
,
$v
[
'start'
]];
$map
[]
=
[
'pay_time'
,
'<='
,
$v
[
'end'
]];
$map
[]
=
[
'pay_status'
,
'='
,
1
];
$add_payment_series
[]
=
Db
::
name
(
'payment'
)
->
where
(
$map
)
->
sum
(
'pay_amount'
);
//销售金额
}
$data
[
'add_payment_category'
]
=
$add_payment_category
?
json_encode
(
$add_payment_category
)
:
[];
$data
[
'add_payment_series'
]
=
$add_payment_series
?
json_encode
(
$add_payment_series
)
:
[];
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
();
}
public
function
main11111111111
()
{
// Queue::push(Jobtask::class, '','coursetask'); // 推送到队列的任务类及其数据参数
if
(
$this
->
request
->
isPost
())
{
return
$this
->
returnMsg
(
'登录成功!'
,
1
);
if
(
$this
->
request
->
isPost
())
{
return
$this
->
returnMsg
(
'登录成功!'
,
1
);
}
$data
[
'type'
]
=
'imagewt'
;
$data
[
'name'
]
=
'headimgwt'
;
$this
->
assign
(
'data'
,
$data
);
$this
->
assign
(
'data'
,
$data
);
$data2
[
'type'
]
=
'imageswt'
;
$data2
[
'name'
]
=
'headimgwt2'
;
$data2
[
'value'
]
=
''
;
$this
->
assign
(
'data2'
,
$data2
);
$this
->
assign
(
'data2'
,
$data2
);
$data3
[
'type'
]
=
'imageswt'
;
$data3
[
'name'
]
=
'headimgwts2'
;
$data3
[
'value'
]
=
''
;
$this
->
assign
(
'data3'
,
$data3
);
$this
->
assign
(
'data3'
,
$data3
);
$data4
[
'type'
]
=
'upfilewt'
;
$data4
[
'name'
]
=
'filename'
;
$data4
[
'value'
]
=
''
;
$this
->
assign
(
'data4'
,
$data4
);
$this
->
assign
(
'data4'
,
$data4
);
return
$this
->
fetch
();
}
/**
* 获取左侧菜单和用户信息
* @param
int $do
是否更新字典缓存0否1是
* @param
int $do
是否更新字典缓存0否1是
* @return json
*/
public
function
json
(
int
$do
=
0
)
{
$arr
=
[];
$cat
=
Category
::
catList
([[
'state'
,
'='
,
1
],[
'type'
,
'='
,
'01'
]],
0
,
'title,icon,catid'
);
// 获取菜单分类
$data
=
Menus
::
getMenus
(
array_intersect_key
(
$this
->
manUser
,
[
'userid'
=>
""
,
'role_menuid'
=>
""
]));
// 获取拥有的菜单数据
$rs
=
[
'menus'
=>
$cat
?
[
'cat'
=>
$cat
,
'menus'
=>
$data
[
'menus'
]]
:
$data
[
'menus'
],
'user'
=>
$this
->
manUser
+
[
'roles'
=>
$data
[
'roles'
]]
+
[
'rolem'
=>
\app\model\system\SystemRoles
::
where
(
"state = 1 AND roleid IN("
.
$this
->
manUser
[
'roleids'
]
.
")"
)
->
column
(
"roleid id,role_name name"
)]
+
[
'dict'
=>
Dict
::
cache
((
int
)
$do
)]
$cat
=
Category
::
catList
([[
'state'
,
'='
,
1
],
[
'type'
,
'='
,
'01'
]],
0
,
'title,icon,catid'
);
// 获取菜单分类
$data
=
Menus
::
getMenus
(
array_intersect_key
(
$this
->
manUser
,
[
'userid'
=>
""
,
'role_menuid'
=>
""
]));
// 获取拥有的菜单数据
$rs
=
[
'menus'
=>
$cat
?
[
'cat'
=>
$cat
,
'menus'
=>
$data
[
'menus'
]]
:
$data
[
'menus'
],
'user'
=>
$this
->
manUser
+
[
'roles'
=>
$data
[
'roles'
]]
+
[
'rolem'
=>
\app\model\system\SystemRoles
::
where
(
"state = 1 AND roleid IN("
.
$this
->
manUser
[
'roleids'
]
.
")"
)
->
column
(
"roleid id,role_name name"
)]
+
[
'dict'
=>
Dict
::
cache
((
int
)
$do
)]
];
unset
(
$rs
[
'user'
][
'password'
],
$rs
[
'user'
][
'passsalt'
]);
unset
(
$rs
[
'user'
][
'password'
],
$rs
[
'user'
][
'passsalt'
]);
return
json
(
$rs
);
}
/**
* 清空缓存
* @return json
*/
public
function
clear
(){
\think\facade\Cache
::
clear
();
public
function
clear
()
{
\think\facade\Cache
::
clear
();
return
$this
->
returnMsg
(
"清理缓存成功!"
);
}
...
...
@@ -102,9 +208,9 @@ class Index extends AdminBase
*/
public
function
ip
()
{
$url
=
'https://whois.pconline.com.cn/ipJson.jsp?callback='
.
input
(
'callback'
)
.
'&ip='
.
input
(
'ip'
);
$url
=
'https://whois.pconline.com.cn/ipJson.jsp?callback='
.
input
(
'callback'
)
.
'&ip='
.
input
(
'ip'
);
$cont
=
trim
(
file_get_contents
(
$url
));
$cont
=
iconv
(
"gb2312"
,
"utf-8//IGNORE"
,
$cont
);
$cont
=
iconv
(
"gb2312"
,
"utf-8//IGNORE"
,
$cont
);
return
$cont
;
}
...
...
app/admin/controller/course/Course.php
View file @
2704d431
...
...
@@ -62,6 +62,7 @@ class Course extends AdminBase
$category
=
CourseCategoryModel
::
field
(
'*,pid as parentid'
)
->
where
(
'is_del'
,
0
)
->
order
(
'sort desc'
)
->
select
()
->
toArray
();
$this
->
assign
(
'category'
,
json_encode
(
$category
));
$this
->
assign
(
'limit'
,
$limit
);
$this
->
assign
(
'get'
,
input
());
return
$this
->
fetch
(
''
,
''
,
false
);
}
...
...
app/admin/view/caiwu/withdrawal/index.html
View file @
2704d431
...
...
@@ -19,21 +19,21 @@
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"kw"
placeholder=
"提现单号"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"user"
placeholder=
"用户名,用户手机"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"sh_status"
>
<select
name=
"sh_status"
id=
"statusselect-tixian"
>
<option
value=
"-1"
>
审核状态
</option>
<option
value=
"0"
>
待审核
</option>
<option
value=
"1"
>
审核失败
</option>
<option
value=
"2"
>
审核通过
</option>
<option
value=
"0"
{
php
}
if
(
input
('
sh_status
')
==
0
){
echo
'
selected
';}{/
php
}
>
待审核
</option>
<option
value=
"1"
{
php
}
if
(
input
('
sh_status
')
==
1
){
echo
'
selected
';}{/
php
}
>
审核失败
</option>
<option
value=
"2"
{
php
}
if
(
input
('
sh_status
')
==
2
){
echo
'
selected
';}{/
php
}
>
审核通过
</option>
</select>
</div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"dk_status"
>
<select
name=
"dk_status"
id=
"dkstatusselect-tixian"
>
<option
value=
"-1"
>
打款状态
</option>
<option
value=
"0"
>
未打款
</option>
<option
value=
"1"
>
打款中
</option>
<option
value=
"2"
>
打款失败
</option>
<option
value=
"3"
>
已打款
</option>
<option
value=
"0"
{
php
}
if
(
input
('
dk_status
')
==
0
){
echo
'
selected
';}{/
php
}
>
未打款
</option>
<option
value=
"1"
{
php
}
if
(
input
('
dk_status
')
==
1
){
echo
'
selected
';}{/
php
}
>
打款中
</option>
<option
value=
"2"
{
php
}
if
(
input
('
dk_status
')
==
2
){
echo
'
selected
';}{/
php
}
>
打款失败
</option>
<option
value=
"3"
{
php
}
if
(
input
('
dk_status
')
==
3
){
echo
'
selected
';}{/
php
}
>
已打款
</option>
</select>
</div>
<div
class=
"layui-inline"
>
...
...
@@ -101,6 +101,8 @@
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
;
var
sh_status
=
$
(
"#statusselect-tixian"
).
val
();
var
dk_status
=
$
(
"#dkstatusselect-tixian"
).
val
();
/*渲染数据*/
table
.
render
({
elem
:
'#withdrawal'
,
...
...
@@ -109,6 +111,7 @@
height
:
'full-341'
,
// toolbar: 'default', //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
url
:
app_root
+
"index?&do=json"
,
where
:{
sh_status
:
sh_status
,
dk_status
:
dk_status
},
// css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}',
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
...
...
app/admin/view/course/course/index.html
View file @
2704d431
...
...
@@ -29,12 +29,12 @@
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"kw"
placeholder=
"课程关键词"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"status"
>
<select
name=
"status"
id=
"statusselect"
>
<option
value=
"-1"
>
审核状态
</option>
<option
value=
"0"
>
待提交
</option>
<option
value=
"1"
>
待审核
</option>
<option
value=
"2"
>
审核失败
</option>
<option
value=
"3"
>
审核成功
</option>
<option
value=
"0"
{
php
}
if
(
input
('
status
')
==
0
){
echo
'
selected
';}{/
php
}
>
待提交
</option>
<option
value=
"1"
{
php
}
if
(
input
('
status
')
==
1
){
echo
'
selected
';}{/
php
}
>
待审核
</option>
<option
value=
"2"
{
php
}
if
(
input
('
status
')
==
2
){
echo
'
selected
';}{/
php
}
>
审核失败
</option>
<option
value=
"3"
{
php
}
if
(
input
('
status
')
==
3
){
echo
'
selected
';}{/
php
}
>
审核成功
</option>
</select>
</div>
<div
class=
"layui-inline"
>
...
...
@@ -125,9 +125,8 @@
// load ? item.find('.layui-tree-main>.layui-tree-txt').trigger('click') : item.addClass('organ-tree-click');
}
/*初始渲染*/
/*==============左树结构END==============*/
var
status
=
$
(
"#statusselect"
).
val
();
/*渲染数据*/
table
.
render
({
elem
:
'#course'
,
...
...
@@ -136,6 +135,7 @@
height
:
'full-341'
,
url
:
app_root
+
"index?&do=json"
,
// css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}',
where
:{
status
:
status
},
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
...
...
app/admin/view/index/index.html
View file @
2704d431
...
...
@@ -95,5 +95,6 @@ layui.config({
});
});
</script>
<script
src=
"https://cdn.jsdelivr.net/npm/echarts@5.6.0/dist/echarts.min.js"
></script>
</body>
</html>
\ No newline at end of file
app/admin/view/index/main.html
View file @
2704d431
<tpl>
<div
class=
"layui-fluid"
>
<style>
.pull-right2
{
margin-top
:
10px
;}
.console-app-group
{
display
:
block
;
padding
:
16px
;
border-radius
:
4px
;
text-align
:
center
;
background-color
:
#fff
;
cursor
:
pointer
;
}
.layui-col-md3
{
width
:
20%
;}
</style>
<div
class=
"layui-fluid ew-console-wrapper"
>
<div
class=
"layui-row layui-col-space15"
>
<div
class=
"layui-col-xs6 layui-col-sm2"
>
<a
class=
"console-app-group"
href=
"#/users.business/index/status=0"
>
<p
class=
"lay-big-font layui-font-red"
>
{$data.business_dsh_count}
</p>
<div
class=
"console-app-name"
>
企业资料待审核
</div>
</a>
</div>
<div
class=
"layui-col-xs6 layui-col-sm2"
>
<a
class=
"console-app-group"
href=
"#/users.school/index/status=0"
>
<p
class=
"lay-big-font layui-font-red"
>
{$data.school_dsh_count}
</p>
<div
class=
"console-app-name"
>
学校资料待审核
</div>
</a>
</div>
<div
class=
"layui-col-xs6 layui-col-sm2"
>
<a
class=
"console-app-group"
href=
"#/course.course/index/status=1"
>
<p
class=
"lay-big-font layui-font-red"
>
{$data.course_dsh_count}
</p>
<div
class=
"console-app-name"
>
课程待审核
</div>
</a>
</div>
<div
class=
"layui-col-xs6 layui-col-sm2"
>
<a
class=
"console-app-group"
href=
"#/project.project/index/sh_status=0"
>
<p
class=
"lay-big-font layui-font-red"
>
{$data.project_dsh_count}
</p>
<div
class=
"console-app-name"
>
项目待审核
</div>
</a>
</div>
<div
class=
"layui-col-xs6 layui-col-sm2"
>
<a
class=
"console-app-group"
href=
"#/caiwu.withdrawal/index/sh_status=0"
>
<p
class=
"lay-big-font layui-font-red"
>
{$data.tixian_dsh_count}
</p>
<div
class=
"console-app-name"
>
提现待审核
</div>
</a>
</div>
<div
class=
"layui-col-xs6 layui-col-sm2"
>
<a
class=
"console-app-group"
href=
"#/caiwu.withdrawal/index/sh_status=2/dk_status=0"
>
<p
class=
"lay-big-font layui-font-red"
>
{$data.tixian_dk_dsh_count}
</p>
<div
class=
"console-app-name"
>
提现待打款
</div>
</a>
</div>
</div>
<div
class=
"layui-row layui-col-space15"
>
<div
class=
"layui-col-xs12 layui-col-sm6 layui-col-md3"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
访问量
<span
class=
"layui-badge layui-badge-green pull-right pull-right2"
>
日
</span>
</div>
<div
class=
"layui-card-body"
>
<p
class=
"lay-big-font"
>
{$data.day_visitors}
</p>
<p>
总访问量
<span
class=
"pull-right"
>
{$data.visitors_sum}
</span></p>
</div>
</div>
</div>
<div
class=
"layui-col-xs12 layui-col-sm6 layui-col-md3"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
销售额
<span
class=
"layui-badge layui-badge-blue pull-right pull-right2"
>
月
</span>
</div>
<div
class=
"layui-card-body"
>
<p
class=
"lay-big-font"
><span
style=
"font-size: 26px;line-height: 1;"
>
¥
</span>
{$data.month_sum_money}
</p>
<p>
总销售额
<span
class=
"pull-right"
>
{$data.payment_sum_money}
</span></p>
</div>
</div>
</div>
<div
class=
"layui-col-xs12 layui-col-sm6 layui-col-md3"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
订单量
<span
class=
"layui-badge layui-badge-blue pull-right pull-right2"
>
月
</span>
</div>
<div
class=
"layui-card-body"
>
<p
class=
"lay-big-font"
>
{$data.month_payment_count}
</p>
<p>
总订单量
<span
class=
"pull-right"
>
{$data.payment_sum_count}
</span></p>
</div>
</div>
</div>
<div
class=
"layui-col-xs12 layui-col-sm6 layui-col-md3"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
新增用户
<span
class=
"layui-badge layui-badge-green pull-right pull-right2"
>
日
</span>
</div>
<div
class=
"layui-card-body"
>
<p
class=
"lay-big-font"
>
{$data.user_day_count}
<span
style=
"font-size: 24px;line-height: 1;"
>
人
</span></p>
<p>
总用户
<span
class=
"pull-right"
>
{$data.user_sum_count} 人
</span></p>
</div>
</div>
</div>
<div
class=
"layui-col-xs12 layui-col-sm6 layui-col-md3 "
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
播放量
<span
class=
"layui-badge layui-badge-green pull-right pull-right2"
>
总
</span>
</div>
<div
class=
"layui-card-body"
>
<p
class=
"lay-big-font"
>
{$data.course_sum_tvclick_count}
<span
style=
"font-size: 24px;line-height: 1;"
></span></p>
<p>
课程数量
<span
class=
"pull-right"
>
{$data.course_sum_count}
</span></p>
</div>
</div>
</div>
<div
style=
"clear: both;"
></div>
</div>
<div
class=
"layui-row layui-col-space15"
>
<div
class=
"layui-col-xs12 layui-col-sm6 "
>
<div
class=
"layui-card"
style=
"padding-top: 10px;"
>
<div
id=
"myChart"
style=
"height:400px; "
></div>
</div>
</div>
<div
class=
"layui-col-xs12 layui-col-sm6 "
>
<div
class=
"layui-card"
style=
"padding-top: 10px;"
>
<div
id=
"myChart2"
style=
"height:400px; "
></div>
</div>
</div>
<div
style=
"clear: both;"
></div>
</div>
</div>
</div>
<script>
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'myChart'
));
option
=
{
// title : {
// text: '新增用户统计',
// subtext: ''
// },
tooltip
:
{
trigger
:
'axis'
},
legend
:
{
data
:[
'新增用户'
]
},
toolbox
:
{
show
:
true
,
feature
:
{
mark
:
{
show
:
true
},
dataView
:
{
show
:
true
,
readOnly
:
false
},
magicType
:
{
show
:
true
,
type
:
[
'line'
,
'bar'
]},
restore
:
{
show
:
true
},
saveAsImage
:
{
show
:
true
}
}
},
calculable
:
true
,
xAxis
:
[
{
type
:
'category'
,
data
:
{
$data
.
add_user_category
|
raw
}
}
],
yAxis
:
[
{
type
:
'value'
}
],
series
:
[
{
name
:
'新增用户'
,
type
:
'bar'
,
data
:{
$data
.
add_user_series
},
markPoint
:
{
data
:
[
{
type
:
'max'
,
name
:
'最大值'
},
{
type
:
'min'
,
name
:
'最小值'
}
]
},
markLine
:
{
data
:
[
{
type
:
'average'
,
name
:
'平均值'
}
]
}
}
]
};
myChart
.
setOption
(
option
);
var
myChart2
=
echarts
.
init
(
document
.
getElementById
(
'myChart2'
));
option
=
{
// title : {
// text: '销售金额',
// subtext: ''
// },
tooltip
:
{
trigger
:
'axis'
},
legend
:
{
data
:[
'销售金额'
]
},
toolbox
:
{
show
:
true
,
feature
:
{
mark
:
{
show
:
true
},
dataView
:
{
show
:
true
,
readOnly
:
false
},
magicType
:
{
show
:
true
,
type
:
[
'line'
,
'bar'
]},
restore
:
{
show
:
true
},
saveAsImage
:
{
show
:
true
}
}
},
calculable
:
true
,
xAxis
:
[
{
type
:
'category'
,
data
:
{
$data
.
add_payment_category
|
raw
}
}
],
yAxis
:
[
{
type
:
'value'
}
],
series
:
[
{
name
:
'销售金额'
,
type
:
'bar'
,
data
:{
$data
.
add_payment_series
},
markPoint
:
{
data
:
[
{
type
:
'max'
,
name
:
'最大值'
},
{
type
:
'min'
,
name
:
'最小值'
}
]
},
markLine
:
{
data
:
[
{
type
:
'average'
,
name
:
'平均值'
}
]
}
}
]
};
myChart2
.
setOption
(
option
);
</script>
</tpl>
\ No newline at end of file
app/admin/view/project/project/index.html
View file @
2704d431
...
...
@@ -30,11 +30,11 @@
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"kw"
placeholder=
"关键词"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"user"
placeholder=
"用户名,用户手机"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"sh_status"
>
<select
name=
"sh_status"
id=
"statusselect-project"
>
<option
value=
""
>
审核状态
</option>
<option
value=
"0"
>
审核中
</option>
<option
value=
"1"
>
审核失败
</option>
<option
value=
"2"
>
审核通过
</option>
<option
value=
"0"
{
php
}
if
(
input
('
sh_status
')
==
0
){
echo
'
selected
';}{/
php
}
>
审核中
</option>
<option
value=
"1"
{
php
}
if
(
input
('
sh_status
')
==
1
){
echo
'
selected
';}{/
php
}
>
审核失败
</option>
<option
value=
"2"
{
php
}
if
(
input
('
sh_status
')
==
2
){
echo
'
selected
';}{/
php
}
>
审核通过
</option>
</select>
</div>
...
...
@@ -150,7 +150,7 @@
/*初始渲染*/
/*==============左树结构END==============*/
var
sh_status
=
$
(
"#statusselect-project"
).
val
();
/*渲染数据*/
table
.
render
({
elem
:
'#project'
,
...
...
@@ -159,6 +159,7 @@
height
:
'full-341'
,
url
:
app_root
+
"index?&do=json"
,
// css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}',
where
:{
sh_status
:
sh_status
},
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
...
...
app/admin/view/users/business/index.html
View file @
2704d431
...
...
@@ -13,11 +13,11 @@
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"kw"
placeholder=
"用户名,用户手机号"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"business"
placeholder=
"学校名称"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"status"
>
<select
name=
"status"
id=
"statusselect-business"
>
<option
value=
"-1"
>
审核状态
</option>
<option
value=
"1"
>
审核通过
</option>
<option
value=
"2"
>
审核失败
</option>
<option
value=
"0"
>
待审核
</option>
<option
value=
"1"
{
php
}
if
(
input
('
status
')
==
1
){
echo
'
selected
';}{/
php
}
>
审核通过
</option>
<option
value=
"2"
{
php
}
if
(
input
('
status
')
==
2
){
echo
'
selected
';}{/
php
}
>
审核失败
</option>
<option
value=
"0"
{
php
}
if
(
input
('
status
')
==
0
){
echo
'
selected
';}{/
php
}
>
待审核
</option>
</select>
</div>
...
...
@@ -76,13 +76,14 @@
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
;
var
dropdown
=
layui
.
dropdown
;
/*初始渲染*/
var
status
=
$
(
"#statusselect-business"
).
val
();
table
.
render
({
elem
:
'#business'
,
page
:
true
,
limit
:{
$limit
},
height
:
'full-341'
,
url
:
app_root
+
"index?&do=json"
,
where
:{
status
:
status
},
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
...
...
app/admin/view/users/school/index.html
View file @
2704d431
...
...
@@ -13,11 +13,11 @@
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"kw"
placeholder=
"用户名,用户手机号"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"school"
placeholder=
"学校名称"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:150px;"
>
<select
name=
"status"
>
<select
name=
"status"
id=
"statusselect-school"
>
<option
value=
"-1"
>
审核状态
</option>
<option
value=
"1"
>
审核通过
</option>
<option
value=
"2"
>
审核失败
</option>
<option
value=
"0"
>
待审核
</option>
<option
value=
"1"
{
php
}
if
(
input
('
status
')
==
1
){
echo
'
selected
';}{/
php
}
>
审核通过
</option>
<option
value=
"2"
{
php
}
if
(
input
('
status
')
==
2
){
echo
'
selected
';}{/
php
}
>
审核失败
</option>
<option
value=
"0"
{
php
}
if
(
input
('
status
')
==
0
){
echo
'
selected
';}{/
php
}
>
待审核
</option>
</select>
</div>
...
...
@@ -80,7 +80,7 @@
/*渲染数据*/
var
status
=
$
(
"#statusselect-school"
).
val
();
table
.
render
({
elem
:
'#school'
,
...
...
@@ -88,6 +88,7 @@
limit
:{
$limit
},
height
:
'full-341'
,
url
:
app_root
+
"index?&do=json"
,
where
:{
status
:
status
},
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
...
...
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