diff --git a/application/common.php b/application/common.php index 071996c..901da6f 100644 --- a/application/common.php +++ b/application/common.php @@ -69,7 +69,7 @@ function resultArray($array) $array['data'] = ''; } elseif (isset($array['error'])) { $code = 400; - $array['data'] = ''; + $array['data'] = '操作失败'; } elseif (isset($array['success'])) { $array['error'] = ''; $array['data'] =$array['success'] ; diff --git a/application/crm/controller/Business.php b/application/crm/controller/Business.php index cfc25aa..75c8d41 100644 --- a/application/crm/controller/Business.php +++ b/application/crm/controller/Business.php @@ -725,11 +725,7 @@ class Business extends ApiCommon $businessData['statusRemark'] = $dataInfo['submit_remark']; $result = $this->advanceAfterCheck($businessData); - echo $result; - echo '\\n'; - echo !empty($result); - if (!empty($result)) return resultArray(['error' => $result]); - echo '12345'; + if (!empty($result)) return $result; } else { if ($status) { //发送站内信 @@ -754,7 +750,6 @@ class Business extends ApiCommon ); } } - echo '1234'; return resultArray(['success' => '审批成功']); } else { return resultArray(['error' => '审批失败,请重试!']); @@ -775,11 +770,11 @@ class Business extends ApiCommon $userModel = new \app\admin\model\User(); $is_end = $param['is_end'] ?: 0; //1赢单2输单3无效 if (!$param['business_id']) { - return resultArray(['error' => '参数错误']); + return ['error' => '参数错误']; } $businessInfo = db('crm_business')->where(['business_id' => $param['business_id']])->find(); if ($businessInfo['is_end']) { - return resultArray(['error' => '已结束,不能推进']); + return ['error' => '已结束,不能推进']; } //判断权限 $auth_user_ids = $userModel->getUserByPer('crm', 'business', 'update'); @@ -793,7 +788,7 @@ class Business extends ApiCommon $status_id = $param['status_id'] ?: $businessInfo['status_id']; $statusInfo = db('crm_business_status')->where(['type_id' => $businessInfo['type_id'], 'status_id' => $status_id])->find(); if (!$statusInfo && !$is_end) { - return resultArray(['error' => '参数错误']); + return ['error' => '参数错误']; } $data = []; $data['update_time'] = time(); @@ -806,7 +801,7 @@ class Business extends ApiCommon $data['remark'] = $param['submit_remark']; $res = db('crm_business')->where(['business_id' => $param['business_id']])->update($data); if (!$res) { - return resultArray(['error' => '推进失败,请重试']); + return ['error' => '推进失败,请重试']; } else { # 商机变更后的名称 $businessStatusName = Db::name('crm_business_status')->where('status_id', $param['status_id'])->value('name'); @@ -844,7 +839,7 @@ class Business extends ApiCommon 'status_list' => $businessStatus ]; - return resultArray(['data' => $result]); + return ''; } }