Field = new Field($this->app); $this->model = new CostProjectModel(); $this->Auditmodel = new AuditModel(); $this->ProjectMsg = new ProjectMsg(); $this->uid = get_login_admin('id'); $this->Officialaccount = new Officialaccount(); $this->Pushmessage = new Pushmessage(); } public function datalist() { if (request()->isAjax()) { $param = get_params(); $where = [ ["cp_project_audit.approver", "=", $this->uid], ["cp_project_audit.audit_type", "<", 4] ]; if(!empty($param["keywords"])){ $where[] = ["c.review_unit_name|c.engineering_type|a.project_name","like","%".$param["keywords"]."%"]; } $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; $order = empty($param['order']) ? 'id desc' : $param['order']; $list2 = $this->Auditmodel->alias('a')->join("cost_project c", "a.project_id=c.id", 'left') ->field("a.*,c.project_status,c.sent_review_amount,c.engineering_type,c.review_unit_name")->where($where)->order($order) ->paginate($rows, false, ['query' => $param]) ->each(function ($item) { if ($item->audit_type == 2) { $a = Db::name("project_report")->where("id", $item->else_id)->field("title,status")->find(); $item->else_name = $a["title"]; $item->else_status = $a["status"]; } elseif ($item->audit_type == 3) { $a = Db::name("contact")->where("id", $item->else_id)->field("title,status")->find(); $item->else_name = $a["title"]; $item->else_status = $a["status"]; } }); return table_assign(0, '', $list2); } else { return view(); } } /** * * 公司审核列表 */ public function datalist_company() { if (request()->isAjax()) { $param = get_params(); //1项目,2报告,3联系函,4公司一级审核,5公司二级审核,6公司三级审核 $where = [ ["a.approver", "=", $this->uid], ["a.audit_type", ">", 3], ["a.audit_status", "<", 5] ]; if(!empty($param["keywords"])){ $where[] = ["c.entrust_unit_name|c.engineering_type|a.project_name","like","%".$param["keywords"]."%"]; } $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; $order = empty($param['order']) ? 'id desc' : $param['order']; $list2 = $this->Auditmodel->alias('a')->join("cost_project c", "a.project_id=c.id", 'left') ->field("a.*,c.project_status,c.sent_review_amount,c.engineering_type,c.review_unit_name")->where($where)->order($order) ->paginate($rows, false, ['query' => $param]) ->each(function ($item) { switch ($item["audit_type"]) { case 4: case 5: case 6: case 14: case 15: $item->else_name = Db::name("project_report")->where("id", $item["else_id"])->value("title"); break; case 9: case 8: case 7: $item->else_name = Db::name("contact")->where("id", $item["else_id"])->value("title"); break; case 10: $item->else_name = "请款一级审核"; break; case 11: $item->else_name = "请款二级审核"; break; case 12: $item->else_name = "请款三级审核"; break; } }); return table_assign(0, '', $list2); } else { return view(); } } public function datalist_proprietor() { if (request()->isAjax()) { $param = get_params(); $where = [ ["cp_project_audit.approver", "=", $this->uid], ["cp_project_audit.audit_type", "<", 4] ]; if(!empty($param["keywords"])){ $where[] = ["c.review_unit_name|c.engineering_type|a.project_name","like","%".$param["keywords"]."%"]; } $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; $order = empty($param['order']) ? 'id desc' : $param['order']; $list2 = $this->Auditmodel->alias('a')->join("cost_project c", "a.project_id=c.id", 'left') ->field("a.*,c.project_status,c.sent_review_amount,c.engineering_type,c.review_unit_name")->where($where)->order($order) ->paginate($rows, false, ['query' => $param]) ->each(function ($item) { if ($item->audit_type == 2) { $a = Db::name("project_report")->where("id", $item->else_id)->field("title,status")->find(); $item->else_name = $a["title"]; $item->else_status = $a["status"]; } elseif ($item->audit_type == 3) { $a = Db::name("contact")->where("id", $item->else_id)->field("title,status")->find(); $item->else_name = $a["title"]; $item->else_status = $a["status"]; } }); return table_assign(0, '', $list2); } else { return view(); } } /** * 首页待审核列表 */ public function list() { if (request()->isAjax()) { $param = get_params(); $where = [ ["cp_project_audit.approver", "=", $this->uid], ["cp_project_audit.audit_type", "<", 4], ["cp_project_audit.audit_status", "=", 1], ]; if(!empty($param["keywords"])){ $where[] = ["c.review_unit_name|c.engineering_type|a.project_name","like","%".$param["keywords"]."%"]; } $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; $order = empty($param['order']) ? 'id desc' : $param['order']; $list2 = $this->Auditmodel->alias('a')->join("cost_project c", "a.project_id=c.id", 'left') ->field("a.*,c.project_status,c.sent_review_amount,c.engineering_type,c.review_unit_name")->where($where)->order($order) ->paginate($rows, false, ['query' => $param]) ->each(function ($item) { if ($item->audit_type == 2) { $a = Db::name("project_report")->where("id", $item->else_id)->field("title,status")->find(); $item->else_name = $a["title"]; $item->else_status = $a["status"]; } elseif ($item->audit_type == 3) { $a = Db::name("contact")->where("id", $item->else_id)->field("title,status")->find(); $item->else_name = $a["title"]; $item->else_status = $a["status"]; } }); return table_assign(0, '', $list2); } else { return view(); } } /** * 项目日志 */ public function project_log($project_id) { // $project_id = 24; $login_admin = get_login_admin(); $where = array(); if ($login_admin['user_type'] == 2) { $where = [ ['project_status', '>=', 3], ['unit_name', '=', $login_admin['unit_name']], ]; } else { if ($login_admin['permission'] != 1) { $where = [ ['unit_name', '=', $login_admin['unit_name']], ]; } } // dump($where); $project_log = Db::name('ProjectLog')->where($where)->where('project_id', $project_id)->order('create_time', 'desc')->select()->toArray(); foreach ($project_log as $key => $value) { $project_log[$key]['create_time'] = date("Y-m-d H:i:s", $value['create_time']); } // dump($project_log); // View::assign('project_log', $project_log); // return View(); return $project_log; } /** * 查看信息 */ public function read() { $param = get_params(); $id = isset($param['id']) ? $param['id'] : 0; $detail = $this->model->getCostProjectById($id); $comment = Db::name("project_comment")->where("project_id", $id)->order('create_time', 'desc')->select(); $file_array = Db::name('ProjectFile') ->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.nickname as admin_name') ->alias('mf') ->join('File f', 'mf.file_id = f.id', 'LEFT') ->join('Admin a', 'mf.admin_id = a.id', 'LEFT') ->order('mf.create_time desc') ->where(array('mf.topic_id' => $id, 'mf.module' => 'project')) ->select()->toArray(); $report = Db::name("project_report")->where([["project_id", "=", $id], ["r.status", "=", 1]])->alias("r")->join("admin a", "r.maker_id = a.id")->field("r.*,a.nickname")->select(); // halt($comment); $project_log = self::project_log($id); View::assign('project_log', $project_log); // halt($project_log); // 根据用户id 查询其能显示的字段 $field = $this->Field->get_field_rules_new(get_login_admin('id')); //剩余时间 $c = $detail['project_end_time'] - time(); if ($c > 0) { $advent_time = floor($c / 86400) . "天"; } else { $c = -$c; $advent_time = floor($c / 86400) . "天"; } if (!empty($detail)) { View::assign('advent_time', $advent_time); View::assign('project_id', $id); View::assign('comment', $comment); View::assign('field', $field); View::assign('detail', $detail); View::assign('file_array', $file_array); View::assign('report', $report); View::assign('project_five', self::getProjectFive()); return view(); } else { throw new \think\exception\HttpException(404, '找不到页面'); } } /** * 公司查看信息 */ public function read_company() { $param = get_params(); if (request()->isAjax()) { $a = time(); $id = isset($param["project_id"]) ? $param["project_id"] : $a; if ($id == $a) { $datas = array(); $datas["data"] = null; return table_assign(0, "无项目", $datas); } $project = Db::name("appropriation_project")->where("uid", $id)->select(); $datas["data"] = $project; $datas["total"] = count($project); return table_assign(0, "", $datas); } else { if ($param["type"] > 9) { $a = time(); $id = isset($param["project_id"]) ? $param["project_id"] : $a; $detail = Db::name("appropriation")->where("id", $id)->find(); $file_array = Db::name('ProjectFile') ->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.nickname as admin_name') ->alias('mf') ->join('File f', 'mf.file_id = f.id', 'LEFT') ->join('Admin a', 'mf.admin_id = a.id', 'LEFT') ->order('mf.create_time desc') ->where(array('mf.topic_id' => $id, 'mf.module' => 'appropriation')) ->select()->toArray(); View::assign('id', $id); View::assign('detail', $detail); View::assign('file_array', $file_array); return view('c_read'); } else { $id = isset($param['id']) ? $param['id'] : 0; $detail = $this->model->getCostProjectById($id); $comment = Db::name("project_comment")->where("project_id", $id)->order('create_time', 'desc')->select(); $file_array = Db::name('ProjectFile') ->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.nickname as admin_name') ->alias('mf') ->join('File f', 'mf.file_id = f.id', 'LEFT') ->join('Admin a', 'mf.admin_id = a.id', 'LEFT') ->order('mf.create_time desc') ->where(array('mf.topic_id' => $id, 'mf.module' => 'project')) ->select()->toArray(); $report = Db::name("project_report")->where([["project_id", "=", $id], ["r.status", "=", 1]])->alias("r")->join("admin a", "r.maker_id = a.id")->field("r.*,a.nickname")->select(); // halt($comment); $project_log = self::project_log($id); View::assign('project_log', $project_log); // halt($project_log); // 根据用户id 查询其能显示的字段 $field = $this->Field->get_field_rules_new(get_login_admin('id')); $c = $detail['project_end_time'] - time(); if ($c > 0) { $advent_time = floor($c / 86400) . "天"; } else { $c = -$c; $advent_time = floor($c / 86400) . "天"; } if (!empty($detail)) { View::assign('advent_time', $advent_time); View::assign('detail', $detail); View::assign('project_id', $id); View::assign('comment', $comment); View::assign('file_array', $file_array); View::assign('report', $report); View::assign('field', $field); View::assign('project_five', self::getProjectFive_company()); return view(); } else { throw new \think\exception\HttpException(404, '找不到页面'); } } } } public function getProjectFive_company() { $where = [ ['name', '=', '作业日志-公司'], ['name', '=', '工作记录-公司'], ['name', '=', '项目报告-公司'], ['name', '=', '项目人员-公司'], ['name', '=', '项目动态-公司'], ['name', '=', '项目附件-公司'], ['name', '=', '联系函-公司'], ]; $list = Db::name('AdminRule')->whereOr($where)->field('id,name')->select()->toArray(); $group_id = Db::name('AdminGroupAccess')->where('uid', get_login_admin('id'))->value('group_id'); $login_rules = Db::name('AdminGroup')->where('id', $group_id)->value('rules'); $login_rules = explode(',', $login_rules); $rules_id = array(); foreach ($list as $key => $value) { if ($value['name'] == "作业日志-公司") { if (in_array($value['id'], $login_rules)) { $rules_id['project_comments'] = 1; } else { $rules_id['project_comments'] = 0; } } else if ($value['name'] == "工作记录-公司") { if (in_array($value['id'], $login_rules)) { $rules_id['project_record'] = 1; } else { $rules_id['project_record'] = 0; } } else if ($value['name'] == "项目报告-公司") { if (in_array($value['id'], $login_rules)) { $rules_id['project_report'] = 1; } else { $rules_id['project_report'] = 0; } } else if ($value['name'] == "项目人员-公司") { if (in_array($value['id'], $login_rules)) { $rules_id['project_user'] = 1; } else { $rules_id['project_user'] = 0; } } else if ($value['name'] == "项目动态-公司") { if (in_array($value['id'], $login_rules)) { $rules_id['project_log'] = 1; } else { $rules_id['project_log'] = 0; } } else if ($value['name'] == "项目附件-公司") { if (in_array($value['id'], $login_rules)) { $rules_id['project_file'] = 1; } else { $rules_id['project_file'] = 0; } } else if ($value['name'] == "联系函-公司") { if (in_array($value['id'], $login_rules)) { $rules_id['project_contact'] = 1; } else { $rules_id['project_contact'] = 0; } } } return $rules_id; } public function getProjectFive() { $where = [ ['name', '=', '作业日志-财政局'], ['name', '=', '工作记录-财政局'], ['name', '=', '项目报告-财政局'], ['name', '=', '项目人员-财政局'], ['name', '=', '项目动态-财政局'], ['name', '=', '项目附件-财政局'], ['name', '=', '联系函-财政局'], ]; $list = Db::name('AdminRule')->whereOr($where)->field('id,name')->select()->toArray(); $group_id = Db::name('AdminGroupAccess')->where('uid', get_login_admin('id'))->value('group_id'); $login_rules = Db::name('AdminGroup')->where('id', $group_id)->value('rules'); $login_rules = explode(',', $login_rules); $rules_id = array(); foreach ($list as $key => $value) { if ($value['name'] == "作业日志-财政局") { if (in_array($value['id'], $login_rules)) { $rules_id['project_comments'] = 1; } else { $rules_id['project_comments'] = 0; } } else if ($value['name'] == "工作记录-财政局") { if (in_array($value['id'], $login_rules)) { $rules_id['project_record'] = 1; } else { $rules_id['project_record'] = 0; } } else if ($value['name'] == "项目报告-财政局") { if (in_array($value['id'], $login_rules)) { $rules_id['project_report'] = 1; } else { $rules_id['project_report'] = 0; } } else if ($value['name'] == "项目人员-财政局") { if (in_array($value['id'], $login_rules)) { $rules_id['project_user'] = 1; } else { $rules_id['project_user'] = 0; } } else if ($value['name'] == "项目动态-财政局") { if (in_array($value['id'], $login_rules)) { $rules_id['project_log'] = 1; } else { $rules_id['project_log'] = 0; } } else if ($value['name'] == "项目附件-财政局") { if (in_array($value['id'], $login_rules)) { $rules_id['project_file'] = 1; } else { $rules_id['project_file'] = 0; } } else if ($value['name'] == "联系函-财政局") { if (in_array($value['id'], $login_rules)) { $rules_id['project_contact'] = 1; } else { $rules_id['project_contact'] = 0; } } } return $rules_id; } /** * 通过 */ public function project_overrule_first() { if (request()->isAjax()) { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; //修改状态为原状态 if ($param["project_status"] == 2) { $param["project_status"] = 1; } elseif ($param["project_status"] == 7) { $param["project_status"] = 5; } elseif ($param["project_status"] == 6) { $param["project_status"] = 5; } 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"]); $param["approver_time"] = time(); $this->model->where('id', $param['project_id'])->strict(false)->update($param); unset($param["approver_time"]); add_project_log('审批拒绝', $param['project_id'], "项目分配审核拒绝,原因:" . $param["audit_remark"]); $maker = $this->model->where('id', $param['project_id'])->value("entrust_maker"); if (empty($handle['financial'])) { $handle['financial'] = (array)$maker; } else { $handle['financial'] = array_merge($handle['financial'], (array)$maker); } $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company'], []); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } return to_assign(0, "操作成功"); } } /** * 通过 */ public function project_overrule_second() { if (request()->isAjax()) { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; //修改状态为原状态 if ($param["project_status"] == 2) { $param["project_status"] = 1; } elseif ($param["project_status"] == 7) { $param["project_status"] = 5; } elseif ($param["project_status"] == 6) { $param["project_status"] = 5; } 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"]); $param["approver_time"] = time(); $this->model->where('id', $param['project_id'])->strict(false)->update($param); unset($param["approver_time"]); add_project_log('审批拒绝', $param['project_id'], "申请归档审核拒绝,原因:" . $param["audit_remark"]); $people = $this->Auditmodel->where('id', $id)->value("sponsor_id"); if (empty($handle['financial'])) { $handle['company'] = (array)$people; } else { $handle['company'] = array_merge($handle['company'], (array)$people); } $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company'], []); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } return to_assign(0, "操作成功"); } } /** * 拒绝 */ public function project_overrule_third() { if (request()->isAjax()) { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; //修改状态为原状态 if ($param["project_status"] == 2) { $param["project_status"] = 1; } elseif ($param["project_status"] == 7) { $param["project_status"] = 5; } elseif ($param["project_status"] == 6) { $param["project_status"] = 5; } 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"]); $param["approver_time"] = time(); $this->model->where('id', $param['project_id'])->strict(false)->update($param); unset($param["approver_time"]); add_project_log('审批拒绝', $param['project_id'], "申请退审审核拒绝,原因:" . $param["audit_remark"]); $people = $this->Auditmodel->where('id', $id)->value("sponsor_id"); if (empty($handle['financial'])) { $handle['company'] = (array)$people; } else { $handle['company'] = array_merge($handle['company'], (array)$people); } $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company'], []); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } return to_assign(0, "操作成功"); } } /** * 财政项目立项审批 */ public function project_edit_first() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { if ($param["audit_type"] == 1) { //修改状态为下一个状态 if ($param["project_status"] == 2) { //立项 $param["project_status"] = 3; } elseif ($param["project_status"] == 6) { //归档 $param["project_status"] = 8; $param["project_dead_time"] = time(); } elseif ($param["project_status"] == 7) { //退审 $param["project_status"] = 9; $param["project_dead_time"] = time(); } } try { $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["approver_time"] = time(); $this->model->where('id', $param['project_id'])->strict(false)->update($param); unset($param["approver_time"]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $maker = $this->model->where('id', $param['project_id'])->value("entrust_maker"); if (empty($handle['financial'])) { $handle['financial'] = (array)$maker; } else { $handle['financial'] = array_merge($handle['financial'], (array)$maker); } $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company'], []); add_project_log('审批通过', $param['project_id'], "项目分配审核通过"); return to_assign(0, "操作成功"); } } /** * 财政项目归档审批 */ public function project_edit_second() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { if ($param["audit_type"] == 1) { //修改状态为下一个状态 if ($param["project_status"] == 2) { //立项 $param["project_status"] = 3; } elseif ($param["project_status"] == 6) { //归档 $param["project_status"] = 8; $param["project_dead_time"] = time(); } elseif ($param["project_status"] == 7) { //退审 $param["project_status"] = 9; $param["project_dead_time"] = time(); } } try { $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']; unset($param["id"]); $param["approver_time"] = time(); $this->model->where('id', $param['project_id'])->strict(false)->update($param); unset($param["approver_time"]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $people = $this->Auditmodel->where('id', $id)->value("sponsor_id"); if (empty($handle['financial'])) { $handle['company'] = (array)$people; } else { $handle['company'] = array_merge($handle['company'], (array)$people); } $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company'], []); add_project_log('审批通过', $param['project_id'], "申请归档审核通过"); return to_assign(0, "操作成功"); } } /** * 财政项目退审审批 */ public function project_edit_third() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { if ($param["audit_type"] == 1) { //修改状态为下一个状态 if ($param["project_status"] == 2) { //立项 $param["project_status"] = 3; } elseif ($param["project_status"] == 6) { //归档 $param["project_status"] = 8; $param["project_dead_time"] = time(); } elseif ($param["project_status"] == 7) { //退审 $param["project_status"] = 9; $param["project_dead_time"] = time(); } } try { $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"]; unset($param["id"]); $param["approver_time"] = time(); $this->model->where('id', $param['project_id'])->strict(false)->update($param); unset($param["approver_time"]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $people = $this->Auditmodel->where('id', $id)->value("sponsor_id"); if (empty($handle['financial'])) { $handle['company'] = (array)$people; } else { $handle['company'] = array_merge($handle['company'], (array)$people); } $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company'], []); add_project_log('审批通过', $param['project_id'], "申请退审审核通过"); return to_assign(0, "操作成功"); } } /** * 公司同意报告 */ public function report_agree_first() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 5] ]; $next = $this->Auditmodel->where($where)->count(); if ($next == 0) { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_type", "=", 4] ]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $auditData = $this->Auditmodel->where($where)->find()->toArray(); $auditData["audit_name"] = "报告审核"; $auditData["audit_status"] = 1; $auditData["audit_type"] = 2; $auditData["approver"] = $detail["entrust_maker"]; $auditData["approver_name"] = $detail["entrust_maker_name"]; $auditData["create_time"] = time(); $auditData["audit_time"] = null; $auditData["remark"] = null; $auditData["audit_remark"] = null; unset($auditData["id"]); try { Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 0]); $this->Auditmodel->save($auditData); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } //内部审核通过了,通知公司的发起人,通知财政局的审批人 $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); if (empty($handle['company'])) { $handle['company'] = (array)$auditData["sponsor_id"]; } else { $handle['company'] = array_merge($handle['company'], (array)$auditData["sponsor_id"]); } $this->Pushmessage->pushMessage($param['project_id'], (array)$detail["entrust_maker"], $handle['company'], []); $else_name = Db::name("project_report")->where("id", $auditData["else_id"])->value("title"); add_project_log("新增项目报告", $param["project_id"], $else_name, 4); Db::name("cost_project")->where("id", $param["project_id"])->update(["report_time" => time()]); } else { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 5] ]; $approver = $this->Auditmodel->where($where)->value("approver"); $this->Auditmodel->where($where)->update(["audit_status" => 1]); //通过了一审,但是还有二审,通知公司的发起人审批通过了 $sponsor_id = $this->Auditmodel->where($where)->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // 通知发起人审批通过了 // $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], NULL, $handle['company'], []); // 通知下一级审批人,有待审核 $this->Pushmessage->pushMessage($param['project_id'], NULL, (array)$approver, []); } return to_assign(0, "操作成功"); } } public function report_agree_second() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 6] ]; $next = $this->Auditmodel->where($where)->count(); if ($next == 0) { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_type", "=", 4] ]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $auditData = $this->Auditmodel->where($where)->find()->toArray(); $auditData["audit_name"] = "报告审核"; $auditData["audit_status"] = 1; $auditData["audit_type"] = 2; $auditData["approver"] = $detail["entrust_maker"]; $auditData["approver_name"] = $detail["entrust_maker_name"]; $auditData["create_time"] = time(); $auditData["audit_time"] = null; $auditData["remark"] = null; $auditData["audit_remark"] = null; unset($auditData["id"]); try { Db::name("project_report")->where("id",$param["else_id"])->update(["status"=>0]); $this->Auditmodel->save($auditData); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } //内部审核通过了,通知公司的发起人,通知财政局的审批人 if (empty($handle['company'])) { $handle['company'] = (array)$auditData["sponsor_id"]; } else { $handle['company'] = array_merge($handle['company'], (array)$auditData["sponsor_id"]); } $this->Pushmessage->pushMessage($param['project_id'], (array)$detail["entrust_maker"], $handle['company'], []); $else_name = Db::name("project_report")->where("id",$auditData["else_id"])->value("title"); add_project_log("新增项目报告", $param["project_id"], $else_name, 4);add_project_log("新增项目报告", $param["project_id"], $auditData["else_name"], 4); Db::name("cost_project")->where("id", $param["project_id"])->update(["report_time" => time()]); } else { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 6], ]; $approver = $this->Auditmodel->where($where)->value("approver"); $this->Auditmodel->where($where)->update(["audit_status" => 1]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 0]); //通过了二审,但是还有三审,通知公司的发起人审批通过了 $sponsor_id = $this->Auditmodel->where($where)->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // 通知发起人审批通过了 // $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], NULL, $handle['company'], []); // 通知下一级审批人,有待审核 $this->Pushmessage->pushMessage($param['project_id'], NULL, (array)$approver, []); } return to_assign(0, "操作成功"); } } public function report_agree_third() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 14] ]; $next = $this->Auditmodel->where($where)->count(); if ($next == 0) { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_type", "=", 4] ]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $auditData = $this->Auditmodel->where($where)->find()->toArray(); $auditData["audit_name"] = "报告审核"; $auditData["audit_status"] = 1; $auditData["audit_type"] = 2; $auditData["approver"] = $detail["entrust_maker"]; $auditData["approver_name"] = $detail["entrust_maker_name"]; $auditData["create_time"] = time(); $auditData["audit_time"] = null; $auditData["remark"] = null; $auditData["audit_remark"] = null; unset($auditData["id"]); try { Db::name("project_report")->where("id",$param["else_id"])->update(["status"=>0]); $this->Auditmodel->save($auditData); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } //内部审核通过了,通知公司的发起人,通知财政局的审批人 if (empty($handle['company'])) { $handle['company'] = (array)$auditData["sponsor_id"]; } else { $handle['company'] = array_merge($handle['company'], (array)$auditData["sponsor_id"]); } $this->Pushmessage->pushMessage($param['project_id'], (array)$detail["entrust_maker"], $handle['company'], []); add_project_log("新增项目报告", $param["project_id"], $auditData["else_name"], 4); Db::name("cost_project")->where("id", $param["project_id"])->update(["report_time" => time()]); } else { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 14] ]; $approver = $this->Auditmodel->where($where)->value("approver"); $this->Auditmodel->where($where)->update(["audit_status" => 1]); //通过了三审,但是还有四审,通知公司的发起人审批通过了 $sponsor_id = $this->Auditmodel->where($where)->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // 通知发起人审批通过了 // $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], NULL, $handle['company'], []); // 通知下一级审批人,有待审核 $this->Pushmessage->pushMessage($param['project_id'], NULL, (array)$approver, []); } return to_assign(0, "操作成功"); } } public function report_agree_fourth() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 15] ]; $next = $this->Auditmodel->where($where)->count(); if ($next == 0) { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_type", "=", 4] ]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $auditData = $this->Auditmodel->where($where)->find()->toArray(); $auditData["audit_name"] = "报告审核"; $auditData["audit_status"] = 1; $auditData["audit_type"] = 2; $auditData["approver"] = $detail["entrust_maker"]; $auditData["approver_name"] = $detail["entrust_maker_name"]; $auditData["create_time"] = time(); $auditData["audit_time"] = null; $auditData["remark"] = null; $auditData["audit_remark"] = null; unset($auditData["id"]); try { Db::name("project_report")->where("id",$param["else_id"])->update(["status"=>0]); $this->Auditmodel->save($auditData); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 0]); //内部审核通过了,通知公司的发起人,通知财政局的审批人 if (empty($handle['company'])) { $handle['company'] = (array)$auditData["sponsor_id"]; } else { $handle['company'] = array_merge($handle['company'], (array)$auditData["sponsor_id"]); } $this->Pushmessage->pushMessage($param['project_id'], (array)$detail["entrust_maker"], $handle['company'], []); $else_name = Db::name("project_report")->where("id",$auditData["else_id"])->value("title"); add_project_log("新增项目报告", $param["project_id"], $else_name, 4); Db::name("cost_project")->where("id", $param["project_id"])->update(["report_time" => time()]); } else { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 15] ]; $approver = $this->Auditmodel->where($where)->value("approver"); $this->Auditmodel->where($where)->update(["audit_status" => 1]); //通过了四审,但是还有五审,通知公司的发起人审批通过了 $sponsor_id = $this->Auditmodel->where($where)->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // 通知发起人审批通过了 // $this->Pushmessage->pushMessage($param['project_id'], $handle['financial'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], NULL, $handle['company'], []); // 通知下一级审批人,有待审核 $this->Pushmessage->pushMessage($param['project_id'], NULL, (array)$approver, []); } return to_assign(0, "操作成功"); } } public function report_agree_fifth() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_type", "=", 4] ]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $auditData = $this->Auditmodel->where($where)->find()->toArray(); $auditData["audit_name"] = "报告审核"; $auditData["audit_status"] = 1; $auditData["audit_type"] = 2; $auditData["approver"] = $detail["entrust_maker"]; $auditData["approver_name"] = $detail["entrust_maker_name"]; $auditData["create_time"] = time(); $auditData["audit_time"] = null; $auditData["remark"] = null; $auditData["audit_remark"] = null; unset($auditData["id"]); try { Db::name("project_report")->where("id",$param["else_id"])->update(["status"=>0]); $this->Auditmodel->save($auditData); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 0]); //内部审核通过了,通知公司的发起人,通知财政局的审批人 if (empty($handle['company'])) { $handle['company'] = (array)$auditData["sponsor_id"]; } else { $handle['company'] = array_merge($handle['company'], (array)$auditData["sponsor_id"]); } $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company'], []); $else_name = Db::name("project_report")->where("id",$auditData["else_id"])->value("title"); add_project_log("新增项目报告", $param["project_id"], $else_name, 4); try { Db::name("cost_project")->where("id", $param["project_id"])->update(["report_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } return to_assign(0, "操作成功"); } } /** * 公司同意联系函 */ public function contact_agree_first() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 8] ]; $next = $this->Auditmodel->where($where)->count(); if ($next == 0) { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_type", "=", 7] ]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $auditData = $this->Auditmodel->where($where)->find()->toArray(); $auditData["audit_name"] = "联系函审核"; $auditData["audit_status"] = 1; $auditData["audit_type"] = 3; $auditData["approver"] = $detail["entrust_maker"]; $auditData["approver_name"] = $detail["entrust_maker_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()); } //内部审核通过了,通知公司的发起人,通知财政局的审批人 if (empty($handle['company'])) { $handle['company'] = (array)$auditData["sponsor_id"]; } else { $handle['company'] = array_merge($handle['company'], (array)$auditData["sponsor_id"]); } $this->Pushmessage->pushMessage($param['project_id'], (array)$detail["entrust_maker"], $handle['company'], []); add_project_log("新增项目联系函", $param["project_id"], $auditData["else_name"], 4); Db::name("cost_project")->where("id", $param["project_id"])->update(["report_time" => time()]); } else { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ['audit_status', '=', 5], ["audit_type", "=", 8] ]; $approver = $this->Auditmodel->where($where)->value("approver"); $this->Auditmodel->where($where)->update(["audit_status" => 1]); //通过了一审,但是还有二审,通知公司的发起人审批通过了 $sponsor_id = $this->Auditmodel->where($where)->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // 通知发起人审批通过了 $this->Pushmessage->pushMessage($param['project_id'], [], $handle['company'], []); // 通知下一级审批人,有待审核 $this->Pushmessage->pushMessage($param['project_id'], [], (array)$approver, []); } return to_assign(0, "操作成功"); } } /** * 公司同意联系函 */ public function contact_agree_second() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 9] ]; $next = $this->Auditmodel->where($where)->count(); if ($next == 0) { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_type", "=", 7] ]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $auditData = $this->Auditmodel->where($where)->find()->toArray(); $auditData["audit_name"] = "联系函审核"; $auditData["audit_status"] = 1; $auditData["audit_type"] = 3; $auditData["approver"] = $detail["entrust_maker"]; $auditData["approver_name"] = $detail["entrust_maker_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()); } //内部审核通过了,通知公司的发起人,通知财政局的审批人 if (empty($handle['company'])) { $handle['company'] = (array)$auditData["sponsor_id"]; } else { $handle['company'] = array_merge($handle['company'], (array)$auditData["sponsor_id"]); } $this->Pushmessage->pushMessage($param['project_id'], (array)$detail["entrust_maker"], $handle['company'], []); add_project_log("新增项目联系函", $param["project_id"], $auditData["else_name"], 4); Db::name("cost_project")->where("id", $param["project_id"])->update(["report_time" => time()]); } else { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ['audit_status', '=', '5'], ["audit_type", "=", 9], ]; $approver = $this->Auditmodel->where($where)->value('approver'); $this->Auditmodel->where($where)->update(["audit_status" => 1]); //通过了二审,但是还有三审,通知公司的发起人审批通过了 $sponsor_id = $this->Auditmodel->where($where)->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } $this->Pushmessage->pushMessage($param['project_id'], [], $handle['company'], []); $this->Pushmessage->pushMessage($param['project_id'], [], (array)$approver, []); } return to_assign(0, "操作成功"); } } /** * 公司同意联系函 */ public function contact_agree_third() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_type", "=", 7] ]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $auditData = $this->Auditmodel->where($where)->find()->toArray(); $auditData["audit_name"] = "联系函审核"; $auditData["audit_status"] = 1; $auditData["audit_type"] = 3; $auditData["approver"] = $detail["entrust_maker"]; $auditData["approver_name"] = $detail["entrust_maker_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()); } //内部审核通过了,通知公司的发起人,通知财政局的审批人 if (empty($handle['company'])) { $handle['company'] = (array)$auditData["sponsor_id"]; } else { $handle['company'] = array_merge($handle['company'], (array)$auditData["sponsor_id"]); } $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company'], []); add_project_log("新增项目联系函", $param["project_id"], $auditData["else_name"], 4); Db::name("cost_project")->where("id", $param["project_id"])->update(["report_time" => time()]); return to_assign(0, "操作成功"); } } /** * 公司同意请款 */ public function appropriation_agree_first() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id']) ->strict(false)->field(true) ->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", 0], ["audit_status", "=", 5], ["audit_type", "in", 11] ]; $next = $this->Auditmodel->where($where)->count(); if ($next == 0) { try { Db::name("appropriation")->where("id", $param["project_id"])->update(["status" => 1]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } //$param["project_id"]为关联id,非项目id $project = Db::name("appropriation_project")->where("uid", $param["project_id"])->select(); $financial = []; $company = []; $project_ids = []; foreach ($project as $item => $value) { $id = Db::name("cost_project")->where("id", $value['project_id'])->value("entrust_maker"); if (empty($handle['financial'])) { $financial = (array)$id; } else { $financial = array_merge($handle['financial'], (array)$id); } $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $company = (array)$sponsor_id; } else { $company = array_merge($handle['company'], (array)$sponsor_id); } $project_ids = array_merge($project_ids, (array)$value['project_id']); } $this->Pushmessage->pushMessage($project_ids, $financial, $company, []); } else { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", 0], ['audit_status', '=', 5], ["audit_type", "in", 11], ]; $approver = $this->Auditmodel->where($where)->value('approver'); $this->Auditmodel->where($where)->update(["audit_status" => 1]); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } //$param["project_id"]为关联id,非项目id $project = Db::name("appropriation_project")->where("uid", $param["project_id"])->select(); $project_ids = []; foreach ($project as $item => $value) { $project_ids = array_merge($project_ids, (array)$value['project_id']); } // 通知发起人审批通过了 $this->Pushmessage->pushMessage($project_ids, [], $handle['company'], []); //通知下一级审批人,有待审核 $this->Pushmessage->pushMessage($project_ids, [], (array)$approver, []); } return to_assign(0, "操作成功"); } } /** * 公司同意请款 */ public function appropriation_agree_second() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", 0], ["audit_status", "=", 5], ["audit_type", "in", 12] ]; $next = $this->Auditmodel->where($where)->count(); if ($next == 0) { try { Db::name("appropriation")->where("id", $param["project_id"])->update(["status" => 1]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } //$param["project_id"]为关联id,非项目id $project = Db::name("appropriation_project")->where("uid", $param["project_id"])->select(); $project_ids = []; $financial = []; $company = []; foreach ($project as $item => $value) { $id = Db::name("cost_project")->where("id", $value['project_id'])->value("entrust_maker"); if (empty($handle['financial'])) { $financial = (array)$id; } else { $financial = array_merge($handle['financial'], (array)$id); } $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $company = (array)$sponsor_id; } else { $company = array_merge($handle['company'], (array)$sponsor_id); } $project_ids = array_merge($project_ids, (array)$value['project_id']); } $this->Pushmessage->pushMessage($project_ids, $financial, $company, []); } else { $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", 0], ['audit_status', '=', 5], ["audit_type", "in", 12], ]; $approver = $this->Auditmodel->where('id', $param['id'])->value("approver"); $this->Auditmodel->where($where)->update(["audit_status" => 1]); //$param["project_id"]为关联id,非项目id $project = Db::name("appropriation_project")->where("uid", $param["project_id"])->select(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } $project_ids = []; foreach ($project as $item => $value) { $project_ids = array_merge($project_ids, (array)$value['project_id']); } // 通知发起人审批通过了 $this->Pushmessage->pushMessage($project_ids, [], $handle['company'], []); //通知下一级审批人,有待审核 $this->Pushmessage->pushMessage($project_ids, [], (array)$approver, []); } return to_assign(0, "操作成功"); } } /** * 公司同意请款 */ public function appropriation_agree_third() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { try { $param['audit_time'] = time(); $this->Auditmodel->where('id', $param['id'])->strict(false)->field(true)->update(["audit_status" => 2, "audit_time" => time()]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } try { Db::name("appropriation")->where("id", $param["project_id"])->update(["status" => 1]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } //$param["project_id"]为关联id,非项目id $project = Db::name("appropriation_project")->where("uid", $param["project_id"])->select(); $project_ids = []; $financial = []; $company = []; foreach ($project as $item => $value) { $id = Db::name("cost_project")->where("id", $value['project_id'])->value("entrust_maker"); if (empty($handle['financial'])) { $financial = (array)$id; } else { $financial = array_merge($handle['financial'], (array)$id); } $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $company = (array)$sponsor_id; } else { $company = array_merge($handle['company'], (array)$sponsor_id); } $project_ids = array_merge($project_ids, (array)$value['project_id']); } $this->Pushmessage->pushMessage($project_ids, $financial, $company, []); return to_assign(0, "操作成功"); } } /** * 公司拒绝报告 */ public function report_disagree_first() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 5] ]; $next = $this->Auditmodel->where($where)->column("id"); if (!empty($next)) { $this->Auditmodel->whereIn("id", $next)->update(["audit_remark" => "审核未全部通过,已作废"]); } $id = $param['id']; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], [], $handle['company'], []); $content = get_login_admin("nickname") . "拒绝了" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》,原因:".$param["audit_remark"]; add_project_log('审批拒绝', $param['project_id'], $content); return to_assign(0, "操作成功"); } } public function report_disagree_second() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 6] ]; $next = $this->Auditmodel->where($where)->column("id"); if (!empty($next)) { $this->Auditmodel->whereIn("id", $next)->update(["audit_remark" => "审核未全部通过,已作废"]); } $id = $param['id']; $MsgData = ["content" => get_login_admin("nickname") . "拒绝了您发起的" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》",]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company']); $content = get_login_admin("nickname") . "拒绝了" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》,原因:".$param["audit_remark"]; add_project_log('审批拒绝', $param['project_id'], $content); return to_assign(0, "操作成功"); } } public function report_disagree_third() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 14] ]; $next = $this->Auditmodel->where($where)->column("id"); if (!empty($next)) { $this->Auditmodel->whereIn("id", $next)->update(["audit_remark" => "审核未全部通过,已作废"]); } $id = $param['id']; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company']); $content = get_login_admin("nickname") . "拒绝了" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》,原因:".$param["audit_remark"]; add_project_log('审批拒绝', $param['project_id'], $content); return to_assign(0, "操作成功"); } } public function report_disagree_fourth() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 15] ]; $next = $this->Auditmodel->where($where)->column("id"); if (!empty($next)) { $this->Auditmodel->whereIn("id", $next)->update(["audit_remark" => "审核未全部通过,已作废"]); } $id = $param['id']; $MsgData = ["content" => get_login_admin("nickname") . "拒绝了您发起的" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》",]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], [], $handle['company'], []); $content = get_login_admin("nickname") . "拒绝了" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》,原因:".$param["audit_remark"]; add_project_log('审批拒绝', $param['project_id'], $content); return to_assign(0, "操作成功"); } } public function report_disagree_fifth() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $else_name = Db::name('project_audit')->where('else_id',$param['else_id'])->value('else_name'); $id = $param['id']; $MsgData = ["content" => get_login_admin("nickname") . "拒绝了您发起的" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $else_name . "》"]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], [], $handle['company'], []); $content = get_login_admin("nickname") . "拒绝了" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $else_name . "》,原因:".$param["audit_remark"]; add_project_log('审批拒绝', $param['project_id'], $content); return to_assign(0, "操作成功"); } } /** * 公司拒绝联系函 */ public function contact_disagree_first() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 8] ]; $next = $this->Auditmodel->where($where)->column("id"); if (!empty($next)) { $this->Auditmodel->whereIn("id", $next)->update(["audit_remark" => "审核未全部通过,已作废"]); } $id = $param['id']; $MsgData = ["content" => get_login_admin("nickname") . "拒绝了您发起的" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》",]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], [], $handle['company'], []); $content = get_login_admin("nickname") . "拒绝了" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》,原因:".$param["audit_remark"]; add_project_log('审批拒绝', $param['project_id'], $content); return to_assign(0, "操作成功"); } } /** * 公司拒绝联系函 */ public function contact_disagree_second() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", $param["else_id"]], ["audit_status", "=", 5], ["audit_type", "=", 9] ]; $next = $this->Auditmodel->where($where)->column("id"); if (!empty($next)) { $this->Auditmodel->whereIn("id", $next)->update(["audit_remark" => "审核未全部通过,已作废"]); } $id = $param['id']; $MsgData = ["content" => get_login_admin("nickname") . "拒绝了您发起的" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》",]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], [], $handle['company'], []); $content = get_login_admin("nickname") . "拒绝了" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》,原因:".$param["audit_remark"]; add_project_log('审批拒绝', $param['project_id'], $content); return to_assign(0, "操作成功"); } } /** * 公司拒绝联系函 */ public function contact_disagree_third() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $id = $param['id']; $MsgData = ["content" => get_login_admin("nickname") . "拒绝了您发起的" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》",]; $detail = Db::name("cost_project")->where("id", $param["project_id"])->field("entrust_maker,entrust_maker_name")->find(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); if (empty($handle['company'])) { $handle['company'] = (array)$sponsor_id; } else { $handle['company'] = array_merge($handle['company'], (array)$sponsor_id); } // $this->Pushmessage->pushMessage($param['project_id'], (array)$detail['entrust_maker'], $handle['company']); $this->Pushmessage->pushMessage($param['project_id'], [], $handle['company'], []); $content = get_login_admin("nickname") . "拒绝了" . $this->Auditmodel->where('id', $id)->value("audit_name") . "《" . $param["else_name"] . "》,原因:".$param["audit_remark"]; add_project_log('审批拒绝', $param['project_id'], $content); return to_assign(0, "操作成功"); } } /** * 公司拒绝请款 */ public function appropriation_disagree_first() { $param = get_params();; $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } try { Db::name("appropriation")->where("id", $param["project_id"])->update(["status" => -2]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", 0], ["audit_status", "=", 5], ["audit_type", ">", 10], ["audit_type", "<", 13] ]; $next = $this->Auditmodel->where($where)->column("id"); if (!empty($next)) { $this->Auditmodel->whereIn("id", $next)->update(["audit_status"=>4,"audit_remark" => "审核未全部通过,已作废"]); } //$param["project_id"]为关联id,非项目id $project = Db::name("appropriation_project")->where("uid", $param["project_id"])->select(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); $project_ids = []; foreach ($project as $item => $value) { $company = []; if (empty($handle['company'])) { $company = (array)$sponsor_id; } else { $company = array_merge($handle['company'], (array)$sponsor_id); } $project_ids = array_merge($project_ids, (array)$value['project_id']); } // $this->Pushmessage->pushMessage($project_ids, $handle['financial'],$company); $this->Pushmessage->pushMessage($param['project_id'], [], $company, []); return to_assign(0, "操作成功"); } } /** * 公司拒绝请款 */ public function appropriation_disagree_second() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } try { Db::name("appropriation")->where("id", $param["project_id"])->update(["status" => -2]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } $where = [ ["project_id", "=", $param["project_id"]], ["else_id", "=", 0], ["audit_status", "=", 5], ["audit_type", ">", 11], ["audit_type", "<", 13] ]; $next = $this->Auditmodel->where($where)->column("id"); if (!empty($next)) { $this->Auditmodel->whereIn("id", $next)->update(["audit_status"=>4,"audit_remark" => "审核未全部通过,已作废"]); } //$param["project_id"]为关联id,非项目id $project = Db::name("appropriation_project")->where("uid", $param["project_id"])->select(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); $project_ids = []; $company = []; foreach ($project as $item => $value) { if (empty($handle['company'])) { $company = (array)$sponsor_id; } else { $company = array_merge($handle['company'], (array)$sponsor_id); } $project_ids = array_merge($project_ids, (array)$value['project_id']); } // $this->Pushmessage->pushMessage($project_ids, $handle['financial'],$company); $this->Pushmessage->pushMessage($param['project_id'], [], $company, []); return to_assign(0, "操作成功"); } } /** * 公司拒绝请款 */ public function appropriation_disagree_third() { $param = get_params(); $handle = $this->Pushmessage->handleParam($param); $param = $handle['param']; if (request()->isAjax()) { 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()]); Db::name("project_report")->where("id", $param["else_id"])->update(["status" => 7]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } try { Db::name("appropriation")->where("id", $param["project_id"])->update(["status" => -2]); } catch (\Exception $e) { return to_assign(1, '操作失败,原因:' . $e->getMessage()); } //$param["project_id"]为关联id,非项目id $project = Db::name("appropriation_project")->where("uid", $param["project_id"])->select(); $sponsor_id = $this->Auditmodel->where('id', $param['id'])->value("sponsor_id"); $project_ids = []; foreach ($project as $item => $value) { $company = []; if (empty($handle['company'])) { $company = (array)$sponsor_id; } else { $company = array_merge($handle['company'], (array)$sponsor_id); } $project_ids = array_merge($project_ids, (array)$value['project_id']); } // $this->Pushmessage->pushMessage($project_ids, $handle['financial'],$company); $this->Pushmessage->pushMessage($param['project_id'], [], $company, []); return to_assign(0, "操作成功"); } } /** * 业主同意 */ public function proprietor_agree() { if (request()->isAjax()) { $param = get_params(); $id = isset($param['id']) ? $param["id"] : 0; $project_id = isset($param["project_id"]) ? $param["project_id"] : 0; $this->Auditmodel->update(["id" => $id, "audit_status" => 2, "audit_time" => time()]); $this->model->update(["id" => $project_id, "proprietor_status" => 2]); $sponsor_id = $this->Auditmodel->where('id', $id)->value('sponsor_id'); // $fiscal_nature = Db::name('CostProject')->where('project_id', $project_id)->value('fiscal_nature'); // if($fiscal_nature == '财政资金'){ // $this->Pushmessage->pushMessage($project_id, [], [], (array)$sponsor_id); // }else if($fiscal_nature == '非财政资金'){ $this->Pushmessage->pushMessage($project_id, [], [], (array)$sponsor_id); // } return to_assign("0", "操作成功"); } } /** * 业主拒绝 */ public function proprietor_disagree() { if (request()->isAjax()) { $param = get_params(); $id = isset($param['id']) ? $param["id"] : 0; $project_id = isset($param["project_id"]) ? $param["project_id"] : 0; $this->Auditmodel->update(["id" => $id, "audit_status" => 3, "audit_remark" => $param["audit_remark"], "audit_time" => time()]); $this->model->update(["id" => $project_id, "proprietor_status" => 0]); $sponsor_id = $this->Auditmodel->where('id', $id)->value('sponsor_id'); $this->Pushmessage->pushMessage($project_id, [], [], (array)$sponsor_id); return to_assign("0", "操作成功"); } } /* * ************************************************************************** * ************************************************************************** * * * _oo8oo_ * * o8888888o * * 88" . "88 * * (| -_- |) * * 0\ = /0 * * ___/'==='\___ * * .' \\| |// '. * * / \\||| : |||// \ * * / _||||| -:- |||||_ \ * * | | \\\ - /// | | * * | \_| ''\---/'' |_/ | * * \ .-\__ '-' __/-. / * * ___'. .' /--.--\ '. .'___ * * ."" '< '.___\_<|>_/___.' >' "". * * | | : `- \`.:`\ _ /`:.`/ -` : | | * * \ \ `-. \_ __\ /__ _/ .-` / / * * =====`-.____`.___ \_____/ ___.`____.-`===== * * `=---=` * * ************************************************************************** * ******************** ******************** * ******************** ******************** * ******************** 佛祖保佑 永远无BUG ******************** * ******************** ******************** * ************************************************************************** */ }