dever 3 年之前
父节点
当前提交
e7c9dd56ba
共有 4 个文件被更改,包括 36 次插入0 次删除
  1. 13 0
      database/address.php
  2. 13 0
      database/invoice.php
  3. 6 0
      src/Address.php
  4. 4 0
      src/Invoice.php

+ 13 - 0
database/address.php

@@ -234,5 +234,18 @@ return array
 			'page' => array(10, 'list'),
 			'col' => '*',
 		),
+
+        'updateType' => array
+        (
+            'set' => array
+            (
+                'type' => 'yes',
+            ),
+            'where' => array
+            (
+                'type' => 'yes',
+            ),
+            'type' => 'update',
+        ),
     ),
 );

+ 13 - 0
database/invoice.php

@@ -208,5 +208,18 @@ return array
             'page' => array(10, 'list'),
             'col' => '*',
         ),
+
+        'updateType' => array
+        (
+            'set' => array
+            (
+                'type' => 'yes',
+            ),
+            'where' => array
+            (
+                'type' => 'yes',
+            ),
+            'type' => 'update',
+        ),
     ),
 );

+ 6 - 0
src/Address.php

@@ -120,6 +120,10 @@ class Address  extends Base
         if ($tag) {
             $update['tag'] = $tag;
         }
+
+        if ($type == 2) {
+            Dever::db('passport/address')->updateType(array('where_type' => 2, 'set_type' => 1));
+        }
         
         if ($id) {
             $update['where_id'] = $id;
@@ -129,6 +133,8 @@ class Address  extends Base
             $id = Dever::db('passport/address')->insert($update);
         }
 
+
+
         return $id;
     }
 }

+ 4 - 0
src/Invoice.php

@@ -113,6 +113,10 @@ class Invoice  extends Base
         if ($bank_number) {
             $update['bank_number'] = $bank_number;
         }
+
+        if ($type == 2) {
+            Dever::db('passport/invoice')->updateType(array('where_type' => 2, 'set_type' => 1));
+        }
         
         if ($id) {
             $update['where_id'] = $id;