|
@@ -8,30 +8,32 @@ use think\facade\Config;
|
|
|
class Workflow extends \think\Model
|
|
|
{
|
|
|
public static $conf=[];
|
|
|
+ public static $order_status=2;
|
|
|
public function __construct(array $data = [])
|
|
|
{
|
|
|
parent::__construct($data);
|
|
|
self::$conf=Config::get("process");
|
|
|
- }
|
|
|
-
|
|
|
- public static function SaveFlow($data){
|
|
|
$conf =self::$conf;
|
|
|
$action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[];
|
|
|
$last =end($action);
|
|
|
- $order_status=2;//默认进行中
|
|
|
+ self::$order_status=2;//默认进行中
|
|
|
if((is_array($last)&&in_array($data['action_process'],$last))||$last==$data['action_process']){
|
|
|
- $order_status=3; //流程结束
|
|
|
+ self::$order_status=3; //流程结束
|
|
|
}
|
|
|
|
|
|
$header =reset($action);
|
|
|
if((is_array($header)&&in_array($data['action_process'],$header))||$header==$data['action_process']){
|
|
|
- $order_status=1; //流程新建
|
|
|
+ self::$order_status=1; //流程新建
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function SaveFlow($data){
|
|
|
+
|
|
|
$proces = self::where(["order_type"=>$data['order_type'],"order_code"=>$data['order_code'],"is_del"=>0])->find();
|
|
|
if($proces){
|
|
|
$info=[
|
|
|
"order_process"=>$data['order_status'],
|
|
|
- "order_status"=>$order_status,
|
|
|
+ "order_status"=>self::$order_status,
|
|
|
"action_uid"=>$data['action_uid'],
|
|
|
"action_name"=>$data['action_name'],
|
|
|
"updatetime"=>date("Y-m-d H:i:s")
|
|
@@ -43,7 +45,7 @@ class Workflow extends \think\Model
|
|
|
"order_code"=>$data['order_code'],
|
|
|
"order_id"=>$data['order_id'],
|
|
|
"order_process"=>$data['order_status'],
|
|
|
- "order_status"=>$order_status,
|
|
|
+ "order_status"=>self::$order_status,
|
|
|
"apply_id"=>$data['action_uid'],
|
|
|
"apply_name"=>$data['action_name'],
|
|
|
"action_uid"=>$data['action_uid'],
|
|
@@ -61,7 +63,9 @@ class Workflow extends \think\Model
|
|
|
*
|
|
|
*/
|
|
|
public function Addwait($data){
|
|
|
+ $data=[
|
|
|
|
|
|
+ ];
|
|
|
}
|
|
|
|
|
|
public function checkStatus(){
|