|
@@ -78,7 +78,6 @@ class ActionProcess extends Base
|
|
|
'next_action_ids|下一节点' => 'array|requireIf:action_type,' . APModel::$action_type_start . '|requireIf:action_type,' . APModel::$action_type_process,
|
|
|
]);
|
|
|
|
|
|
-
|
|
|
$val->extend('checkOrderProcess', function ($val, $rule, $data) {
|
|
|
return APModel::where([
|
|
|
'process_id' => $data['process_id'],
|
|
@@ -89,13 +88,20 @@ class ActionProcess extends Base
|
|
|
|
|
|
if (!$val->check($param)) return error_show(1005, $val->getError());
|
|
|
|
|
|
- $user = GetUserInfo($param['token']);
|
|
|
+ //获取流程
|
|
|
+ $process = PModel::field('id,process_name,process_type')
|
|
|
+ ->where(['id' => $param['process_id'], 'is_del' => PModel::$is_del_normal])
|
|
|
+ ->findOrEmpty()
|
|
|
+ ->toArray();
|
|
|
+ if (empty($process)) return error_show(1005, '您所选的流程不存在');
|
|
|
|
|
|
- $uid = isset($user['data']['id']) ? $user['data']['id'] : 0;
|
|
|
- $uname = isset($user['data']['nickname']) ? $user['data']['nickname'] : '';
|
|
|
+ $uid = $this->uid;
|
|
|
+ $uname = $this->uname;
|
|
|
$date = date('Y-m-d H:i:s');
|
|
|
|
|
|
return APModel::create(array_merge($param, [
|
|
|
+ 'order_type' => $process['process_type'],
|
|
|
+ 'order_name' => $process['process_name'],
|
|
|
'status' => APModel::$status_disable,
|
|
|
'is_del' => APModel::$is_del_normal,
|
|
|
'createrid' => $uid,
|
|
@@ -156,7 +162,7 @@ class ActionProcess extends Base
|
|
|
->field('id,process_id')
|
|
|
->findOrEmpty();
|
|
|
|
|
|
- if($info->isEmpty()) return error_show(1005,'该节点记录不存在');
|
|
|
+ if ($info->isEmpty()) return error_show(1005, '该节点记录不存在');
|
|
|
|
|
|
if (isset($param['status']) && $param['status'] == APModel::$status_disable) {
|
|
|
//禁用节点时,要校验其所属流程是否被禁用
|
|
@@ -169,10 +175,8 @@ class ActionProcess extends Base
|
|
|
|
|
|
}
|
|
|
|
|
|
- $user = GetUserInfo($param['token']);
|
|
|
-
|
|
|
- $uid = isset($user['data']['id']) ? $user['data']['id'] : 0;
|
|
|
- $uname = isset($user['data']['nickname']) ? $user['data']['nickname'] : '';
|
|
|
+ $uid = $this->uid;
|
|
|
+ $uname = $this->uname;
|
|
|
$date = date('Y-m-d H:i:s');
|
|
|
|
|
|
if (isset($param['next_action_ids']) && is_array($param['next_action_ids'])) $param['next_action_ids'] = implode(',', $param['next_action_ids']);
|
|
@@ -186,7 +190,7 @@ class ActionProcess extends Base
|
|
|
{
|
|
|
|
|
|
$data = PModel::where(['is_del' => PModel::$is_del_normal, 'status' => PModel::$status_normal])
|
|
|
- ->order(['weight'=>'desc','id'=>'desc'])
|
|
|
+ ->order(['weight' => 'desc', 'id' => 'desc'])
|
|
|
->column('id,process_name,process_type', 'id');
|
|
|
|
|
|
$action = APModel::where(['is_del' => APModel::$is_del_normal, 'status' => APModel::$status_normal, 'operation_type' => APModel::$operation_type_approval])
|