From cb1a21e79904f4d2835c8d707fddfe2ca924b5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=90=8C?= <494089941@qq.com> Date: Tue, 7 Mar 2023 17:10:35 +0800 Subject: [PATCH] =?UTF-8?q?flow=5Fid=20=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/crm/controller/Customer.php | 14 +++++++------- application/crm/model/CustomerCheck.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/crm/controller/Customer.php b/application/crm/controller/Customer.php index 6e52744..e2e32a8 100644 --- a/application/crm/controller/Customer.php +++ b/application/crm/controller/Customer.php @@ -119,15 +119,15 @@ class Customer extends ApiCommon //判断是否客户池数据 $wherePool = $customerModel->getWhereByPool(); $resPool = db('crm_customer')->alias('customer')->where(['customer_id' => $param['id']])->where($wherePool)->find(); - if (!$resPool && !in_array($data['owner_user_id'], $auth_user_ids) && !$roPre && !$rwPre) { + if (!$resPool && !in_array($data['owner_user_id'], $auth_user_ids) && !$roPre && !$rwPre) { $authData['dataAuth'] = (int)0; return resultArray(['data' => $authData]); } - // 判断是否有客户捞取审批 - $customerCheck = db('crm_customer_check')->where(['customer_id' => $param['id']])->where(['check_status'=>0])->find(); - if(!$customerCheck){ - $data['flow_id']=$customerCheck['flow_id']; - } + // 判断是否有客户捞取审批 + $customerCheck = db('crm_customer_check')->where(['customer_id' => $param['id']])->where(['check_status' => 0])->find(); + if (!empty($customerCheck)) { + $data['flow_id'] = $customerCheck['flow_id']; + } return resultArray(['data' => $data]); } @@ -888,7 +888,7 @@ class Customer extends ApiCommon */ public function top() { - $customerModel=model('Customer'); + $customerModel = model('Customer'); $param = $this->param; $userInfo = $this->userInfo; $param['create_role_id'] = $userInfo['id']; diff --git a/application/crm/model/CustomerCheck.php b/application/crm/model/CustomerCheck.php index 4f6c75f..90cbf45 100644 --- a/application/crm/model/CustomerCheck.php +++ b/application/crm/model/CustomerCheck.php @@ -108,7 +108,7 @@ class CustomerCheck extends Common ->where($partMap) ->where($dealtWhere) ->limit($request['offset'], $request['length']) - ->field('customer_check.*,customer.name as name'.$customerField) + ->field('customer_check.*,customer.name as name,'.$customerField) ->orderRaw($order) ->select();