Browse Source

Merge branch 'wugg-dev' of wugg/phpstock into version1.5

wugg 2 years ago
parent
commit
44160e373b

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

@@ -968,7 +968,12 @@ 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']);
+        }
+
+        $info['origin_place_cn']=GetAddr(json_encode($place));
         $info['metal_name']=isset($info['metal_id'])&& $info['metal_id']!=0?$this->noble[$info['metal_id']]:"";
         $bargain =Db::name("bargain_order")->where(['bidsNo'=>$bidNo,"is_del"=>0])->find();
         $info['bargain'] =$bargain;

+ 1 - 1
app/admin/controller/Sale.php

@@ -3556,7 +3556,7 @@ class Sale extends Base
             ->find();
 
         if (empty($rs)) return error_show(1005, '该出库单不存在或不允许确认收货');
-        else return Db::name('order_out')->field('id')->where(['id' => $rs['id'], 'status' => 2])->update(['status' => 3, 'updatetime' => date('Y-m-d H:i:s')]) ? app_show(0, '收货完成') : error_show(1005, '收货失败');
+        else return Db::name('order_out')->where(['id' => $rs['id'], 'status' => 2])->update(['status' => 3, 'updatetime' => date('Y-m-d H:i:s')]) ? app_show(0, '收货完成') : error_show(1005, '收货失败');
     }
 
 

+ 2 - 5
app/admin/model/ProcessOrder.php

@@ -18,10 +18,6 @@ class ProcessOrder extends \think\Model
             $uid = isset($token['id']) ? $token['id'] : 0;
             $name = isset($token['nickname']) ? $token['nickname'] : '';
         }
-
-       // $conf =Config::get("process");
-        //$action = isset($conf[$order['order_type']]) ? $conf[$order['order_type']]:[];
-
         $data=[
             "order_type"=>$order['order_type'],
             "order_code"=>$order['order_code'],
@@ -34,10 +30,11 @@ class ProcessOrder extends \think\Model
         ];
         OrderMsg::addmsg($data);
         if(self::insert($data)){
-            Workflow::SaveFlow($data);
+         //   Workflow::SaveFlow($data);
         };
     }
     public static function workdel($order){
         Workflow::where(["order_type"=>$order['order_type'],"order_code"=>$order['order_code']])->save(["is_del"=>1,"updatetime"=>date("y-m-d H:i:s")]);
     }
+
 }

+ 32 - 2
app/admin/model/Workflow.php

@@ -63,9 +63,39 @@ class Workflow extends \think\Model
      *
      */
     public  function  Addwait($data){
-        $data=[
+        $conf =self::$conf;
+        $action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[];
+        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){
+                        $index=$key+1;
+                        $wait= is_array($action[$index])? $action[$index][0]:$action[$index];
+                        break;
+                    }
+                }
+            }
+            $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")
+            ];
+
+        }
+
 
-        ];
     }
 
     public function checkStatus(){