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