$data['order_type'],"order_id"=>$data['order_id'],"is_del"=>0])->find(); if($proces){ $info=[ "order_process"=>$data['order_status'], "order_status"=>$order_status, "action_uid"=>$data['action_uid'], "action_name"=>$data['action_name'], "updatetime"=>date("Y-m-d H:i:s") ]; self::where(["id"=>$proces['id']])->update($info); }else{ $proces=[ "order_type"=>$data['order_type'], "order_code"=>$data['order_code'], "order_id"=>$data['order_id'], "order_process"=>$data['order_status'], "order_status"=>$order_status, "apply_id"=>$data['action_uid'], "apply_name"=>$data['action_name'], "action_uid"=>$data['action_uid'], "action_name"=>$data['action_name'], "addtime"=>date("Y-m-d H:i:s"), "updatetime"=>date("Y-m-d H:i:s") ]; self::insert($proces); } // self::Addwait($data); } /** * 待办事项新建 * */ public static function Addwait($data){ $conf =Config::get("process"); $action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[]; $order_status=1 ; if(!empty($action)){ $last =end($action); $wait=""; foreach ($action as $key=>$value){ if((is_array($value)&&in_array($data['action_process'],$value))||$value==$data['action_process']){ if($value!=$last){ $order_status=1; $index=$key+1; $wait= is_array($action[$index])? $action[$index][0]:$action[$index]; break; }else{ $wait=$data['action_process']; $order_status=2; } } } $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'], "wait_id"=>$orderp['uid'], "wait_name"=>$orderp['uname'], "roleid"=>$orderp['roleid'], "action_uid"=>$data['action_uid'], "action_name"=>$data['action_name'], "status"=>$order_status, "addtime"=>date("Y-m-d H:i:s"), "updatetime"=>date("Y-m-d H:i:s") ]; $da=ProcessWait::where(['order_code'=>$data['order_code'],"order_type"=>$data['order_type']]) ->find(); if($da==false){ ProcessWait::insert($data); }else{ ProcessWait::where(['order_code'=>$data['order_code'],"order_type"=>$data['order_type']])->update ($data); } } } } public function checkStatus(){ } }