Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openApi
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
hj
openApi
Commits
ab545899
Commit
ab545899
authored
Apr 24, 2022
by
hangjun83
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、、增加查看日志
parent
8d5cc256
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
169 additions
and
1 deletion
+169
-1
server/app/Providers/RepositoryServiceProvider.php
server/app/Providers/RepositoryServiceProvider.php
+1
-0
server/app/Repositories/Contracts/ToolsTaskRepository.php
server/app/Repositories/Contracts/ToolsTaskRepository.php
+21
-0
server/app/Repositories/Criteria/BhSorderReundTaskLogCriteria.php
...pp/Repositories/Criteria/BhSorderReundTaskLogCriteria.php
+25
-0
server/app/Repositories/Eloquent/ToolsTaskRepositoryEloquent.php
...app/Repositories/Eloquent/ToolsTaskRepositoryEloquent.php
+85
-0
server/app/Repositories/Models/ToolsTask.php
server/app/Repositories/Models/ToolsTask.php
+36
-0
server/routes/api/tools.php
server/routes/api/tools.php
+1
-1
No files found.
server/app/Providers/RepositoryServiceProvider.php
View file @
ab545899
...
...
@@ -27,6 +27,7 @@ class RepositoryServiceProvider extends LumenRepositoryServiceProvider
'App\Repositories\Contracts\BhSordersRepository'
=>
'App\Repositories\Eloquent\BhSordersRepositoryEloquent'
,
'App\Repositories\Contracts\BhSoitemsRepository'
=>
'App\Repositories\Eloquent\BhSoitemsRepositoryEloquent'
,
'App\Repositories\Contracts\BhSorderRefundRepository'
=>
'App\Repositories\Eloquent\BhSorderRefundRepositoryEloquent'
,
'App\Repositories\Contracts\ToolsTaskRepository'
=>
'App\Repositories\Eloquent\ToolsTaskRepositoryEloquent'
,
];
/**
...
...
server/app/Repositories/Contracts/ToolsTaskRepository.php
0 → 100644
View file @
ab545899
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace
App\Repositories\Contracts
;
use
Prettus\Repository\Contracts\RepositoryInterface
;
/**
* Interface UserRepository.
*/
interface
ToolsTaskRepository
extends
RepositoryInterface
{
}
server/app/Repositories/Criteria/BhSorderReundTaskLogCriteria.php
0 → 100644
View file @
ab545899
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace
App\Repositories\Criteria
;
use
Illuminate\Database\Eloquent\Builder
;
use
App\Repositories\Criteria\Criteria
;
class
BhSorderRefundTaskLogCriteria
extends
Criteria
{
protected
function
condition
(
Builder
$query
)
:
void
{
if
(
$this
->
request
->
has
(
'type'
)){
$query
->
where
(
'type'
,
'='
,
$this
->
request
->
get
(
'type'
));
}
}
}
server/app/Repositories/Eloquent/ToolsTaskRepositoryEloquent.php
0 → 100644
View file @
ab545899
<?php
namespace
App\Repositories\Eloquent
;
use
App\Repositories\Contracts\ToolsTaskRepository
;
use
App\Repositories\Criteria\RequestCriteria
;
use
App\Repositories\Eloquent\BaseRepository
;
use
App\Repositories\Models\SysLog
;
use
App\Repositories\Models\ToolsTask
;
use
Prettus\Validator\Contracts\ValidatorInterface
;
/**
* Class UserRepositoryEloquent.
*/
class
ToolsTaskRepositoryEloquent
extends
BaseRepository
implements
ToolsTaskRepository
{
protected
$fieldSearchable
=
[
];
/**
* 定义validator的检索规则
* @var \string[][]
*/
public
$rules
=
[
ValidatorInterface
::
RULE_CREATE
=>
[
'menu_name'
=>
'required'
,
'title'
=>
'required'
,
'menu_path'
=>
'required'
,
'parent_id'
=>
'required'
,
'menu_type'
=>
'required'
,
'status'
=>
'required'
,
'sort'
=>
'required'
,
'is_show'
=>
'required'
,
'sys_default'
=>
'required'
],
ValidatorInterface
::
RULE_UPDATE
=>
[
'menu_name'
=>
'required'
,
'title'
=>
'required'
,
'menu_path'
=>
'required'
,
'parent_id'
=>
'required'
,
'menu_type'
=>
'required'
,
'status'
=>
'required'
,
'sort'
=>
'required'
,
'is_show'
=>
'required'
,
'sys_default'
=>
'required'
]
];
/**
* Specify Model class name.
*
* @return string
*/
public
function
model
()
{
return
ToolsTask
::
class
;
}
/**
* Boot up the repository, pushing criteria.
*
* @throws \Prettus\Repository\Exceptions\RepositoryException
*/
public
function
boot
()
{
$this
->
pushCriteria
(
app
(
RequestCriteria
::
class
));
}
public
function
getTaskLogsFromType
(
$type
,
$task_id
=
null
)
{
$taskLogsList
=
$this
->
join
(
'task_log'
,
'tools_task.id'
,
'task_log.task_id'
)
->
where
(
'tools_task.type'
,
$type
);
if
(
!
is_null
(
$task_id
)){
$taskLogsList
=
$taskLogsList
->
where
(
'tools_task.id'
,
$task_id
);
}
$taskLogsList
=
$taskLogsList
->
get
();
if
(
$taskLogsList
){
return
$taskLogsList
->
toArray
();
}
return
[];
}
}
server/app/Repositories/Models/ToolsTask.php
0 → 100644
View file @
ab545899
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace
App\Repositories\Models
;
class
ToolsTask
extends
Model
{
protected
$table
=
'tools_task'
;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected
$fillable
=
[
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected
$hidden
=
[
];
}
server/routes/api/tools.php
View file @
ab545899
...
...
@@ -24,7 +24,7 @@ $api->version('v1', function($api) {
$api
->
post
(
'/adminapi/tools/bh/getBhSordersDetail'
,
[
'permission'
=>
'tools.bh.order.search'
,
'uses'
=>
'BhOrdersController@getBhSordersDetail'
]);
$api
->
get
(
'/adminapi/tools/bh/getBhSorderRefundTask'
,
[
'permission'
=>
'tools.bh.order.search'
,
'uses'
=>
'BhOrdersController@getBhSorderRefundTaskToPage'
]);
$api
->
post
(
'/adminapi/tools/bh/execBhSorderRefundTask'
,
[
'permission'
=>
'tools.bh.order.search'
,
'uses'
=>
'BhOrdersController@execBhSorderRefundTask'
]);
$api
->
get
(
'/adminapi/tools/bh/getSorderRefundTaskLogs'
,
[
'permission'
=>
'tools.bh.order.search'
,
'uses'
=>
'BhOrdersController@getSorderRefundTaskLogs
'
]);
$api
->
post
(
'/adminapi/tools/bh/getSorderRefundTaskLogs'
,
[
'permission'
=>
'tools.bh.order.search'
,
'uses'
=>
'BhOrdersController@getSorderRefundTaskLogsToPage
'
]);
});
...
...
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