wugg 2 years ago
parent
commit
6fb1ce8dbd

+ 1 - 0
app/admin/controller/Consult.php

@@ -968,6 +968,7 @@ class Consult extends Base
         if($info['delivery_place']!=""){
             list($place['provice_code'],$place['city_code'],$place['area_code'])=explode(",",$info['delivery_place']);
         }
+        $info['delivery_place_cn']=GetAddr(json_encode($place));
         $place = ["provice_code"=>"","city_code"=>"","area_code"=>""];
         if($info['origin_place']!=""){
             list($place['provice_code'],$place['city_code'],$place['area_code'])=explode(",",$info['origin_place']);

+ 12 - 0
app/admin/model/ActionProcess.php

@@ -0,0 +1,12 @@
+<?php
+
+
+namespace app\admin\model;
+
+
+use think\Model;
+
+class ActionProcess extends Model
+{
+
+}

+ 18 - 0
app/admin/model/ProcessWait.php

@@ -0,0 +1,18 @@
+<?php
+
+
+namespace app\admin\model;
+
+
+class ProcessWait extends \think\model
+{
+   public  static function add($data){
+        $da=self::find(['orderCode'=>$data['orderCode']]);
+        if($da==false){
+            self::insert($data);
+        }else{
+            self::where($da)->save($data);
+        }
+    }
+
+}

+ 22 - 16
app/admin/model/Workflow.php

@@ -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);
+            }
+
 
         }