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
5c5ad100
Commit
5c5ad100
authored
Jun 24, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账变列表,提现列表,待处理项目列表修改
parent
719baadd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
172 additions
and
45 deletions
+172
-45
Index.php
app/api/controller/manage/Index.php
+14
-45
User.php
app/api/controller/manage/User.php
+41
-0
UserMoneyLog.php
app/model/project/UserMoneyLog.php
+57
-0
UserWithdrawal.php
app/model/project/UserWithdrawal.php
+60
-0
No files found.
app/api/controller/manage/Index.php
View file @
5c5ad100
...
@@ -5,6 +5,7 @@ namespace app\api\controller\manage;
...
@@ -5,6 +5,7 @@ namespace app\api\controller\manage;
use
app\api\middleware\Auth
;
use
app\api\middleware\Auth
;
use
app\api\service\UtilService
;
use
app\api\service\UtilService
;
use
app\BaseController
;
use
app\BaseController
;
use
app\model\ProjectTag
;
use
think\facade\Db
;
use
think\facade\Db
;
use
think\Request
;
use
think\Request
;
...
@@ -68,7 +69,7 @@ class Index extends BaseController
...
@@ -68,7 +69,7 @@ class Index extends BaseController
'projectPendingCount'
=>
(
int
)
$projectStats
[
'project_pending_count'
]
??
0
,
'projectPendingCount'
=>
(
int
)
$projectStats
[
'project_pending_count'
]
??
0
,
'projectProgressCount'
=>
(
int
)
$projectStats
[
'project_progress_count'
]
??
0
,
'projectProgressCount'
=>
(
int
)
$projectStats
[
'project_progress_count'
]
??
0
,
'projectFinishedCount'
=>
(
int
)
$projectStats
[
'project_finished_count'
]
??
0
,
'projectFinishedCount'
=>
(
int
)
$projectStats
[
'project_finished_count'
]
??
0
,
'projectPendingList'
=>
$this
->
getProjectPendingList
(
$userId
)
//
'projectPendingList'=>$this->getProjectPendingList($userId)
];
];
Db
::
commit
();
Db
::
commit
();
...
@@ -81,56 +82,24 @@ class Index extends BaseController
...
@@ -81,56 +82,24 @@ class Index extends BaseController
}
}
}
}
public
function
getProjectPendingList
(
$userId
)
public
function
getProjectPendingList
(
Request
$request
)
{
{
$userId
=
$request
->
userId
;
$page
=
$request
->
param
(
'page/d'
,
1
);
$pageSize
=
$request
->
param
(
'pageSize/d'
,
10
);
// 1. 查询项目列表
// 1. 查询项目列表
$projects
=
\app\model\Project
::
where
(
'user_id'
,
$userId
)
$projects
=
\app\model\Project
::
where
(
'user_id'
,
$userId
)
->
where
(
'status'
,
'in'
,
[
0
,
1
,
3
])
->
where
(
'status'
,
'in'
,
[
0
,
1
,
3
])
->
field
([
'id'
,
'title'
,
'status'
,
'tag_ids'
])
->
field
([
'id'
,
'title'
,
'status'
,
'tag_ids'
])
->
select
();
->
paginate
([
'page'
=>
$page
,
// 当前页数
// 2. 收集所有标签ID(去重)
'list_rows'
=>
$pageSize
,
// 每页数量
$allTagIds
=
[];
]);
foreach
(
$projects
as
$project
)
{
if
(
$project
->
tag_ids
)
{
$ids
=
explode
(
','
,
$project
->
tag_ids
);
$allTagIds
=
array_merge
(
$allTagIds
,
$ids
);
}
}
$allTagIds
=
array_unique
(
$allTagIds
);
// 3. 批量查询所有需要的标签
$tagsMap
=
[];
if
(
!
empty
(
$allTagIds
))
{
$tags
=
\app\model\ProjectTag
::
where
(
'is_del'
,
0
)
->
where
(
'id'
,
'in'
,
$allTagIds
)
->
column
(
'title'
,
'id'
);
$tagsMap
=
$tags
?:
[];
}
// 4. 组装结果
$list
=
UtilService
::
listWithTags
(
$projects
,
ProjectTag
::
class
,
'tag_ids'
);
$result
=
[];
foreach
(
$projects
as
$project
)
{
$tagIds
=
$project
->
tag_ids
?
explode
(
','
,
$project
->
tag_ids
)
:
[];
$tags
=
[];
foreach
(
$tagIds
as
$tagId
)
{
if
(
isset
(
$tagsMap
[
$tagId
]))
{
$tags
[]
=
[
'id'
=>
$tagId
,
'title'
=>
$tagsMap
[
$tagId
]
];
}
}
$result
[]
=
[
'id'
=>
$project
->
id
,
'title'
=>
$project
->
title
,
'status'
=>
$project
->
status
,
'tags'
=>
$tags
];
}
return
$
result
;
return
$
this
->
returnMsg
(
'success'
,
1
,
$list
)
;
}
}
}
}
\ No newline at end of file
app/api/controller/manage/User.php
View file @
5c5ad100
...
@@ -8,6 +8,8 @@ use app\api\validate\BusinessValidate;
...
@@ -8,6 +8,8 @@ use app\api\validate\BusinessValidate;
use
app\BaseController
;
use
app\BaseController
;
use
app\model\Payment
;
use
app\model\Payment
;
use
app\model\project\School
;
use
app\model\project\School
;
use
app\model\project\UserMoneyLog
;
use
app\model\project\UserWithdrawal
;
use
app\Request
;
use
app\Request
;
use
think\facade\Db
;
use
think\facade\Db
;
use
app\model\project\User
as
UserModel
;
use
app\model\project\User
as
UserModel
;
...
@@ -136,4 +138,43 @@ class User extends BaseController
...
@@ -136,4 +138,43 @@ class User extends BaseController
return
$this
->
returnMsg
(
'success'
,
1
,
$list
);
return
$this
->
returnMsg
(
'success'
,
1
,
$list
);
}
}
/**提现列表
* @param Request $request
* @return \app\html
*/
public
function
withdrawList
(
Request
$request
)
{
$field
=
[
'page'
,
'pageSize'
,
'sn'
,
'sh_status'
,
'dk_status'
,
'start_time'
,
'end_time'
];
$params
=
$request
->
only
(
$field
);
$params
[
'userId'
]
=
$request
->
userId
;
$userWithDrawModel
=
new
UserWithdrawal
();
$list
=
$userWithDrawModel
->
getWithdrawalList
(
$params
);
return
$this
->
returnMsg
(
'success'
,
1
,
$list
);
}
/**账变列表
* @param Request $request
* @return \app\html
*/
public
function
moneyLog
(
Request
$request
)
{
$field
=
[
'page'
,
'pageSize'
,
'type'
,
'money_type'
,
'sz_type'
,
'start_time'
,
'end_time'
];
$params
=
$request
->
only
(
$field
);
$params
[
'userId'
]
=
$request
->
userId
;
$userMoneyLog
=
new
UserMoneyLog
();
$list
=
$userMoneyLog
->
moneyLogList
(
$params
);
return
$this
->
returnMsg
(
'success'
,
1
,
$list
);
}
}
}
\ No newline at end of file
app/model/project/UserMoneyLog.php
View file @
5c5ad100
...
@@ -125,4 +125,61 @@ class UserMoneyLog extends Model
...
@@ -125,4 +125,61 @@ class UserMoneyLog extends Model
return
$text
;
return
$text
;
}
}
/**
* 获取用户资金报表
* @param array $params 查询参数
* - page: 当前页码(默认1)
* - pageSize: 每页数量(默认10)
* - type: 0项目结算,1提现,2后台手动增加,3发布项目
* - money_type: 金额类型,0用户余额,1信用分
* - sz_type: 收支类型 1收入 2支出
* - start_time: 开始时间
* - end_time: 结束时间
* @return array
*/
public
function
moneyLogList
(
$params
=
[])
{
$page
=
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
;
$pageSize
=
isset
(
$params
[
'pageSize'
])
?
intval
(
$params
[
'pageSize'
])
:
10
;
$query
=
$this
->
with
([
'getuserdata'
])
->
order
(
'createtime'
,
'desc'
);
if
(
isset
(
$params
[
'type'
])
&&
$params
[
'type'
]
!==
''
)
{
$query
->
where
(
'type'
,
intval
(
$params
[
'type'
]));
}
if
(
isset
(
$params
[
'money_type'
])
&&
$params
[
'money_type'
]
!==
''
)
{
$query
->
where
(
'type'
,
intval
(
$params
[
'type'
]));
}
if
(
isset
(
$params
[
'sz_type'
])
&&
$params
[
'sz_type'
]
!==
''
)
{
if
(
$params
[
'sz_type'
]
==
1
)
{
$query
->
where
(
'money'
,
'>'
,
0
);
}
else
{
$query
->
where
(
'money'
,
'<'
,
0
);
}
}
//按日期范围筛选
if
(
!
empty
(
$params
[
'start_date'
]))
{
$query
->
where
(
'createtime'
,
'>='
,
strtotime
(
$params
[
'start_date'
]));
}
if
(
!
empty
(
$params
[
'end_date'
]))
{
$query
->
where
(
'createtime'
,
'<='
,
strtotime
(
$params
[
'end_date'
]));
}
$list
=
$query
->
paginate
([
'page'
=>
$page
,
'list_rows'
=>
$pageSize
,
]);
$data
=
$list
->
toArray
();
return
$data
;
}
}
}
\ No newline at end of file
app/model/project/UserWithdrawal.php
View file @
5c5ad100
...
@@ -16,6 +16,8 @@ class UserWithdrawal extends Model
...
@@ -16,6 +16,8 @@ class UserWithdrawal extends Model
protected
$autoWriteTimestamp
=
true
;
protected
$autoWriteTimestamp
=
true
;
protected
$createTime
=
'createtime'
;
protected
$createTime
=
'createtime'
;
protected
$updateTime
=
false
;
protected
$updateTime
=
false
;
protected
$dk_time
=
'dk_time'
;
use
SoftDelete
;
use
SoftDelete
;
...
@@ -150,4 +152,62 @@ class UserWithdrawal extends Model
...
@@ -150,4 +152,62 @@ class UserWithdrawal extends Model
return
$statustxt
;
return
$statustxt
;
}
}
/**
* 获取提现列表
* @param array $params 查询参数
* - page: 当前页码(默认1)
* - pageSize: 每页数量(默认10)
* - sn: 提现单号(模糊搜索)
* - sh_status: 审核状态(0待审核 1失败 2成功)
* - dk_status: 打款状态(0未打款 1打款中 2失败 3已打款)
* - start_time: 开始时间
* - end_time: 结束时间
* @return array
*/
public
function
getWithdrawalList
(
$params
=
[])
{
$page
=
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
;
$pageSize
=
isset
(
$params
[
'pageSize'
])
?
intval
(
$params
[
'pageSize'
])
:
10
;
$query
=
$this
->
with
([
'getuserdata'
])
->
append
([
'sh_status_text'
,
'dk_status_text'
])
->
order
(
'createtime'
,
'desc'
);
// 1. 按提现单号模糊搜索
if
(
!
empty
(
$params
[
'sn'
]))
{
$query
->
where
(
'sn'
,
'like'
,
'%'
.
trim
(
$params
[
'sn'
])
.
'%'
);
}
// 2. 按审核状态筛选
if
(
isset
(
$params
[
'sh_status'
])
&&
$params
[
'sh_status'
]
!==
''
)
{
$query
->
where
(
'sh_status'
,
intval
(
$params
[
'sh_status'
]));
}
// 3. 按打款状态筛选
if
(
isset
(
$params
[
'dk_status'
])
&&
$params
[
'dk_status'
]
!==
''
)
{
$query
->
where
(
'dk_status'
,
intval
(
$params
[
'dk_status'
]));
}
// 4. 按日期范围筛选
if
(
!
empty
(
$params
[
'start_date'
]))
{
$query
->
where
(
'createtime'
,
'>='
,
strtotime
(
$params
[
'start_date'
]));
}
if
(
!
empty
(
$params
[
'end_date'
]))
{
$query
->
where
(
'createtime'
,
'<='
,
strtotime
(
$params
[
'end_date'
]));
}
$list
=
$query
->
paginate
([
'page'
=>
$page
,
'list_rows'
=>
$pageSize
,
]);
$data
=
$list
->
toArray
();
return
$data
;
}
public
function
getDkTimeAttr
(
$value
)
{
return
$value
?
date
(
'Y-m-d H:i:s'
,
$value
)
:
null
;
}
}
}
\ No newline at end of file
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