dever 6 vuotta sitten
vanhempi
commit
8685ecfd39
2 muutettua tiedostoa jossa 75 lisäystä ja 2 poistoa
  1. 69 0
      database/combine.php
  2. 6 2
      lib/Base.php

+ 69 - 0
database/combine.php

@@ -0,0 +1,69 @@
+<?php
+
+return array
+(
+	# 表名
+	'name' => 'combine',
+	# 显示给用户看的名称
+	'lang' => '合并管理',
+	# 后台菜单排序
+	'order' => 1,
+	'menu'	=> false,
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'search'	=> 'order',
+			'list'		=> true,
+			'order'		=> 'desc',
+		),
+		
+		'old_uid'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '旧的uid',
+			'default' 	=> '',
+			'desc' 		=> '旧的uid',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'text',
+			'list'		=> true,
+		),
+		
+		'new_uid'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '新的uid',
+			'default' 	=> '',
+			'desc' 		=> '新的uid',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'text',
+			'list'		=> true,
+		),
+
+		'state'		=> array
+		(
+			'type' 		=> 'tinyint-1',
+			'name' 		=> '状态',
+			'default' 	=> '1',
+			'desc' 		=> '请选择状态',
+			'match' 	=> 'is_numeric',
+		),
+		
+		'cdate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '录入时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+			# 只有insert时才生效
+			'insert'	=> true,
+			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
+		),
+	),
+);

+ 6 - 2
lib/Base.php

@@ -102,6 +102,12 @@ class Base
             }
             if ($drop) {
                 foreach ($drop as $k => $v) {
+                    $insert['new_uid'] = $cur;
+                    $insert['old_uid'] = $v;
+                    $info = Dever::db('passport/combine')->one($insert);
+                    if (!$info) {
+                        Dever::db('passport/combine')->insert($insert);
+                    }
                     Dever::load('passport/user-update', array('set_state' => 2, 'where_id' => $v));
                 }
                 $combine = Dever::project('combine');
@@ -113,8 +119,6 @@ class Base
             }
         }
 
-        echo 11;die;
-
         return $cur;
     }