Commit 4648b9e3 authored by wangzhengwen's avatar wangzhengwen

拒绝理由

parent 320ae76b
...@@ -170,7 +170,7 @@ class Project extends BaseController ...@@ -170,7 +170,7 @@ class Project extends BaseController
//项目完成 //项目完成
public function confirmCompletion(Request $request) public function confirmCompletion(Request $request)
{ {
$filed = ['project_put_id','type']; $filed = ['project_put_id','type','reason'];
// 验证参数 // 验证参数
$vo = (new ProjectValidate())->goCheck($filed); $vo = (new ProjectValidate())->goCheck($filed);
...@@ -189,7 +189,7 @@ class Project extends BaseController ...@@ -189,7 +189,7 @@ class Project extends BaseController
} }
} }
$res = ProjectService::confirmCompletion($data['project_put_id'],$data['type']); $res = ProjectService::confirmCompletion($data['project_put_id'],$data['type'],$data['reason']);
if ($res['code'] == 1) { if ($res['code'] == 1) {
return $this->returnMsg('success', 1); return $this->returnMsg('success', 1);
} }
...@@ -350,7 +350,7 @@ class Project extends BaseController ...@@ -350,7 +350,7 @@ class Project extends BaseController
return $this->returnMsg('项目已审核不能编辑'); return $this->returnMsg('项目已审核不能编辑');
} }
if ($data['put_end_time']<$project->createtime) if ($data['put_end_time']<strtotime($project->createtime))
{ {
return $this->returnMsg('项目截止日期应大于当前日期'); return $this->returnMsg('项目截止日期应大于当前日期');
} }
......
...@@ -13,7 +13,7 @@ use think\facade\Log; ...@@ -13,7 +13,7 @@ use think\facade\Log;
class ProjectService class ProjectService
{ {
public static function confirmCompletion($id,$type=1) public static function confirmCompletion($id,$type=1,$reason='')
{ {
// 定义查询条件 // 定义查询条件
$where = ['id' => $id, 'status' => 2, 'complete_status' => 1]; $where = ['id' => $id, 'status' => 2, 'complete_status' => 1];
...@@ -31,7 +31,7 @@ class ProjectService ...@@ -31,7 +31,7 @@ class ProjectService
//验收失败 //验收失败
if ($type==2) if ($type==2)
{ {
$putUpdate = ['complete_status' => 2, 'complete_time' => time()]; $putUpdate = ['complete_status' => 2, 'complete_time' => time(),'reason'=>$reason];
$putResult = ProjectPut::where($where)->update($putUpdate); $putResult = ProjectPut::where($where)->update($putUpdate);
if (!$putResult) { if (!$putResult) {
......
...@@ -34,6 +34,7 @@ class ProjectValidate extends BaseValidate ...@@ -34,6 +34,7 @@ class ProjectValidate extends BaseValidate
'user_id'=>'require|number', 'user_id'=>'require|number',
'pid'=>'require|number', 'pid'=>'require|number',
'put_end_time'=>'require', 'put_end_time'=>'require',
'reason'=>'require',
]; ];
protected $message = [ protected $message = [
'title.require' => '项目名不能为空', 'title.require' => '项目名不能为空',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment