|
@@ -48,7 +48,8 @@ class Report extends BaseController
|
|
|
$where = [
|
|
|
["cp_project_report.delete_time", "=", 0],
|
|
|
["project_id", "=", $param["project_id"]],
|
|
|
- ["a.status","<",6]//公司待审批之前
|
|
|
+ ["a.status","<>",6],//公司待审批之前
|
|
|
+ ["a.status","<>",7]//公司待审批之前
|
|
|
];
|
|
|
|
|
|
$rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
|
|
@@ -379,8 +380,10 @@ class Report extends BaseController
|
|
|
->order('r.create_time desc')
|
|
|
->where(array('r.id' => $id))
|
|
|
->select()->toArray();
|
|
|
+
|
|
|
View::assign('file_array', $file_array);
|
|
|
View::assign('detail', $detail);
|
|
|
+
|
|
|
return view();
|
|
|
}
|
|
|
}
|
|
@@ -407,7 +410,7 @@ class Report extends BaseController
|
|
|
|
|
|
"project_name" => $details["project_name"],
|
|
|
"project_type" => "造价项目",
|
|
|
- "audit_name" => "删除报告申请",
|
|
|
+ "audit_name" => "财评删除报告审核",
|
|
|
"audit_type" => 2,
|
|
|
"else_id" => $id,
|
|
|
"sponsor" => get_login_admin("nickname"),
|
|
@@ -443,53 +446,48 @@ class Report extends BaseController
|
|
|
$param = get_params();
|
|
|
$handle = $this->Pushmessage->handleParam($param);
|
|
|
$param = $handle['param'];
|
|
|
- //return json($param);
|
|
|
- //dump($param);
|
|
|
|
|
|
- $type = isset($param['type']) ? $param['type'] : 0;
|
|
|
+ if (!isset($param["type"])) {//在项目列表通过
|
|
|
|
|
|
- if (!isset($param["type"])) {//在审核列表通过
|
|
|
$id = isset($param['id']) ? $param['id'] : 0;
|
|
|
- $this->model->where("id", $id)->update(["status" => 1]);//财评已通过
|
|
|
$detail = $this->model->where("id", $id)->find();//在Project_report里
|
|
|
+ $project_id = $this->model->where("id", $id)->value("project_id");//在Project_report里
|
|
|
|
|
|
try {
|
|
|
- Db::name("project_audit")->where([["else_id", "=", $id]])->update(["audit_status" => 2, "audit_time" => time()]);//更新审批通过
|
|
|
+ Db::name("project_audit")->where([["else_id", "=", $id]])->where("audit_name","财评报告审核")->update(["audit_status" => 2, "audit_time" => time()]);//更新审批通过
|
|
|
+ $this->model->where("id", $id)->update(["status" => 1]);//财评已通过
|
|
|
} catch (DbException $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
}
|
|
|
//给业主新增报告审核
|
|
|
- $where = [
|
|
|
- ["project_id", "=", $param["project_id"]],
|
|
|
- ["else_id", "=", $param["else_id"]],//项目报告id
|
|
|
- ["audit_type", "=", 2]
|
|
|
- ];
|
|
|
- $de = Db::name("cost_project")->where("id", $param["project_id"])->field("sent_review_head,sent_review_head_name")->find();
|
|
|
- if (isset($de)) {
|
|
|
- $auditData = $this->Auditmodel->where($where)->find()->toArray();
|
|
|
- $auditData["audit_name"] = "业主报告审核";
|
|
|
- $auditData["audit_status"] = 1;
|
|
|
- //$auditData["audit_type"] = 2;
|
|
|
- $auditData["approver"] = $de["sent_review_head"];
|
|
|
- $auditData["approver_name"] = $de["sent_review_head_name"];
|
|
|
- $auditData["create_time"] = time();
|
|
|
- $auditData["audit_time"] = null;
|
|
|
- $auditData["remark"] = null;
|
|
|
- $auditData["audit_remark"] = null;
|
|
|
- unset($auditData["id"]);
|
|
|
- try {
|
|
|
- $this->Auditmodel->save($auditData);
|
|
|
- } catch (\Exception $e) {
|
|
|
- return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ $where = [
|
|
|
+ ["project_id", "=", $project_id],
|
|
|
+ ["else_id", "=", $id],//项目报告id
|
|
|
+ ["audit_type", "=", 2]
|
|
|
+ ];
|
|
|
+ $de = Db::name("costProject")->where("id", $detail["project_id"])->field("sent_review_head,sent_review_head_name")->find();
|
|
|
+ if (isset($de)) {
|
|
|
+ $auditData = $this->Auditmodel->where($where)->find()->toArray();
|
|
|
+ $auditData["audit_name"] = "业主报告审核";
|
|
|
+ $auditData["audit_status"] = 1;
|
|
|
+ $auditData["audit_type"] = 2;
|
|
|
+ $auditData["approver"] = $de["sent_review_head"];
|
|
|
+ $auditData["approver_name"] = $de["sent_review_head_name"];
|
|
|
+ $auditData["create_time"] = time();
|
|
|
+ $auditData["audit_time"] = null;
|
|
|
+ $auditData["remark"] = null;
|
|
|
+ $auditData["audit_remark"] = null;
|
|
|
+ unset($auditData["id"]);
|
|
|
+ try {
|
|
|
+ $this->Auditmodel->save($auditData);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
//发给公司
|
|
|
$people = $this->model->where('id', $id)->value("maker_id");
|
|
|
- //发送信息给业主审核
|
|
|
- $proprietor =Db::name("costProject")->where("id",$detail["project_id"])->value("sent_review_head");
|
|
|
-
|
|
|
+ $proprietor =Db::name("costProject")->where("id", $project_id)->value("sent_review_head");
|
|
|
if (empty($handle['company'])) {
|
|
|
$handle['company'] = (array)$people;
|
|
|
} else {
|
|
@@ -501,11 +499,11 @@ class Report extends BaseController
|
|
|
$handle['proprietor'] = array_merge($handle['proprietor'], (array)$proprietor);
|
|
|
}
|
|
|
|
|
|
- $this->Pushmessage->pushMessage($detail["project_id"], $handle['financial'], $handle['company'], $handle['proprietor']);
|
|
|
- add_project_log('财政局审批通过', $param['project_id'], "报告审批通过");
|
|
|
+ $this->Pushmessage->pushMessage( $project_id, $handle['financial'], $handle['company'],$handle["proprietor"]);
|
|
|
+ add_project_log('财政局审批通过', $project_id, "报告审批通过");
|
|
|
|
|
|
- } else {//在项目报告里同意
|
|
|
- $param['audit_time'] = time();
|
|
|
+ } else {//在审核列表里同意
|
|
|
+ //$param['audit_time'] = time();
|
|
|
$this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]);
|
|
|
add_log('edit', $param['id'], $param);
|
|
|
$id = $param['id'];
|
|
@@ -574,27 +572,18 @@ class Report extends BaseController
|
|
|
$param = get_params();
|
|
|
$handle = $this->Pushmessage->handleParam($param);
|
|
|
$param = $handle['param'];
|
|
|
- $type = isset($param['type']) ? $param['type'] : 0;
|
|
|
+ //$type = isset($param['type']) ? $param['type'] : 0;
|
|
|
if (!isset($param["type"])) {//在审核列表通过
|
|
|
+
|
|
|
$id = isset($param['id']) ? $param['id'] : 0;
|
|
|
$this->model->where("id", $id)->update(["status" => 8]);
|
|
|
$detail = $this->model->where("id", $id)->find();
|
|
|
- $num = $this->model->where([
|
|
|
- ["project_id", "=", $detail["project_id"],
|
|
|
- ["type", ">", $detail["type"]]],
|
|
|
- ["status", ">", 1],
|
|
|
- ["status", "<>", 2],
|
|
|
- ["status", "<", 4]
|
|
|
- ])->count();
|
|
|
+
|
|
|
//type,0初审,1对数,2审定
|
|
|
$report_status = $detail["type"] + 1;
|
|
|
- if ($num == 0) {
|
|
|
- $data = ['report_time' => time(), "report_status" => $report_status];
|
|
|
- } else {
|
|
|
- $data = ['report_time' => time()];
|
|
|
- }
|
|
|
+ $data = ['report_time' => time(), "report_status" => $report_status];
|
|
|
try {
|
|
|
- Db::name("cost_project")->where("id", $detail["project_id"])->update($data);
|
|
|
+ Db::name("cost_project")->where("id", $detail["project_id"])->update($data);
|
|
|
} catch (DbException $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
}
|
|
@@ -611,8 +600,8 @@ class Report extends BaseController
|
|
|
} else {
|
|
|
$handle['company'] = array_merge($handle['company'], (array)$people);
|
|
|
}
|
|
|
-
|
|
|
- $this->Pushmessage->pushMessage($detail["project_id"], $handle['financial'], $handle['company']);
|
|
|
+ $this->Pushmessage->pushMessage( $detail["project_id"], $handle['financial'], $handle['company']);
|
|
|
+ //add_project_log('业主审批通过', $detail["project_id"], "报告审批通过");
|
|
|
|
|
|
|
|
|
} else {//在项目报告里通过
|
|
@@ -623,26 +612,16 @@ class Report extends BaseController
|
|
|
unset($param["id"]);
|
|
|
|
|
|
$detail = ProjectReport::where("id", $param["else_id"])->find();
|
|
|
- $num = $this->model->where([
|
|
|
- ["project_id", "=", $detail["project_id"],
|
|
|
- ["type", ">", $detail["type"]]],
|
|
|
- ["status", ">", 1],
|
|
|
- ["status", "<>", 2],
|
|
|
- ["status", "<", 4]
|
|
|
- ])->count();
|
|
|
+
|
|
|
//type,0初审,1对数,2审定
|
|
|
$report_status = $detail["type"] + 1;
|
|
|
- if ($num == 0) {
|
|
|
- $data = ['report_time' => time(), "report_status" => $report_status];
|
|
|
- } else {
|
|
|
- $data = ['report_time' => time()];
|
|
|
- }
|
|
|
+
|
|
|
+ $data = ['report_time' => time(), "report_status" => $report_status];
|
|
|
+
|
|
|
$type_status = $detail["status"];
|
|
|
if ($type_status == 1) {//财政局已通过
|
|
|
ProjectReport::where("id", $param["else_id"])->update(["status" => 8, "update_time" => time()]);
|
|
|
$this->CostModel->where('id', $param['project_id'])->strict(false)->update($data);
|
|
|
- } elseif ($type_status == 4) {//财政局删除已通过
|
|
|
- ProjectReport::where("id", $param["else_id"])->update(["status" => 10, "update_time" => time()]);
|
|
|
}
|
|
|
|
|
|
$people = $this->Auditmodel->where('id', $id)->value("sponsor_id");
|
|
@@ -654,14 +633,14 @@ class Report extends BaseController
|
|
|
}
|
|
|
$this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']);
|
|
|
|
|
|
- add_project_log('业主审批通过', $param['project_id'], "报告审批通过");
|
|
|
+ add_project_log('审批通过', $param['project_id'], "报告审批通过");
|
|
|
}
|
|
|
|
|
|
return to_assign(0, "操作成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 财评
|
|
|
+ * 财评(已修改)
|
|
|
* 不同意-报告
|
|
|
*/
|
|
|
public function un_report()
|
|
@@ -689,6 +668,7 @@ class Report extends BaseController
|
|
|
}
|
|
|
$project_id = $this->model->where("id", $id)->value("project_id");
|
|
|
$this->Pushmessage->pushMessage($project_id, $handle['financial'], $handle['company']);
|
|
|
+ add_project_log('审批未通过', $project_id, "报告审批未通过");
|
|
|
|
|
|
} else {//项目报告列表拒绝
|
|
|
$param = get_params();
|
|
@@ -716,6 +696,7 @@ class Report extends BaseController
|
|
|
$handle['company'] = array_merge($handle['company'], (array)$people);
|
|
|
}
|
|
|
$this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']);
|
|
|
+ add_project_log('审批未通过', $param['project_id'], "报告审批未通过");
|
|
|
|
|
|
|
|
|
} catch (\Exception $e) {
|
|
@@ -736,13 +717,13 @@ class Report extends BaseController
|
|
|
$param = get_params();
|
|
|
$handle = $this->Pushmessage->handleParam($param);
|
|
|
$param = $handle['param'];
|
|
|
- if (!isset($param["type"])) {//项目报告里审核
|
|
|
+ if (!isset($param["type"])) {//项目报告列表
|
|
|
$id = isset($param['id']) ? $param['id'] : 0;
|
|
|
$this->model->where("id", $id)->update(["status" => 9]);
|
|
|
|
|
|
try {
|
|
|
//一开始将所有的都改成了拒绝,改成了只改变业主的审批状态
|
|
|
- Db::name("project_audit")->where([["else_id", "=", $id]])->where("audit_name","业主报告审核")->update(["audit_status" => 3, "audit_remark" => $param["audit_remark"]]);
|
|
|
+ Db::name("project_audit")->where([["else_id", "=", $id]])->where("audit_name","业主报告审核")->update(["audit_status" => 3, "audit_remark" => $param["audit_remark"],"audit_time" => time()]);
|
|
|
} catch (DbException $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
}
|
|
@@ -755,8 +736,9 @@ class Report extends BaseController
|
|
|
}
|
|
|
$project_id = $this->model->where("id", $id)->value("project_id");
|
|
|
$this->Pushmessage->pushMessage($project_id, [], $handle['company']);
|
|
|
+ //add_project_log('审批未通过', $project_id, "报告审批未通过");
|
|
|
|
|
|
- } else {//审核列表里审核
|
|
|
+ } else {//项目报告列表
|
|
|
$param = get_params();
|
|
|
$handle = $this->Pushmessage->handleParam($param);
|
|
|
$param = $handle['param'];
|
|
@@ -782,6 +764,7 @@ class Report extends BaseController
|
|
|
$handle['company'] = array_merge($handle['company'], (array)$people);
|
|
|
}
|
|
|
$this->Pushmessage->pushMessage($param['project_id'], [], $handle['company']);
|
|
|
+ //add_project_log('审批未通过', $param['project_id'], "报告审批未通过");
|
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
@@ -793,7 +776,7 @@ class Report extends BaseController
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 财评
|
|
|
+ * 财评(已修改)
|
|
|
* 同意-删除
|
|
|
*/
|
|
|
public function agree_delete()
|
|
@@ -807,48 +790,60 @@ class Report extends BaseController
|
|
|
$this->model->where("id", $id)->update(["status" => 4]);
|
|
|
|
|
|
$detail = $this->model->where("id", $id)->find();
|
|
|
- //type,0初审,1对数,2审定
|
|
|
- $num = $this->model->where([
|
|
|
- ["project_id", "=", $detail["project_id"],
|
|
|
- ["type", ">=", $detail["type"]]],
|
|
|
- ["status", ">", 1],
|
|
|
- ["status", "<>", 2],
|
|
|
- ["status", "<", 4]
|
|
|
- ])->count();
|
|
|
- //type,0初审,1对数,2审定
|
|
|
- $report_status = $detail["type"];
|
|
|
- if ($num == 0) {
|
|
|
- $data = ['report_time' => time(), "report_status" => $report_status];
|
|
|
- } else {
|
|
|
- $data = ['report_time' => time()];
|
|
|
- }
|
|
|
- try {
|
|
|
- Db::name("cost_project")->where("id", $detail["project_id"])->update($data);
|
|
|
- } catch (DbException $e) {
|
|
|
- return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
- }
|
|
|
+ $project_id = $this->model->where("id", $id)->value("project_id");//在Project_report里
|
|
|
|
|
|
- try {
|
|
|
- Db::name("project_audit")->where([["else_id", "=", $id]])->update(["audit_status" => 2]);
|
|
|
- } catch (DbException $e) {
|
|
|
- return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
+
|
|
|
+ Db::name("project_audit")->where([["else_id", "=", $id]])->where("audit_name","财评删除报告审核")->update(["audit_status" => 2]);
|
|
|
+
|
|
|
+ //给业主新增报告删除审核
|
|
|
+ $where = [
|
|
|
+ ["project_id", "=",$project_id],
|
|
|
+ ["else_id", "=", $id],//项目报告id
|
|
|
+ ["audit_type", "=", 2],
|
|
|
+ ["audit_name","=","财评删除报告审核"]
|
|
|
+ ];
|
|
|
+ $de = Db::name("cost_project")->where("id", $project_id)->field("sent_review_head,sent_review_head_name")->find();
|
|
|
+ if (isset($de)) {
|
|
|
+ $auditData = $this->Auditmodel->where($where)->find()->toArray();//
|
|
|
+ $auditData["audit_name"] = "业主删除报告审核";
|
|
|
+ $auditData["audit_status"] = 1;
|
|
|
+ $auditData["approver"] = $de["sent_review_head"];
|
|
|
+ $auditData["approver_name"] = $de["sent_review_head_name"];
|
|
|
+ $auditData["create_time"] = time();
|
|
|
+ $auditData["audit_time"] = null;
|
|
|
+ //$auditData["remark"] = null;
|
|
|
+ $auditData["audit_remark"] = null;
|
|
|
+ unset($auditData["id"]);
|
|
|
+ try {
|
|
|
+ $this->Auditmodel->save($auditData);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$people = $this->model->where('id', $id)->value("maker_id");
|
|
|
+ $proprietor =Db::name("costProject")->where("id",$project_id)->value("sent_review_head");
|
|
|
+
|
|
|
+ if (empty($handle['proprietor'])) {
|
|
|
+ $handle['proprietor'] = (array)$proprietor;
|
|
|
+ } else {
|
|
|
+ $handle['proprietor'] = array_merge($handle['proprietor'], (array)$proprietor);
|
|
|
+ }
|
|
|
if (empty($handle['company'])) {
|
|
|
$handle['company'] = (array)$people;
|
|
|
} else {
|
|
|
$handle['company'] = array_merge($handle['company'], (array)$people);
|
|
|
}
|
|
|
- $project_id = $this->model->where("id", $id)->value("project_id");
|
|
|
- $this->Pushmessage->pushMessage($project_id, $handle['financial'], $handle['company']);
|
|
|
+ $this->Pushmessage->pushMessage($project_id, $handle['financial'], $handle['company'],$handle["proprietor"]);
|
|
|
+ add_project_log('审批通过', $project_id, "报告删除审批通过");
|
|
|
+
|
|
|
} else {//审核项目里
|
|
|
- $param['audit_time'] = time();
|
|
|
+
|
|
|
$this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]);
|
|
|
|
|
|
$id = $param['id'];
|
|
|
unset($param["id"]);
|
|
|
-
|
|
|
+ //$param{else_id是项目报告id
|
|
|
$detail = ProjectReport::where("id", $param["else_id"])->find();
|
|
|
|
|
|
$type_status = $detail["status"];
|
|
@@ -857,21 +852,54 @@ class Report extends BaseController
|
|
|
}
|
|
|
|
|
|
$people = $this->Auditmodel->where('id', $id)->value("sponsor_id");
|
|
|
+ $proprietor =Db::name("costProject")->where("id",$detail["project_id"])->value("sent_review_head");
|
|
|
+ if (empty($handle['proprietor'])) {
|
|
|
+ $handle['proprietor'] = (array)$proprietor;
|
|
|
+ } else {
|
|
|
+ $handle['proprietor'] = array_merge($handle['proprietor'], (array)$proprietor);
|
|
|
+ }
|
|
|
if (empty($handle['company'])) {
|
|
|
$handle['company'] = (array)$people;
|
|
|
} else {
|
|
|
$handle['company'] = array_merge($handle['company'], (array)$people);
|
|
|
}
|
|
|
|
|
|
- $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']);
|
|
|
+ $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company'],$handle["proprietor"]);
|
|
|
add_project_log('审批通过', $param['project_id'], "报告删除审批通过");
|
|
|
+
|
|
|
+ //给业主新增报告删除审核
|
|
|
+ $where = [
|
|
|
+ ["project_id", "=", $param["project_id"]],
|
|
|
+ ["else_id", "=", $param["else_id"]],//项目报告id
|
|
|
+ ["audit_type", "=", 2],
|
|
|
+ ["audit_name","=","财评删除报告审核"]
|
|
|
+ ];
|
|
|
+ $de = Db::name("cost_project")->where("id", $param["project_id"])->field("sent_review_head,sent_review_head_name")->find();
|
|
|
+ if (isset($de)) {
|
|
|
+ $auditData = $this->Auditmodel->where($where)->find()->toArray();
|
|
|
+ $auditData["audit_name"] = "业主删除报告审核";
|
|
|
+ $auditData["audit_status"] = 1;
|
|
|
+
|
|
|
+ $auditData["approver"] = $de["sent_review_head"];
|
|
|
+ $auditData["approver_name"] = $de["sent_review_head_name"];
|
|
|
+ $auditData["create_time"] = time();
|
|
|
+ $auditData["audit_time"] = null;
|
|
|
+ //$auditData["remark"] = null;
|
|
|
+ $auditData["audit_remark"] = null;
|
|
|
+ unset($auditData["id"]);
|
|
|
+ try {
|
|
|
+ $this->Auditmodel->save($auditData);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return to_assign(0, "操作成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 业主 (未修改)
|
|
|
+ * 业主 (已修改)
|
|
|
* 同意-删除
|
|
|
*/
|
|
|
public function proprietor_agree_delete()
|
|
@@ -881,32 +909,18 @@ class Report extends BaseController
|
|
|
$param = $handle['param'];
|
|
|
if (!isset($param["type"])) {
|
|
|
$id = isset($param['id']) ? $param['id'] : 0;
|
|
|
- $this->model->where("id", $id)->update(["status" => 4]);
|
|
|
+ $this->model->where("id", $id)->update(["status" => 10]);
|
|
|
|
|
|
$detail = $this->model->where("id", $id)->find();
|
|
|
- //type,0初审,1对数,2审定
|
|
|
- $num = $this->model->where([
|
|
|
- ["project_id", "=", $detail["project_id"],
|
|
|
- ["type", ">=", $detail["type"]]],
|
|
|
- ["status", ">", 1],
|
|
|
- ["status", "<>", 2],
|
|
|
- ["status", "<", 4]
|
|
|
- ])->count();
|
|
|
- //type,0初审,1对数,2审定
|
|
|
- $report_status = $detail["type"];
|
|
|
- if ($num == 0) {
|
|
|
- $data = ['report_time' => time(), "report_status" => $report_status];
|
|
|
- } else {
|
|
|
- $data = ['report_time' => time()];
|
|
|
- }
|
|
|
+
|
|
|
try {
|
|
|
- Db::name("cost_project")->where("id", $detail["project_id"])->update($data);
|
|
|
+ Db::name("cost_project")->where("id", $detail["project_id"])->update(['report_time' => time()]);
|
|
|
} catch (DbException $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- Db::name("project_audit")->where([["else_id", "=", $id]])->update(["audit_status" => 2]);
|
|
|
+ Db::name("project_audit")->where([["else_id", "=", $id]])->where("audit_name","业主删除报告审核")->update(["audit_status" => 2]);
|
|
|
} catch (DbException $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
}
|
|
@@ -919,37 +933,21 @@ class Report extends BaseController
|
|
|
}
|
|
|
$project_id = $this->model->where("id", $id)->value("project_id");
|
|
|
$this->Pushmessage->pushMessage($project_id, $handle['financial'], $handle['company']);
|
|
|
- } else {
|
|
|
- $param['audit_time'] = time();
|
|
|
+ add_project_log('业主审批通过', $project_id, "报告删除审批通过");
|
|
|
+ } else {//在项目报告里
|
|
|
+
|
|
|
$this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]);
|
|
|
|
|
|
$id = $param['id'];
|
|
|
unset($param["id"]);
|
|
|
|
|
|
-
|
|
|
$detail = ProjectReport::where("id", $param["else_id"])->find();
|
|
|
- $num = $this->model->where([
|
|
|
- ["project_id", "=", $detail["project_id"],
|
|
|
- ["type", ">=", $detail["type"]]],
|
|
|
- ["status", ">", 1],
|
|
|
- ["status", "<>", 2],
|
|
|
- ["status", "<", 4]
|
|
|
- ])->count();
|
|
|
- //type,0初审,1对数,2审定
|
|
|
- $report_status = $detail["type"];
|
|
|
- if ($num == 0) {
|
|
|
- $data = ['report_time' => time(), "report_status" => $report_status];
|
|
|
- } else {
|
|
|
- $data = ['report_time' => time()];
|
|
|
- }
|
|
|
- $type_status = $detail["status"];
|
|
|
- if ($type_status == 0) {
|
|
|
- ProjectReport::where("id", $param["else_id"])->update(["status" => 1, "update_time" => time()]);
|
|
|
- $this->CostModel->where('id', $param['project_id'])->strict(false)->update($data);
|
|
|
- } elseif ($type_status == 3) {
|
|
|
- ProjectReport::where("id", $param["else_id"])->update(["status" => 4, "update_time" => time()]);
|
|
|
- Db::name("cost_project")->where("id", $detail["project_id"])->update(["report_status" => $report_status]);
|
|
|
|
|
|
+
|
|
|
+ $type_status = $detail["status"];
|
|
|
+ if ($type_status == 4) {
|
|
|
+ ProjectReport::where("id", $param["else_id"])->update(["status" => 10, "update_time" => time()]);
|
|
|
+ Db::name("cost_project")->where("id", $detail["project_id"])->update(['report_time' => time()]);
|
|
|
}
|
|
|
|
|
|
$people = $this->Auditmodel->where('id', $id)->value("sponsor_id");
|
|
@@ -960,14 +958,14 @@ class Report extends BaseController
|
|
|
}
|
|
|
|
|
|
$this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']);
|
|
|
- add_project_log('审批通过', $param['project_id'], "报告删除审批通过");
|
|
|
+ add_project_log('业主审批通过', $param['project_id'], "报告删除审批通过");
|
|
|
}
|
|
|
|
|
|
return to_assign(0, "操作成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 财评
|
|
|
+ * 财评(已修改)
|
|
|
* 不同意-删除
|
|
|
*/
|
|
|
public function un_delete()
|
|
@@ -980,7 +978,7 @@ class Report extends BaseController
|
|
|
$this->model->where("id", $id)->update(["status" => 5]);
|
|
|
|
|
|
try {
|
|
|
- Db::name("project_audit")->where([["else_id", "=", $id]])->update(["audit_status" => 3, "audit_remark" => $param["audit_remark"]]);
|
|
|
+ Db::name("project_audit")->where([["else_id", "=", $id]])->update(["audit_status" => 3, "audit_remark" => $param["audit_remark"], "audit_time" => time()]);
|
|
|
} catch (DbException $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
}
|
|
@@ -993,24 +991,22 @@ class Report extends BaseController
|
|
|
}
|
|
|
$project_id = $this->model->where("id", $id)->value("project_id");
|
|
|
$this->Pushmessage->pushMessage($project_id, $handle['financial'], $handle['company']);
|
|
|
+ add_project_log('财政局审批未通过', $project_id, "报告删除审批未通过");
|
|
|
} else {
|
|
|
$param = get_params();
|
|
|
$handle = $this->Pushmessage->handleParam($param);
|
|
|
$param = $handle['param'];
|
|
|
try {
|
|
|
- $param['audit_time'] = time();
|
|
|
+
|
|
|
$this->Auditmodel->where('id', $param["id"])->strict(false)->field(true)->update(["audit_status" => 3, "audit_remark" => $param["audit_remark"], "audit_time" => time()]);
|
|
|
|
|
|
$id = $param['id'];
|
|
|
unset($param["id"]);
|
|
|
|
|
|
- $type_status = Db::name("contact")->where("id", $param["else_id"])->value("status");
|
|
|
- if ($type_status == 0) {
|
|
|
- //新建
|
|
|
- Db::name("contact")->where("id", $param["else_id"])->update(["status" => 2, "update_time" => time()]);
|
|
|
- } elseif ($type_status == 3) {
|
|
|
+ $type_status = Db::name("project_report")->where("id", $param["else_id"])->value("status");
|
|
|
+ if ($type_status == 3) {
|
|
|
//删除
|
|
|
- Db::name("contact")->where("id", $param["else_id"])->update(["status" => 5, "update_time" => time()]);
|
|
|
+ Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 5, "update_time" => time()]);
|
|
|
}
|
|
|
|
|
|
$people = $this->Auditmodel->where('id', $id)->value("sponsor_id");
|
|
@@ -1021,6 +1017,7 @@ class Report extends BaseController
|
|
|
}
|
|
|
|
|
|
$this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']);
|
|
|
+ add_project_log('财政局审批未通过', $param['project_id'], "报告删除审批未通过");
|
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
@@ -1032,7 +1029,7 @@ class Report extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 业主 (未修改)
|
|
|
+ * 业主 (已修改)
|
|
|
* 不同意-删除
|
|
|
*/
|
|
|
public function proprietor_un_delete()
|
|
@@ -1042,10 +1039,10 @@ class Report extends BaseController
|
|
|
$param = $handle['param'];
|
|
|
if (!isset($param["type"])) {
|
|
|
$id = isset($param['id']) ? $param['id'] : 0;
|
|
|
- $this->model->where("id", $id)->update(["status" => 5]);
|
|
|
+ $this->model->where("id", $id)->update(["status" => 11]);
|
|
|
|
|
|
try {
|
|
|
- Db::name("project_audit")->where([["else_id", "=", $id]])->update(["audit_status" => 3, "audit_remark" => $param["audit_remark"]]);
|
|
|
+ Db::name("project_audit")->where([["else_id", "=", $id]])->where("audit_name","业主删除报告审核")->update(["audit_status" => 3, "audit_remark" => $param["audit_remark"], "audit_time" => time()]);
|
|
|
} catch (DbException $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|
|
|
}
|
|
@@ -1058,24 +1055,22 @@ class Report extends BaseController
|
|
|
}
|
|
|
$project_id = $this->model->where("id", $id)->value("project_id");
|
|
|
$this->Pushmessage->pushMessage($project_id, $handle['financial'], $handle['company']);
|
|
|
+ add_project_log('业主审批未通过', $project_id, "报告删除审批未通过");
|
|
|
} else {
|
|
|
$param = get_params();
|
|
|
$handle = $this->Pushmessage->handleParam($param);
|
|
|
$param = $handle['param'];
|
|
|
try {
|
|
|
- $param['audit_time'] = time();
|
|
|
+
|
|
|
$this->Auditmodel->where('id', $param["id"])->strict(false)->field(true)->update(["audit_status" => 3, "audit_remark" => $param["audit_remark"], "audit_time" => time()]);
|
|
|
|
|
|
$id = $param['id'];
|
|
|
unset($param["id"]);
|
|
|
|
|
|
- $type_status = Db::name("contact")->where("id", $param["else_id"])->value("status");
|
|
|
- if ($type_status == 0) {
|
|
|
- //新建
|
|
|
- Db::name("contact")->where("id", $param["else_id"])->update(["status" => 2, "update_time" => time()]);
|
|
|
- } elseif ($type_status == 3) {
|
|
|
+ $type_status = Db::name("project_report")->where("id", $param["else_id"])->value("status");
|
|
|
+ if ($type_status == 4) {
|
|
|
//删除
|
|
|
- Db::name("contact")->where("id", $param["else_id"])->update(["status" => 5, "update_time" => time()]);
|
|
|
+ Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 11, "update_time" => time()]);
|
|
|
}
|
|
|
|
|
|
$people = $this->Auditmodel->where('id', $id)->value("sponsor_id");
|
|
@@ -1086,6 +1081,7 @@ class Report extends BaseController
|
|
|
}
|
|
|
|
|
|
$this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']);
|
|
|
+ add_project_log('业主审批未通过', $param['project_id'], "报告删除审批未通过");
|
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
return to_assign(1, '操作失败,原因:' . $e->getMessage());
|