diff --git a/app/adminapi/logic/bid/BidDocumentExaminationLogic.php b/app/adminapi/logic/bid/BidDocumentExaminationLogic.php index c825442bd..f00340336 100644 --- a/app/adminapi/logic/bid/BidDocumentExaminationLogic.php +++ b/app/adminapi/logic/bid/BidDocumentExaminationLogic.php @@ -15,6 +15,7 @@ namespace app\adminapi\logic\bid; +use app\adminapi\logic\oa\FlowApproveLogic; use app\common\model\auth\Admin; use app\common\model\bid\BidBiddingDecision; use app\common\model\bid\BidBuyBiddingDocument; @@ -22,6 +23,7 @@ use app\common\model\bid\BidDocumentExamination; use app\common\model\bid\BidDocumentExaminationDetail; use app\common\logic\BaseLogic; use app\common\model\custom\Custom; +use app\common\model\oa\FlowApprove; use app\common\model\project\Project; use think\facade\Db; @@ -85,6 +87,7 @@ class BidDocumentExaminationLogic extends BaseLogic $res->id, 'app\common\model\bid\BidDocumentExamination', 'app\adminapi\logic\bid\BidDocumentExaminationLogic', + $params['approve_detail']['path'], $params['approve_detail']['flow_type'], $params['approve_detail']['flow_path'], $admin_id @@ -134,6 +137,10 @@ class BidDocumentExaminationLogic extends BaseLogic $data['project_desc'] = $bid_decision['project_desc']; $data['annex'] = $bid_decision['annex']; $data['total_amount'] = BidDocumentExaminationDetail::where('bid_document_examination_id',$data['id'])->sum('sale_amount'); + $approve_info = FlowApprove::field('id')->where('content_id',$params['id']) + ->where('content_model','app\common\model\bid\BidDocumentExamination') + ->where('content_logic','app\adminapi\logic\bid\BidDocumentExaminationLogic')->findOrEmpty(); + $data['approve_detail'] = FlowApproveLogic::detail(['id'=>$approve_info['id']]); return $data->toArray(); } } \ No newline at end of file diff --git a/app/adminapi/logic/oa/FlowApproveLogic.php b/app/adminapi/logic/oa/FlowApproveLogic.php index a82131463..5f598a569 100644 --- a/app/adminapi/logic/oa/FlowApproveLogic.php +++ b/app/adminapi/logic/oa/FlowApproveLogic.php @@ -27,8 +27,7 @@ class FlowApproveLogic extends BaseLogic public static function detail($params): array { $data = FlowApprove::field('id,title,flow_id,content_id,content_model,content_logic,create_user,check_status')->findOrEmpty($params['id']); - //获取审批内容信息 - $content = $data['content_logic']::detail(['id'=>$data['content_id']]); + if($data->isEmpty()) return []; //获取创建人信息 $create_user = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); //获取审批流程信息 @@ -61,10 +60,9 @@ class FlowApproveLogic extends BaseLogic $data['current_check_user'] = $current_check_user; $data['create_user_name'] = $create_user['name']; $data['copy_user'] = implode(',',$copy); - $data['content'] = $content; $data['step'] = $step; $data['record'] = $record; - unset($data['flow_id'],$data['content_id'],$data['content_model'],$data['content_logic']); + unset($data['flow_id'],$data['content_model'],$data['content_logic']); return $data->toArray(); } diff --git a/app/common.php b/app/common.php index ca31c7b72..0ab8e89d6 100755 --- a/app/common.php +++ b/app/common.php @@ -360,7 +360,7 @@ function daysBetweenDates($start_date,$end_date): bool|int return $interval->days; } -function addApprove($title,$content_id,$content_model,$content_logic,$flow_type_id,$flow_id,$create_user_id){ +function addApprove($title,$content_id,$content_model,$content_logic,$patah,$flow_type_id,$flow_id,$create_user_id){ $createUser = Admin::field('name,dept_id')->where('id',$create_user_id)->findOrEmpty(); //获取审批流程信息 $flowData = Flow::where('id',$flow_id)->findOrEmpty(); @@ -372,6 +372,7 @@ function addApprove($title,$content_id,$content_model,$content_logic,$flow_type_ 'content_id' => $content_id, 'content_model' => $content_model, 'content_logic' => $content_logic, + 'path' => $patah, 'flow_type_id' => $flow_type_id, 'flow_id' => $flow_id, 'create_user' => $create_user_id, diff --git a/app/common/model/oa/FlowApprove.php b/app/common/model/oa/FlowApprove.php index ebdb8189e..c60b3f22d 100644 --- a/app/common/model/oa/FlowApprove.php +++ b/app/common/model/oa/FlowApprove.php @@ -33,6 +33,6 @@ class FlowApprove extends BaseModel public function getCheckStatusTextAttr($value,$data){ $dict = DictData::where('type_value','check_status')->column('name','value'); - return $dict[$data['check_status']]; + return !empty($data['check_status']) ? $dict[$data['check_status']] : ''; } } \ No newline at end of file diff --git a/app/common/validate/BaseValidate.php b/app/common/validate/BaseValidate.php index caba3617a..6ffae2ada 100755 --- a/app/common/validate/BaseValidate.php +++ b/app/common/validate/BaseValidate.php @@ -104,6 +104,9 @@ class BaseValidate extends Validate $fp = Flow::where('id',$value['flow_path'])->where('flow_cate',$value['flow_type'])->findOrEmpty(); if($fp->isEmpty()) return '审批流程数据不存在'; } + if(empty($value['path'])){ + return 'path字段不能为空'; + } return true; } } \ No newline at end of file