|
@@ -7,18 +7,13 @@ 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;
|
|
|
+ $conf =Config::get("process");
|
|
|
$action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[];
|
|
|
$last =end($action);
|
|
|
+
|
|
|
$order_status=2;//默认进行中
|
|
|
if((is_array($last)&&in_array($data['action_process'],$last))||$last==$data['action_process']){
|
|
|
$order_status=3; //流程结束
|
|
@@ -63,7 +58,7 @@ class Workflow extends \think\Model
|
|
|
*
|
|
|
*/
|
|
|
public static function Addwait($data){
|
|
|
- $conf =self::$conf;
|
|
|
+ $conf =Config::get("process");
|
|
|
$action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[];
|
|
|
if(!empty($action)){
|
|
|
$last =end($action);
|
|
@@ -75,11 +70,13 @@ class Workflow extends \think\Model
|
|
|
$index=$key+1;
|
|
|
$wait= is_array($action[$index])? $action[$index][0]:$action[$index];
|
|
|
break;
|
|
|
+ }else{
|
|
|
+ $wait=$data['action_process'];
|
|
|
+ $order_status=2 ;
|
|
|
}
|
|
|
- }else{
|
|
|
- $order_status=2 ;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
$orderp =ActionProcess::where(["order_type"=>$data['order_type'],"order_process"=>$wait])->find();
|
|
|
if($orderp!=false){
|
|
|
|