Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
clubAdmin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhoujun
clubAdmin
Commits
0fa9cdfd
Commit
0fa9cdfd
authored
Jul 31, 2021
by
zhoujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
6041d9b4
Pipeline
#2065
passed with stage
in 0 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
143 additions
and
3 deletions
+143
-3
app/Http/Controllers/Api/WarnController.php
app/Http/Controllers/Api/WarnController.php
+107
-0
app/Models/WarnConfigModel.php
app/Models/WarnConfigModel.php
+12
-0
app/Services/User/UserService.php
app/Services/User/UserService.php
+2
-1
app/Services/Warn/IWarnService.php
app/Services/Warn/IWarnService.php
+4
-0
app/Services/Warn/WarnService.php
app/Services/Warn/WarnService.php
+9
-1
app/Services/White/WhiteService.php
app/Services/White/WhiteService.php
+1
-1
routes/api.php
routes/api.php
+8
-0
No files found.
app/Http/Controllers/Api/WarnController.php
View file @
0fa9cdfd
...
...
@@ -97,6 +97,10 @@ class WarnController extends BaseController
public
function
getPeopleDel
(
Request
$request
)
{
$postData
=
$request
->
all
();
$validate
=
Validator
::
make
(
$postData
,
[
'id'
=>
'required|numeric'
]);
if
(
$validate
->
fails
())
return
$this
->
getErrorMsg
(
'1001'
,
config
(
'msg.common.1001'
));
try
{
$data
=
$this
->
warnService
->
getPeopleDel
(
$postData
);
return
$this
->
getSuccessMsg
(
$data
);
...
...
@@ -105,5 +109,108 @@ class WarnController extends BaseController
}
}
/**
* 设置预警人状态
* @return array
* @date 2021/07/31
* @author live
*/
public
function
getPeopleSetStatus
(
Request
$request
)
{
$postData
=
$request
->
all
();
$validate
=
Validator
::
make
(
$postData
,
[
'id'
=>
'required|numeric'
,
'status'
=>
'required|numeric'
]);
if
(
$validate
->
fails
())
return
$this
->
getErrorMsg
(
'1001'
,
config
(
'msg.common.1001'
));
try
{
$data
=
$this
->
warnService
->
getPeopleSetStatus
(
$postData
);
return
$this
->
getSuccessMsg
(
$data
);
}
catch
(
Exception
$e
)
{
return
$this
->
getErrorMsg
(
$e
->
getCode
(),
$e
->
getMessage
());
}
}
/**
* 新增预警配置
* @return array
* @date 2021/07/31
* @author live
*/
public
function
getConfigAdd
(
Request
$request
)
{
$postData
=
$request
->
all
();
$validate
=
Validator
::
make
(
$postData
,
[
'platform'
=>
'required|numeric'
,
'channel'
=>
'required|numeric'
,
'type'
=>
'required|numeric'
,
'oneWithdrawal'
=>
'required|numeric'
,
'dayWithdrawal'
=>
'required|numeric'
,
'userDayWithdrawal'
=>
'required|numeric'
]);
if
(
$validate
->
fails
())
return
$this
->
getErrorMsg
(
'1001'
,
config
(
'msg.common.1001'
));
try
{
$data
=
$this
->
warnService
->
getConfigAdd
(
$postData
);
return
$this
->
getSuccessMsg
(
$data
);
}
catch
(
Exception
$e
)
{
return
$this
->
getErrorMsg
(
$e
->
getCode
(),
$e
->
getMessage
());
}
}
/**
* 预警配置列表
* @return array
* @date 2021/07/31
* @author live
*/
public
function
getConfigList
()
{
}
/**
* 预警配置编辑
* @return array
* @date 2021/07/31
* @author live
*/
public
function
getConfigEdit
()
{
}
/**
* 删除预警配置
* @return array
* @date 2021/07/31
* @author live
*/
public
function
getConfigDel
()
{
}
/**
* 设置预警配置状态
* @return array
* @date 2021/07/31
* @author live
*/
public
function
getConfigSetStatus
()
{
}
/**
* 批量设置预警状态
* @return array
* @date 2021/07/31
* @author live
*/
public
function
getConfigSetAllStatus
()
{
}
}
\ No newline at end of file
app/Models/WarnConfigModel.php
0 → 100644
View file @
0fa9cdfd
<?php
namespace
App\Models
;
use
App\Models\BaseModel
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
WarnConfigModel
extends
BaseModel
{
use
SoftDeletes
;
protected
$connection
=
'mysql'
;
protected
$table
=
'club_warn_config'
;
}
app/Services/User/UserService.php
View file @
0fa9cdfd
...
...
@@ -55,7 +55,7 @@ class UserService implements IUserService{
$users
=
AdminModel
::
when
(
$key
!=
''
,
function
(
$query
)
use
(
$key
)
{
return
$query
->
where
(
'name'
,
'like'
,
$key
.
'%'
)
->
orWhere
(
'real_name'
,
'like'
,
$key
.
'%'
);
})
->
select
(
'id'
,
'name'
,
'real_name'
,
'phone'
,
'email'
,
'created_at'
)
->
orderBy
(
'id'
,
'DESC'
)
->
paginate
(
$pagePerNum
,
[
'*'
],
'currentPage'
,
$currentPage
);
})
->
select
(
'id'
,
'name'
,
'real_name'
,
'phone'
,
'email'
,
'
status'
,
'
created_at'
)
->
orderBy
(
'id'
,
'DESC'
)
->
paginate
(
$pagePerNum
,
[
'*'
],
'currentPage'
,
$currentPage
);
$array
[
'totalNum'
]
=
$users
->
total
();
$array
[
'totalPage'
]
=
$users
->
lastPage
();
foreach
(
$users
as
$user
){
...
...
@@ -64,6 +64,7 @@ class UserService implements IUserService{
$tem
[
'realName'
]
=
$user
->
real_name
;
$tem
[
'phone'
]
=
$user
->
phone
;
$tem
[
'email'
]
=
$user
->
email
;
$tem
[
'status'
]
=
$user
->
status
;
$tem
[
'created_at'
]
=
Carbon
::
parse
(
$user
->
created_at
)
->
format
(
'Y-m-d H:i:s'
);
$array
[
'data'
][]
=
$tem
;
}
...
...
app/Services/Warn/IWarnService.php
View file @
0fa9cdfd
...
...
@@ -10,4 +10,8 @@ interface IWarnService
public
function
getPeopleEdit
(
$postData
);
//预警人编辑
public
function
getPeopleDel
(
$postData
);
//预警人删除
public
function
getPeopleSetStatus
(
$postData
);
//设置预警人状态
public
function
getConfigAdd
(
$postData
);
//预警配置添加
}
\ No newline at end of file
app/Services/Warn/WarnService.php
View file @
0fa9cdfd
...
...
@@ -7,6 +7,7 @@ use Exception;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Str
;
use
App\Models\WarnPeopleModel
;
use
App\Models\WarnConfigModel
;
use
Illuminate\Support\Facades\Cache
;
class
WarnService
implements
IWarnService
...
...
@@ -147,9 +148,16 @@ class WarnService implements IWarnService
if
(
$list
->
status
==
$postData
[
'status'
])
throw
new
Exception
(
config
(
'msg.common.1009'
),
1009
);
$list
->
status
=
$postData
[
'status'
];
$list
->
addTime
=
$this
->
time
;
$list
->
op_user
=
$postData
[
'user'
]
??
''
;
$list
->
updated_at
=
$this
->
time
;
if
(
$list
->
save
())
return
true
;
throw
new
Exception
(
config
(
'msg.common.1003'
),
1003
);
}
public
function
getConfigAdd
(
$postData
)
{
}
}
\ No newline at end of file
app/Services/White/WhiteService.php
View file @
0fa9cdfd
...
...
@@ -106,7 +106,7 @@ class WhiteService implements IWhiteService
if
(
$list
->
status
==
$postData
[
'status'
])
throw
new
Exception
(
config
(
'msg.common.1009'
),
1009
);
$list
->
status
=
$postData
[
'status'
];
$list
->
add
T
ime
=
$this
->
time
;
$list
->
add
_t
ime
=
$this
->
time
;
if
(
$list
->
save
())
return
true
;
throw
new
Exception
(
config
(
'msg.common.1003'
),
1003
);
}
...
...
routes/api.php
View file @
0fa9cdfd
...
...
@@ -43,6 +43,14 @@ Route::group(['namespace' => 'Api','middleware' => ['user.login']], function ()
Route
::
post
(
'/people/list'
,
'WarnController@getPeopleList'
);
//预警人列表
Route
::
post
(
'/people/edit'
,
'WarnController@getPeopleEdit'
);
//编辑预警人
Route
::
post
(
'/people/del'
,
'WarnController@getPeopleDel'
);
//删除预警人
Route
::
post
(
'/people/set/status'
,
'WarnController@getPeopleSetStatus'
);
//设置预警人状态
Route
::
post
(
'/config/add'
,
'WarnController@getConfigAdd'
);
//新增预警配置
Route
::
post
(
'/config/list'
,
'WarnController@getConfigList'
);
//预警配置列表
Route
::
post
(
'/config/edit'
,
'WarnController@getConfigEdit'
);
//编辑预警配置
Route
::
post
(
'/config/del'
,
'WarnController@getConfigDel'
);
//删除预警配置
Route
::
post
(
'/config/set/status'
,
'WarnController@getConfigSetStatus'
);
//设置预警配置状态
Route
::
post
(
'/config/set/all/status'
,
'WarnController@getConfigSetAllStatus'
);
//批量设置预警配置状态
});
Route
::
group
([
'prefix'
=>
'account'
],
function
()
{
...
...
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