diff --git a/application/admin/controller/ExamineFlow.php b/application/admin/controller/ExamineFlow.php index dbd8ec9..fd31925 100644 --- a/application/admin/controller/ExamineFlow.php +++ b/application/admin/controller/ExamineFlow.php @@ -295,7 +295,7 @@ class ExamineFlow extends ApiCommon $flow_id = $param['flow_id']; $types = $param['types']; $types_id = $param['types_id']; - $typesArr = ['crm_contract', 'crm_receivables', 'crm_invoice', 'oa_examine', 'jxc_purchase', 'jxc_retreat', 'jxc_sale', 'jxc_salereturn', 'jxc_payment', 'jxc_collection', 'jxc_allocation', 'jxc_inventory']; + $typesArr = ['crm_customer_check','crm_business','crm_contract', 'crm_receivables', 'crm_invoice', 'oa_examine', 'jxc_purchase', 'jxc_retreat', 'jxc_sale', 'jxc_salereturn', 'jxc_payment', 'jxc_collection', 'jxc_allocation', 'jxc_inventory']; if (!$types || !in_array($types, $typesArr)) { return resultArray(['error' => '参数错误']); } diff --git a/application/admin/model/ExamineStep.php b/application/admin/model/ExamineStep.php index 5f21099..1bc99bd 100644 --- a/application/admin/model/ExamineStep.php +++ b/application/admin/model/ExamineStep.php @@ -188,6 +188,8 @@ class ExamineStep extends Common case 'jxc_collection': $dataInfo = db('jxc_collection')->where(['collection_note_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break; case 'jxc_inventory': $dataInfo = db('jxc_inventory')->where(['inventory_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break; case 'jxc_allocation': $dataInfo = db('jxc_allocation')->where(['allocation_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break; + case 'crm_customer_check': $dataInfo = db('crm_customer_check')->where(['customer_check_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break; + case 'crm_business': $dataInfo = db('crm_business')->where(['business_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break; } $stepInfo = []; if ($dataInfo['flow_id'] && !in_array($dataInfo['check_status'],['5'])) { diff --git a/application/crm/controller/Business.php b/application/crm/controller/Business.php index 2f1dd4f..1d271cf 100644 --- a/application/crm/controller/Business.php +++ b/application/crm/controller/Business.php @@ -410,11 +410,11 @@ class Business extends ApiCommon if (($examineStatus != false && $examineStatus != 'false') || $examineStatus == 1) { // 审核判断(是否有符合条件的审批流) $examineFlowModel = new \app\admin\model\ExamineFlow(); - if (!$examineFlowModel->checkExamine($userInfo['user_id'], 'crm_business')) { + if (!$examineFlowModel->checkExamine($userInfo['id'], 'crm_business')) { return '暂无审批人,无法创建'; } //添加审批相关信息 - $examineFlowData = $examineFlowModel->getFlowByTypes($userInfo['user_id'], 'crm_business'); + $examineFlowData = $examineFlowModel->getFlowByTypes($userInfo['id'], 'crm_business'); if (!$examineFlowData) { return '无可用审批流,请联系管理员'; } @@ -422,7 +422,7 @@ class Business extends ApiCommon //获取审批人信息 if ($examineFlowData['config'] == 1) { //固定审批流 - $nextStepData = $examineStepModel->nextStepUser($userInfo['user_id'], $examineFlowData['flow_id'], 'crm_business', 0, 0, 0); + $nextStepData = $examineStepModel->nextStepUser($userInfo['id'], $examineFlowData['flow_id'], 'crm_business', 0, 0, 0); $next_user_ids = arrayToString($nextStepData['next_user_ids']) ?: ''; $check_user_id = $next_user_ids ?: []; $data['order_id'] = 1; diff --git a/application/crm/controller/Customer.php b/application/crm/controller/Customer.php index e2e32a8..bfe71d3 100644 --- a/application/crm/controller/Customer.php +++ b/application/crm/controller/Customer.php @@ -127,6 +127,7 @@ class Customer extends ApiCommon $customerCheck = db('crm_customer_check')->where(['customer_id' => $param['id']])->where(['check_status' => 0])->find(); if (!empty($customerCheck)) { $data['flow_id'] = $customerCheck['flow_id']; + $data['owner_user_id']=$customerCheck['user_id']; } return resultArray(['data' => $data]); } diff --git a/application/crm/model/CustomerCheck.php b/application/crm/model/CustomerCheck.php index 90cbf45..268f16f 100644 --- a/application/crm/model/CustomerCheck.php +++ b/application/crm/model/CustomerCheck.php @@ -164,6 +164,8 @@ class CustomerCheck extends Common $createData[$key]['check_user_id'] = $param['check_user_id'] ?? 0; $createData[$key]['flow_user_id'] = $param['flow_user_id'] ?? 0; $createData[$key]['user_id'] = $param['user_id'] ?? 0; + $createData[$key]['create_user_id'] = $param['user_id'] ?? 0; + $createData[$key]['owner_user_id'] = $param['user_id'] ?? 0; } $this->startTrans();