|
@@ -54,6 +54,7 @@ class Workflow extends \think\Model
|
|
|
"updatetime"=>date("Y-m-d H:i:s")
|
|
|
];
|
|
|
self::insert($proces);
|
|
|
+ self::Addwait($data);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -62,7 +63,7 @@ class Workflow extends \think\Model
|
|
|
* 待办事项新建
|
|
|
*
|
|
|
*/
|
|
|
- public function Addwait($data){
|
|
|
+ public static function Addwait($data){
|
|
|
$conf =self::$conf;
|
|
|
$action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[];
|
|
|
if(!empty($action)){
|
|
@@ -77,21 +78,26 @@ class Workflow extends \think\Model
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- $orderp =Db::name("action_prcess")->field("uid,uname")->where(["order_type"=>$data['order_type'],
|
|
|
- "order_process"=>$wait])->find();
|
|
|
- $data=[
|
|
|
- "order_type"=>$data['order_type'],
|
|
|
- "order_code"=>$data['order_code'],
|
|
|
- "order_id"=>$data['order_id'],
|
|
|
- "order_process"=>$wait,
|
|
|
- "order_status"=>$data['action_process'],
|
|
|
- "apply_id"=>$data['action_uid'],
|
|
|
- "apply_name"=>$data['action_name'],
|
|
|
- "action_uid"=>$orderp['uid'],
|
|
|
- "action_name"=>$orderp['uname'],
|
|
|
- "addtime"=>date("Y-m-d H:i:s"),
|
|
|
- "updatetime"=>date("Y-m-d H:i:s")
|
|
|
- ];
|
|
|
+ $orderp =ActionProcess::where(["order_type"=>$data['order_type'],"order_process"=>$wait])->find();
|
|
|
+ if($orderp!=false){
|
|
|
+
|
|
|
+ $data=[
|
|
|
+ "order_type"=>$data['order_type'],
|
|
|
+ "order_code"=>$data['order_code'],
|
|
|
+ "order_id"=>$data['order_id'],
|
|
|
+ "order_process"=>$wait,
|
|
|
+ "order_status"=>$data['action_process'],
|
|
|
+ "apply_id"=>$data['action_uid'],
|
|
|
+ "apply_name"=>$data['action_name'],
|
|
|
+ "action_uid"=>$orderp['uid'],
|
|
|
+ "action_name"=>$orderp['uname'],
|
|
|
+ "status"=>self::$order_status==3?2:1,
|
|
|
+ "addtime"=>date("Y-m-d H:i:s"),
|
|
|
+ "updatetime"=>date("Y-m-d H:i:s")
|
|
|
+ ];
|
|
|
+ ProcessWait::add($data);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|