Browse Source

提交数据

lvhao 6 months ago
parent
commit
0d62c7a2e7

+ 5 - 0
core/CoreApp/controllers/Returngoods.php

@@ -160,7 +160,12 @@ class Returngoods extends Start_Controller {
                 echo json_encode(array('msg'=>'登记人名字必须填写!请填写','success'=>false));exit;
             }
             $time = date("Y-m-d H:i:s",time());
+            $type = $this->logic_order->getType("number = '".$post['number']."'");
+            if(empty($type)){
+                echo json_encode(array('msg'=>'订单信息存储表单异常','success'=>false));exit;
+            }
             $insert_data  =[
+                'table_type'=>$type,
                 "number"=>$post['number'],
                 "orderinfo"=> $post['orderinfo'],
                 "shopname"=> $post['shopname'],

+ 28 - 0
core/CoreApp/models/Model_logic_order.php

@@ -35,4 +35,32 @@ class Model_logic_order extends Lin_Model {
         return [];
     }
 
+    public function getInfoByType($table_type,$number){
+        if($table_type == 1){
+            $info = $this->fullorder->get_number($number);
+        }
+        if($table_type == 2){
+            $info = $this->fullordertt->get_number($number);
+        }
+        if($table_type == 3){
+            $info = $this->fullordersmt->get_number($number);
+        }
+        return $info; 
+    }
+    public function getType($where){
+        $info =  $this->fullorder->find($where,'id');
+        if(!empty($info)){
+            return 1;
+        }
+        $info =  $this->fullordertt->find($where,'id');
+        if(!empty($info)){
+            return 2;
+        }
+        $info =  $this->fullordersmt->find($where,'id');
+        if(!empty($info)){
+            return 3;
+        }
+        return 0;
+    }
+
 }