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
c3b1b8e1
Commit
c3b1b8e1
authored
Jun 30, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学习资料
parent
48708b23
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
126 additions
and
36 deletions
+126
-36
info.ini
addons/build/info.ini
+4
-4
BaseController.php
app/BaseController.php
+54
-21
Login.php
app/admin/controller/Login.php
+4
-1
Withdrawal.php
app/admin/controller/caiwu/Withdrawal.php
+4
-0
CertOrder.php
app/admin/controller/cert/CertOrder.php
+7
-1
Course.php
app/admin/controller/course/Course.php
+12
-7
Project.php
app/admin/controller/project/Project.php
+7
-0
common.php
app/common.php
+15
-0
Jobtask.php
app/job/Jobtask.php
+1
-0
CourseUserWork.php
app/model/CourseUserWork.php
+7
-0
Mail.php
app/model/project/Mail.php
+9
-0
UserMoneyLog.php
app/model/project/UserMoneyLog.php
+2
-2
No files found.
addons/build/info.ini
View file @
c3b1b8e1
name
=
build
name
=
build
title
=
Veitool框架命令构建器
title
=
''
intro
=
基于Veitool快捷开发框架的命令构建器
intro
=
''
author
=
veitool
author
=
''
website
=
https://www.veitool.com
website
=
''
version
=
1.0.1
version
=
1.0.1
state
=
1
state
=
1
home
=
0
home
=
0
...
...
app/BaseController.php
View file @
c3b1b8e1
...
@@ -92,18 +92,44 @@ abstract class BaseController
...
@@ -92,18 +92,44 @@ abstract class BaseController
$ip
=
$this
->
request
->
ip
();
$ip
=
$this
->
request
->
ip
();
$websitelog
=
Cache
::
get
(
'webistelog:'
.
$ip
);
$websitelog
=
Cache
::
get
(
'webistelog:'
.
$ip
);
if
(
empty
(
$websitelog
))
{
if
(
$websitelog
)
{
$url
=
substr
(
vhtmlspecialchars
(
strip_sql
(
$this
->
request
->
url
())),
0
,
200
);
return
;
$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
);
}
}
$filename
=
'data_lock_'
.
$ip
.
'.txt'
;
$fp
=
fopen
(
$filename
,
'c + '
);
// 'c + ' 模式避免截断文件
try
{
// 尝试获取锁
if
(
flock
(
$fp
,
LOCK_EX
))
{
$websitelog
=
Cache
::
get
(
'webistelog:'
.
$ip
);
if
(
$websitelog
)
{
return
;
}
$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
);
// 释放锁
flock
(
$fp
,
LOCK_UN
);
}
fclose
(
$fp
);
unlink
(
$filename
);
}
catch
(
\Exception
$e
)
{
// 确保发生异常时释放锁并关闭文件
if
(
is_resource
(
$fp
))
{
flock
(
$fp
,
LOCK_UN
);
fclose
(
$fp
);
unlink
(
$filename
);
}
}
}
}
/**
/**
...
@@ -206,9 +232,9 @@ abstract class BaseController
...
@@ -206,9 +232,9 @@ abstract class BaseController
protected
final
function
exitMsg
(
$m
,
$c
=
0
,
$d
=
[],
$h
=
[])
protected
final
function
exitMsg
(
$m
,
$c
=
0
,
$d
=
[],
$h
=
[])
{
{
if
(
$c
==
400
)
{
if
(
$c
==
400
)
{
$re
=
Response
::
create
(
ROOT_PATH
.
'app
/v_msg.
tpl'
,
'view'
)
->
assign
([
'msg'
=>
$m
,
'site'
=>
vconfig
(
'site_title'
)])
->
header
(
$h
);
$re
=
Response
::
create
(
ROOT_PATH
.
'app
/ v_msg .
tpl'
,
'view'
)
->
assign
([
'msg'
=>
$m
,
'site'
=>
vconfig
(
'site_title'
)])
->
header
(
$h
);
}
else
if
(
$c
==
303
)
{
}
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
);
$re
=
Response
::
create
(
ROOT_PATH
.
'app
/ v_msg .
tpl'
,
'view'
)
->
assign
([
'msg'
=>
$m
,
'site'
=>
vconfig
(
'site_title'
),
'url'
=>
$d
[
'url'
]])
->
header
(
$h
);
}
else
{
}
else
{
$rs
=
json_encode
([
'code'
=>
$c
,
'msg'
=>
$m
,
'data'
=>
$d
,
'token'
=>
$this
->
token
]);
$rs
=
json_encode
([
'code'
=>
$c
,
'msg'
=>
$m
,
'data'
=>
$d
,
'token'
=>
$this
->
token
]);
$re
=
Response
::
create
(
$rs
)
->
header
(
$h
);
$re
=
Response
::
create
(
$rs
)
->
header
(
$h
);
...
@@ -265,7 +291,7 @@ abstract class BaseController
...
@@ -265,7 +291,7 @@ abstract class BaseController
*/
*/
protected
final
function
returnTpl
(
$msg
=
''
,
$tpl
=
''
,
$url
=
''
)
protected
final
function
returnTpl
(
$msg
=
''
,
$tpl
=
''
,
$url
=
''
)
{
{
$tpl
=
$tpl
?:
(
$this
->
request
->
isMobile
()
?
'err'
:
ROOT_PATH
.
'app
/v_msg.
tpl'
);
$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
);
return
$this
->
fetch
(
$tpl
);
}
}
...
@@ -296,12 +322,18 @@ abstract class BaseController
...
@@ -296,12 +322,18 @@ abstract class BaseController
'e'
=>
[
2
=>
'email'
,
3
=>
'邮箱地址格式错误'
,
4
=>
''
,
5
=>
''
],
'e'
=>
[
2
=>
'email'
,
3
=>
'邮箱地址格式错误'
,
4
=>
''
,
5
=>
''
],
'm'
=>
[
2
=>
'mobile'
,
3
=>
'手机号码格式错误'
,
4
=>
''
,
5
=>
''
],
'm'
=>
[
2
=>
'mobile'
,
3
=>
'手机号码格式错误'
,
4
=>
''
,
5
=>
''
],
'c'
=>
[
2
=>
'idcard'
,
3
=>
'身份证号格式错误'
,
4
=>
''
,
5
=>
''
],
'c'
=>
[
2
=>
'idcard'
,
3
=>
'身份证号格式错误'
,
4
=>
''
,
5
=>
''
],
'p'
=>
[
2
=>
'{6,16}'
,
3
=>
'密码'
,
4
=>
'5'
,
5
=>
''
],
'p'
=>
[
2
=>
'{
'u'
=>
[
2
=>
'{4,30}'
,
3
=>
'帐号'
,
4
=>
'1,2,3'
,
5
=>
'._@'
],
6,16}'
,
3
=>
'密码'
,
4
=>
'5'
,
5
=>
''
],
'n'
=>
[
2
=>
'{2,30}'
,
3
=>
'姓名'
,
4
=>
'0'
,
5
=>
' .'
],
'u'
=>
[
2
=>
'{
'i'
=>
[
2
=>
'{1,30}'
,
3
=>
'数串'
,
4
=>
'1'
,
5
=>
','
],
4,30}'
,
3
=>
'帐号'
,
4
=>
'1,2,3'
,
5
=>
' . _@'
],
'a'
=>
[
2
=>
'{3,20}'
,
3
=>
'插件名'
,
4
=>
'1,2'
,
5
=>
''
],
'n'
=>
[
2
=>
'{
'v'
=>
[
2
=>
'{2,20}'
,
3
=>
'配置名'
,
4
=>
'1,2,3'
,
5
=>
'_'
]
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
=
''
;
$default
=
''
;
...
@@ -356,6 +388,7 @@ abstract class BaseController
...
@@ -356,6 +388,7 @@ abstract class BaseController
$v
=
dround
(
$v
);
$v
=
dround
(
$v
);
break
;
break
;
case
'*'
:
case
'*'
:
if
(
$sub
[
2
]
==
'p'
)
$must
=
is_md5
(
$v
)
?
false
:
$must
;
if
(
$sub
[
2
]
==
'p'
)
$must
=
is_md5
(
$v
)
?
false
:
$must
;
$tip
=
$sub
[
3
];
$tip
=
$sub
[
3
];
if
(
isset
(
$preg
[
$sub
[
2
]]))
{
if
(
isset
(
$preg
[
$sub
[
2
]]))
{
...
@@ -422,10 +455,10 @@ abstract class BaseController
...
@@ -422,10 +455,10 @@ abstract class BaseController
PhpOffice
::
ossdownfile
(
$fileinfo
[
'fileurl'
],
$path
);
PhpOffice
::
ossdownfile
(
$fileinfo
[
'fileurl'
],
$path
);
register_shutdown_function
(
function
()
use
(
$path
)
{
register_shutdown_function
(
function
()
use
(
$path
)
{
// 处理完成后删除临时文件
// 处理完成后删除临时文件
unlink
(
VT_PUBLIC
.
'/'
.
$path
);
unlink
(
VT_PUBLIC
.
'/'
.
$path
);
});
});
return
download
(
'./'
.
$path
,
$fileinfo
[
'filename'
])
->
force
(
true
);
return
download
(
'./'
.
$path
,
$fileinfo
[
'filename'
])
->
force
(
true
);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
return
$this
->
exitMsg
(
$e
->
getMessage
());
return
$this
->
exitMsg
(
$e
->
getMessage
());
}
}
}
}
...
...
app/admin/controller/Login.php
View file @
c3b1b8e1
...
@@ -76,13 +76,16 @@ class Login extends BaseController
...
@@ -76,13 +76,16 @@ class Login extends BaseController
*/
*/
public
function
check
()
public
function
check
()
{
{
//多次尝试验证
//多次尝试验证
$ip
=
$this
->
request
->
ip
();
$ip
=
$this
->
request
->
ip
();
if
(
Lock
::
check
([
'key'
=>
'LOGIN_'
.
$ip
]))
return
$this
->
returnMsg
(
Lock
::
msg
());
if
(
Lock
::
check
([
'key'
=>
'LOGIN_'
.
$ip
]))
return
$this
->
returnMsg
(
Lock
::
msg
());
$d
=
$this
->
only
([
'username/
*/u/管理帐号'
,
'password/*
/p/登录密码'
,
'captcha'
]);
$d
=
$this
->
only
([
'username/
u/管理帐号'
,
'password
/p/登录密码'
,
'captcha'
]);
if
(
vconfig
(
'admin_captcha'
,
1
)
&&
!
captcha_check
(
$d
[
'captcha'
]))
return
$this
->
returnMsg
(
'验证码错误!'
);
if
(
vconfig
(
'admin_captcha'
,
1
)
&&
!
captcha_check
(
$d
[
'captcha'
]))
return
$this
->
returnMsg
(
'验证码错误!'
);
$username
=
$d
[
'username'
];
$username
=
$d
[
'username'
];
$password
=
$d
[
'password'
];
$password
=
$d
[
'password'
];
//查询用户数据
//查询用户数据
$rs
=
Manager
::
one
(
compact
(
'username'
));
$rs
=
Manager
::
one
(
compact
(
'username'
));
if
(
empty
(
$rs
)){
if
(
empty
(
$rs
)){
...
...
app/admin/controller/caiwu/Withdrawal.php
View file @
c3b1b8e1
...
@@ -12,6 +12,7 @@ namespace app\admin\controller\caiwu;
...
@@ -12,6 +12,7 @@ namespace app\admin\controller\caiwu;
use
app\admin\controller\AdminBase
;
use
app\admin\controller\AdminBase
;
use
app\event\PhpOffice
;
use
app\event\PhpOffice
;
use
app\model\project\Mail
;
use
think\App
;
use
think\App
;
use
think\facade\Db
;
use
think\facade\Db
;
use
app\model\project\UserWithdrawal
;
use
app\model\project\UserWithdrawal
;
...
@@ -159,6 +160,9 @@ class Withdrawal extends AdminBase
...
@@ -159,6 +160,9 @@ class Withdrawal extends AdminBase
Db
::
rollback
();
Db
::
rollback
();
throw
new
\Exception
(
'余额变动失败'
);
throw
new
\Exception
(
'余额变动失败'
);
}
}
Mail
::
createmail
(
$txinfo
[
'user_id'
],
"您申请提现【"
.
$txinfo
[
'sn'
]
.
"】打款失败 - "
.
$errordesc
);
}
else
{
Mail
::
createmail
(
$txinfo
[
'user_id'
],
"您申请提现:【"
.
$txinfo
[
'sn'
]
.
"】已通过打款请注意查收"
);
}
}
$updatedata
[
'dk_status'
]
=
$shstatus
;
$updatedata
[
'dk_status'
]
=
$shstatus
;
...
...
app/admin/controller/cert/CertOrder.php
View file @
c3b1b8e1
...
@@ -12,6 +12,7 @@ namespace app\admin\controller\cert;
...
@@ -12,6 +12,7 @@ namespace app\admin\controller\cert;
use
app\admin\controller\AdminBase
;
use
app\admin\controller\AdminBase
;
use
app\model\CertOrder
as
CertOrderModel
;
use
app\model\CertOrder
as
CertOrderModel
;
use
app\model\project\Mail
;
use
think\App
;
use
think\App
;
/**
/**
* 后台主控制器
* 后台主控制器
...
@@ -103,7 +104,12 @@ class CertOrder extends AdminBase
...
@@ -103,7 +104,12 @@ class CertOrder extends AdminBase
$result
=
$this
->
certorder
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
$result
=
$this
->
certorder
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
if
(
$result
)
{
if
(
$result
)
{
$cert_order_info
=
$this
->
certorder
->
where
(
'id'
,
$post
[
'id'
])
->
with
([
'certdata'
])
->
find
();
if
(
$post
[
'shstatus'
]
==
1
)
{
Mail
::
createmail
(
$cert_order_info
[
'user_id'
],
"您报名的证书【"
.
$cert_order_info
[
'certdata'
][
'title'
]
.
"】已审核通过"
);
}
else
{
Mail
::
createmail
(
$cert_order_info
[
'user_id'
],
"您报名的证书【"
.
$cert_order_info
[
'certdata'
][
'title'
]
.
"】审核不通过 - "
.
$errordesc
);
}
return
$this
->
returnMsg
(
"操作成功"
,
1
);
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
else
{
}
else
{
return
$this
->
returnMsg
(
"操作失败"
);
return
$this
->
returnMsg
(
"操作失败"
);
...
...
app/admin/controller/course/Course.php
View file @
c3b1b8e1
...
@@ -12,6 +12,7 @@ namespace app\admin\controller\course;
...
@@ -12,6 +12,7 @@ namespace app\admin\controller\course;
use
app\admin\controller\AdminBase
;
use
app\admin\controller\AdminBase
;
use
app\job\Jobtask
;
use
app\job\Jobtask
;
use
app\model\project\Mail
;
use
app\model\ShCourse
as
ShCourseModel
;
use
app\model\ShCourse
as
ShCourseModel
;
use
think\App
;
use
think\App
;
use
think\facade\Db
;
use
think\facade\Db
;
...
@@ -53,10 +54,10 @@ class Course extends AdminBase
...
@@ -53,10 +54,10 @@ class Course extends AdminBase
}
}
if
(
isset
(
$post
[
'status'
])
&&
$post
[
'status'
]
>
-
1
)
{
if
(
isset
(
$post
[
'status'
])
&&
$post
[
'status'
]
>
-
1
)
{
$map
[]
=
[
'status'
,
'='
,
$post
[
'status'
]];
$map
[]
=
[
'status'
,
'='
,
$post
[
'status'
]];
}
else
{
}
else
{
$map
[]
=
[
'status'
,
'>'
,
0
];
$map
[]
=
[
'status'
,
'>'
,
0
];
}
}
$list
=
$this
->
course
->
where
(
$map
)
->
append
([
'thumbpath'
,
'cate_name'
,
'teacher_name'
,
'status_text'
,
'tag_title'
,
'user_info'
,
'is_sell_text'
,
'is_hot_arr'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
$list
=
$this
->
course
->
where
(
$map
)
->
append
([
'thumbpath'
,
'cate_name'
,
'teacher_name'
,
'status_text'
,
'tag_title'
,
'user_info'
,
'is_sell_text'
,
'is_hot_arr'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
return
$this
->
returnMsg
(
$list
);
return
$this
->
returnMsg
(
$list
);
}
}
...
@@ -73,13 +74,13 @@ class Course extends AdminBase
...
@@ -73,13 +74,13 @@ class Course extends AdminBase
$post
=
input
();
$post
=
input
();
$result
=
$this
->
course
->
update
([
$post
[
'af'
]
=>
$post
[
'av'
]],
[[
'id'
,
'='
,
$post
[
'id'
]]]);
$result
=
$this
->
course
->
update
([
$post
[
'af'
]
=>
$post
[
'av'
]],
[[
'id'
,
'='
,
$post
[
'id'
]]]);
if
(
$post
[
'af'
]
==
'is_sell'
)
{
if
(
$post
[
'af'
]
==
'is_sell'
)
{
$course_id
=
$post
[
'id'
];
$course_id
=
$post
[
'id'
];
event
(
'Course'
,
[
'course_id'
=>
$course_id
,
'tasktype'
=>
'course'
,
'action'
=>
'shcourseupdate'
]);
event
(
'Course'
,
[
'course_id'
=>
$course_id
,
'tasktype'
=>
'course'
,
'action'
=>
'shcourseupdate'
]);
}
}
if
(
$result
)
{
if
(
$result
)
{
return
$this
->
returnMsg
(
'修改成功'
,
1
);
return
$this
->
returnMsg
(
'修改成功'
,
1
);
}
else
{
}
else
{
return
$this
->
returnMsg
(
'修改失败'
);
return
$this
->
returnMsg
(
'修改失败'
);
}
}
}
}
...
@@ -125,8 +126,12 @@ class Course extends AdminBase
...
@@ -125,8 +126,12 @@ class Course extends AdminBase
$result
=
$this
->
course
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
$result
=
$this
->
course
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
if
(
$result
)
{
if
(
$result
)
{
$courseinfo
=
Db
::
name
(
'course'
)
->
where
(
'id'
,
$post
[
'id'
])
->
field
(
'id,title,user_id'
)
->
find
();
if
(
$post
[
'shstatus'
]
==
1
)
{
if
(
$post
[
'shstatus'
]
==
1
)
{
event
(
'Course'
,
[
'course_id'
=>
$post
[
'id'
],
'tasktype'
=>
'course'
,
'action'
=>
'shstatus'
]);
event
(
'Course'
,
[
'course_id'
=>
$post
[
'id'
],
'tasktype'
=>
'course'
,
'action'
=>
'shstatus'
]);
Mail
::
createmail
(
$courseinfo
[
'user_id'
],
"您的课程【"
.
$courseinfo
[
'title'
]
.
"】已审核通过"
);
}
else
{
Mail
::
createmail
(
$courseinfo
[
'user_id'
],
"您的课程【"
.
$courseinfo
[
'title'
]
.
"】审核不通过 - "
.
$errordesc
);
}
}
return
$this
->
returnMsg
(
"操作成功"
,
1
);
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
else
{
}
else
{
...
@@ -149,7 +154,7 @@ class Course extends AdminBase
...
@@ -149,7 +154,7 @@ class Course extends AdminBase
{
{
$post
=
input
();
$post
=
input
();
if
(
$this
->
request
->
isAjax
())
{
if
(
$this
->
request
->
isAjax
())
{
$data
[
'is_hot'
]
=
isset
(
$post
[
'is_hot'
])
?
$post
[
'is_hot'
]
:
0
;
$data
[
'is_hot'
]
=
isset
(
$post
[
'is_hot'
])
?
$post
[
'is_hot'
]
:
0
;
$data
[
'is_tj'
]
=
isset
(
$post
[
'is_tj'
])
?
$post
[
'is_tj'
]
:
0
;
$data
[
'is_tj'
]
=
isset
(
$post
[
'is_tj'
])
?
$post
[
'is_tj'
]
:
0
;
...
...
app/admin/controller/project/Project.php
View file @
c3b1b8e1
...
@@ -12,6 +12,7 @@ namespace app\admin\controller\project;
...
@@ -12,6 +12,7 @@ namespace app\admin\controller\project;
use
app\admin\controller\AdminBase
;
use
app\admin\controller\AdminBase
;
use
app\model\Project
as
ProjectModel
;
use
app\model\Project
as
ProjectModel
;
use
app\model\project\Mail
;
use
app\model\project\User
;
use
app\model\project\User
;
use
app\model\project\UserMoneyLog
;
use
app\model\project\UserMoneyLog
;
use
think\App
;
use
think\App
;
...
@@ -145,6 +146,12 @@ class Project extends AdminBase
...
@@ -145,6 +146,12 @@ class Project extends AdminBase
$result
=
$this
->
project
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
$result
=
$this
->
project
->
where
(
'id'
,
$post
[
'id'
])
->
update
(
$updatedata
);
if
(
$result
)
{
if
(
$result
)
{
$projuect
=
$this
->
project
->
where
(
'id'
,
$post
[
'id'
])
->
field
(
'id,user_id,title'
)
->
find
();
if
(
$post
[
'shstatus'
]
==
1
)
{
Mail
::
createmail
(
$projuect
[
'user_id'
],
"您的项目【"
.
$projuect
[
'title'
]
.
"】已审核通过"
);
}
else
{
Mail
::
createmail
(
$projuect
[
'user_id'
],
"您的项目【"
.
$projuect
[
'title'
]
.
"】审核不通过 - "
.
$errordesc
);
}
return
$this
->
returnMsg
(
"操作成功"
,
1
);
return
$this
->
returnMsg
(
"操作成功"
,
1
);
}
else
{
}
else
{
return
$this
->
returnMsg
(
"操作失败"
);
return
$this
->
returnMsg
(
"操作失败"
);
...
...
app/common.php
View file @
c3b1b8e1
...
@@ -678,4 +678,19 @@ function http_get($url)
...
@@ -678,4 +678,19 @@ function http_get($url)
}
else
{
}
else
{
return
false
;
return
false
;
}
}
}
/**
* 将手机号中间4位替换为星号
* @param string $phone 手机号码
* @return string 处理后的手机号码
*/
function
maskPhoneNumber
(
$phone
)
{
// 验证手机号长度是否为11位
if
(
strlen
(
$phone
)
!==
11
)
{
return
$phone
;
// 如果不是11位,原样返回
}
// 使用正则表达式匹配并替换中间4位
return
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$phone
);
}
}
\ No newline at end of file
app/job/Jobtask.php
View file @
c3b1b8e1
...
@@ -7,6 +7,7 @@ use app\model\CourseClass;
...
@@ -7,6 +7,7 @@ use app\model\CourseClass;
use
app\model\CourseClassCategory
;
use
app\model\CourseClassCategory
;
use
app\model\CourseWork
;
use
app\model\CourseWork
;
use
app\model\ShCourse
;
use
app\model\ShCourse
;
use
app\model\project\Mail
;
use
app\model\ShCourseClass
;
use
app\model\ShCourseClass
;
use
app\model\ShCourseClassCategory
;
use
app\model\ShCourseClassCategory
;
use
app\model\ShCourseWork
;
use
app\model\ShCourseWork
;
...
...
app/model/CourseUserWork.php
View file @
c3b1b8e1
...
@@ -25,7 +25,14 @@ class CourseUserWork extends Model
...
@@ -25,7 +25,14 @@ class CourseUserWork extends Model
*/
*/
public
static
function
workList
(
$userId
,
$page
=
1
,
$pageSize
=
10
)
public
static
function
workList
(
$userId
,
$page
=
1
,
$pageSize
=
10
)
{
{
$status
=
request
()
->
post
(
'status'
);
$map
=
[];
if
(
$status
){
$map
[
'status'
]
=
$status
;
}
return
self
::
where
([
'user_id'
=>
$userId
,
'is_del'
=>
0
])
return
self
::
where
([
'user_id'
=>
$userId
,
'is_del'
=>
0
])
->
where
(
$map
)
->
with
([
'course'
,
'courseWork'
])
->
with
([
'course'
,
'courseWork'
])
->
field
(
'id,user_id,work_id,status,course_id,createtime'
)
->
field
(
'id,user_id,work_id,status,course_id,createtime'
)
->
paginate
([
->
paginate
([
...
...
app/model/project/Mail.php
View file @
c3b1b8e1
...
@@ -8,6 +8,7 @@ use think\model\concern\SoftDelete;
...
@@ -8,6 +8,7 @@ use think\model\concern\SoftDelete;
class
Mail
extends
Model
class
Mail
extends
Model
{
{
use
SoftDelete
;
use
SoftDelete
;
protected
$deleteTime
=
'deletetime'
;
protected
$deleteTime
=
'deletetime'
;
protected
$autoWriteTimestamp
=
true
;
protected
$autoWriteTimestamp
=
true
;
protected
$createTime
=
'createtime'
;
protected
$createTime
=
'createtime'
;
...
@@ -24,4 +25,12 @@ class Mail extends Model
...
@@ -24,4 +25,12 @@ class Mail extends Model
{
{
return
$data
[
'type'
]
==
1
?
'系统通知'
:
'后台发送'
;
return
$data
[
'type'
]
==
1
?
'系统通知'
:
'后台发送'
;
}
}
//添加消息
public
static
function
createmail
(
$user_id
,
$content
,
$title
=
''
,
$type
=
1
)
{
$data
=
[
'content'
=>
$content
,
'type'
=>
$type
,
'user_id'
=>
$user_id
,
'title'
=>
$title
];
return
self
::
create
(
$data
);
}
}
}
\ No newline at end of file
app/model/project/UserMoneyLog.php
View file @
c3b1b8e1
...
@@ -148,7 +148,7 @@ class UserMoneyLog extends Model
...
@@ -148,7 +148,7 @@ class UserMoneyLog extends Model
$query
=
$this
->
with
([
'getuserdata'
])
$query
=
$this
->
with
([
'getuserdata'
])
->
order
(
'createtime'
,
'desc'
);
->
order
(
'createtime'
,
'desc'
);
$query
->
where
(
'user_id'
,
'='
,
$params
[
'userId'
]);
if
(
isset
(
$params
[
'type'
])
&&
$params
[
'type'
]
!==
''
)
{
if
(
isset
(
$params
[
'type'
])
&&
$params
[
'type'
]
!==
''
)
{
$query
->
where
(
'type'
,
intval
(
$params
[
'type'
]));
$query
->
where
(
'type'
,
intval
(
$params
[
'type'
]));
}
}
...
@@ -166,7 +166,7 @@ class UserMoneyLog extends Model
...
@@ -166,7 +166,7 @@ class UserMoneyLog extends Model
$query
->
where
(
'money'
,
'<'
,
0
);
$query
->
where
(
'money'
,
'<'
,
0
);
}
}
}
}
$query
->
append
([
'type_text'
]);
//按日期范围筛选
//按日期范围筛选
if
(
!
empty
(
$params
[
'start_date'
]))
{
if
(
!
empty
(
$params
[
'start_date'
]))
{
$query
->
where
(
'createtime'
,
'>='
,
strtotime
(
$params
[
'start_date'
]));
$query
->
where
(
'createtime'
,
'>='
,
strtotime
(
$params
[
'start_date'
]));
...
...
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