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
320ae76b
Commit
320ae76b
authored
Jun 30, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目拒绝,验证码
parent
97f59ad5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
9 deletions
+58
-9
Index.php
app/api/controller/manage/Index.php
+4
-3
Project.php
app/api/controller/manage/Project.php
+24
-3
Project.php
app/api/controller/mine/Project.php
+2
-1
ProjectService.php
app/api/service/ProjectService.php
+17
-1
Project.php
app/model/Project.php
+11
-1
No files found.
app/api/controller/manage/Index.php
View file @
320ae76b
...
...
@@ -99,11 +99,12 @@ class Index extends BaseController
'status'
,
'tag_ids'
,
'sh_status_time'
,
'put_time'
,
'zhouqi'
,
// 当 status=3 时,计算截止日期(
sh_status
_time + zhouqi * 86400)
// 当 status=3 时,计算截止日期(
put
_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),
status=3 AND
put
_time IS NOT NULL AND zhouqi IS NOT NULL,
FROM_UNIXTIME(
put
_time + zhouqi * 86460),
NULL
) as deadline_date'
,
])
...
...
app/api/controller/manage/Project.php
View file @
320ae76b
...
...
@@ -170,7 +170,7 @@ class Project extends BaseController
//项目完成
public
function
confirmCompletion
(
Request
$request
)
{
$filed
=
[
'project_put_id'
];
$filed
=
[
'project_put_id'
,
'type'
];
// 验证参数
$vo
=
(
new
ProjectValidate
())
->
goCheck
(
$filed
);
...
...
@@ -178,7 +178,18 @@ class Project extends BaseController
return
$vo
;
}
$data
=
$request
->
only
(
$filed
);
$res
=
ProjectService
::
confirmCompletion
(
$data
[
'project_put_id'
]);
if
(
$data
[
'type'
]
==
1
)
{
$userId
=
$request
->
userId
;
$mobile
=
\app\model\project\User
::
where
(
'id'
,
$userId
)
->
value
(
'mobile'
);
$checkSmsCode
=
UtilService
::
checkSmsCode
(
$mobile
,
$data
[
'code'
]);
if
(
!
$checkSmsCode
)
{
return
$this
->
returnMsg
(
'验证码错误'
);
}
}
$res
=
ProjectService
::
confirmCompletion
(
$data
[
'project_put_id'
],
$data
[
'type'
]);
if
(
$res
[
'code'
]
==
1
)
{
return
$this
->
returnMsg
(
'success'
,
1
);
}
...
...
@@ -266,6 +277,11 @@ class Project extends BaseController
// 开启事务
Db
::
startTrans
();
if
(
$data
[
'put_end_time'
]
<
time
())
{
throw
new
\Exception
(
'项目截止日期应大于当前日期'
);
}
//检查用户信用余额是否足够
$user
=
UserModel
::
where
([
'id'
=>
$request
->
userId
,
'is_del'
=>
0
])
...
...
@@ -331,7 +347,12 @@ class Project extends BaseController
return
$this
->
returnMsg
(
'项目不存在'
);
}
if
(
$project
->
sh_status
==
2
)
{
// return $this->returnMsg('项目已审核不能编辑');
return
$this
->
returnMsg
(
'项目已审核不能编辑'
);
}
if
(
$data
[
'put_end_time'
]
<
$project
->
createtime
)
{
return
$this
->
returnMsg
(
'项目截止日期应大于当前日期'
);
}
$res
=
ProjectModel
::
where
([
'id'
=>
$id
,
'user_id'
=>
$request
->
userId
])
->
update
(
$data
);
...
...
app/api/controller/mine/Project.php
View file @
320ae76b
...
...
@@ -152,7 +152,8 @@ class Project extends BaseController
}
$data
=
$request
->
param
();
$projectPutData
=
ProjectPut
::
where
([
'id'
=>
$data
[
'project_put_id'
],
'user_id'
=>
$request
->
userId
,
'complete_status'
=>
0
])
$projectPutData
=
ProjectPut
::
where
([
'id'
=>
$data
[
'project_put_id'
],
'user_id'
=>
$request
->
userId
])
->
whereIn
(
'complete_status'
,[
0
,
2
])
->
lock
(
true
)
->
find
();
...
...
app/api/service/ProjectService.php
View file @
320ae76b
...
...
@@ -13,7 +13,7 @@ use think\facade\Log;
class
ProjectService
{
public
static
function
confirmCompletion
(
$id
)
public
static
function
confirmCompletion
(
$id
,
$type
=
1
)
{
// 定义查询条件
$where
=
[
'id'
=>
$id
,
'status'
=>
2
,
'complete_status'
=>
1
];
...
...
@@ -28,6 +28,22 @@ class ProjectService
throw
new
\Exception
(
'未找到符合条件的接单记录'
);
}
//验收失败
if
(
$type
==
2
)
{
$putUpdate
=
[
'complete_status'
=>
2
,
'complete_time'
=>
time
()];
$putResult
=
ProjectPut
::
where
(
$where
)
->
update
(
$putUpdate
);
if
(
!
$putResult
)
{
throw
new
\Exception
(
'更新接单状态失败'
);
}
// 提交事务
Db
::
commit
();
return
[
'code'
=>
1
,
'msg'
=>
'success'
];
}
// 2. 更新接单状态为已完成
$putUpdate
=
[
'complete_status'
=>
3
,
'complete_time'
=>
time
()];
$putResult
=
ProjectPut
::
where
(
$where
)
->
update
(
$putUpdate
);
...
...
app/model/Project.php
View file @
320ae76b
...
...
@@ -209,7 +209,17 @@ class Project extends Model
//项目详情
public
function
projectDetail
(
$id
,
$userId
)
{
$project
=
self
::
with
([
'getuserdata'
,
'projectcatedata'
,
'thumb'
])
->
find
(
$id
);
$project
=
self
::
with
([
'getuserdata'
,
'projectcatedata'
,
'thumb'
])
->
field
([
'*'
,
// 当 status=3 时,计算截止日期(put_time + zhouqi * 86400)
'IF(
status IN (2, 3, 4) AND put_time IS NOT NULL AND zhouqi IS NOT NULL,
FROM_UNIXTIME(put_time + zhouqi * 86400),
NULL
) as deadline_date'
,
])
->
find
(
$id
);
if
(
!
$project
)
{
return
[];
}
...
...
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