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
c9e6154e
Commit
c9e6154e
authored
Jun 30, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c3b1b8e1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
5 deletions
+37
-5
Index.php
app/api/controller/manage/Index.php
+15
-1
Project.php
app/api/controller/manage/Project.php
+13
-4
ProjectPut.php
app/api/controller/project/ProjectPut.php
+3
-0
Project.php
app/model/Project.php
+5
-0
ProjectPut.php
app/model/ProjectPut.php
+1
-0
No files found.
app/api/controller/manage/Index.php
View file @
c9e6154e
...
...
@@ -92,7 +92,21 @@ class Index extends BaseController
// 1. 查询项目列表
$projects
=
\app\model\Project
::
where
(
'user_id'
,
$userId
)
->
where
(
'status'
,
'in'
,
[
0
,
1
,
3
])
->
field
([
'id'
,
'title'
,
'status'
,
'tag_ids'
])
->
withCount
([
'put'
])
->
field
([
'id'
,
'title'
,
'status'
,
'tag_ids'
,
'sh_status_time'
,
'zhouqi'
,
// 当 status=3 时,计算截止日期(sh_status_time + zhouqi * 86400)
'IF(
status=3 AND sh_status_time IS NOT NULL AND zhouqi IS NOT NULL,
FROM_UNIXTIME(sh_status_time + zhouqi * 86460),
NULL
) as deadline_date'
,
])
->
paginate
([
'page'
=>
$page
,
// 当前页数
'list_rows'
=>
$pageSize
,
// 每页数量
...
...
app/api/controller/manage/Project.php
View file @
c9e6154e
...
...
@@ -127,13 +127,22 @@ class Project extends BaseController
$pageSize
=
$request
->
param
(
'pageSize/d'
,
10
);
$where
=
[
'project_id'
=>
$data
[
'project_id'
]];
//如果当前项目已确定接单人 只查询接单人的申请记录
$put_user
=
ProjectPut
::
where
(
'project_id'
,
$request
->
param
(
'project_id'
))
->
where
(
'status'
,
2
)
->
value
(
'user_id'
);
if
(
$put_user
)
{
$where
[
'user_id'
]
=
$put_user
;
}
$query
=
ProjectPut
::
with
([
'getuserdata'
])
->
where
(
$where
);
$order_status
=
ProjectModel
::
where
(
'id'
,
$request
->
param
(
'project_id'
))
->
value
(
'status'
);
if
(
$order_status
>=
2
)
{
$query
->
where
([
'status'
=>
2
]);
}
if
(
!
empty
(
$data
[
'search_str'
]))
{
...
...
app/api/controller/project/ProjectPut.php
View file @
c9e6154e
...
...
@@ -47,6 +47,9 @@ class ProjectPut extends BaseController
(
new
ProjectPutModel
())
->
putProject
(
$data
,
$request
->
userId
);
//将项目状态改为3 待验收
ProjectModel
::
where
([
'id'
=>
$data
[
'project_id'
]])
->
update
([
'status'
=>
3
]);
return
$this
->
returnMsg
(
'success'
,
1
);
}
...
...
app/model/Project.php
View file @
c9e6154e
...
...
@@ -252,5 +252,10 @@ class Project extends Model
->
field
(
'fileid,filename,filesize,fileurl,filetype,storage'
);
}
public
function
put
()
{
return
$this
->
hasMany
(
ProjectPut
::
class
,
'project_id'
,
'id'
);
}
}
\ No newline at end of file
app/model/ProjectPut.php
View file @
c9e6154e
...
...
@@ -24,6 +24,7 @@ class ProjectPut extends Model
protected
$type
=
[
'complete_time'
=>
'timestamp:Y-m-d H:i:s'
,
'complete_post_time'
=>
'timestamp:Y-m-d H:i:s'
,
'put_time'
=>
'timestamp:Y-m-d H:i:s'
,
];
public
function
getCreatetimeAttr
(
$value
)
...
...
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