Commit 50c19f31 authored by wangzhengwen's avatar wangzhengwen

项目验收

parent 4648b9e3
......@@ -128,15 +128,15 @@ class Project extends BaseController
$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;
}
//如果当前项目已确定接单人 只查询接单人的申请记录 单独新开接口 (getProjectPut)
// $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'])
......@@ -167,16 +167,51 @@ class Project extends BaseController
}
//项目验收列表
public function getProjectPut(Request $request)
{
$filed = ['project_id'];
$vo = (new ProjectValidate())->goCheck($filed);
if ($vo !== true) {
return $vo;
}
$data = $request->param();
$where = ['project_id' => $data['project_id'],'status'=>2];
$query = ProjectPut::with(['getuserdata'])
->where($where);
$list = $query->select();
$list->each(function ($item) {
$item->done_num = ProjectPut::where(['user_id' => $item->user_id, 'complete_status' => 3])->count();
return $item;
});
return $this->returnMsg('success', 1, $list);
}
//项目完成
public function confirmCompletion(Request $request)
{
$filed = ['project_put_id','type','reason'];
$filed = ['project_put_id','type'];
// 验证参数
$vo = (new ProjectValidate())->goCheck($filed);
if ($vo !== true) {
return $vo;
}
$filed[] = 'reason';
$filed[] = 'code';
$data = $request->only($filed);
if ($data['type']==1)
{
......@@ -189,7 +224,7 @@ class Project extends BaseController
}
}
$res = ProjectService::confirmCompletion($data['project_put_id'],$data['type'],$data['reason']);
$res = ProjectService::confirmCompletion($data['project_put_id'],$data['type'],$data['reason'] ?? null);
if ($res['code'] == 1) {
return $this->returnMsg('success', 1);
}
......
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