| 
					
				 | 
			
			
				@@ -0,0 +1,215 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<?php
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+$level = function()
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+{
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	$array = array();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	$info = Dever::db('score/level')->state();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if($info)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	{
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		$array += $info;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	return $array;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+};
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+$type_id = function()
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+{
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $array = array();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $info = Dever::db('score/level_type')->state();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if($info)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $array += $info;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return $array;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+};
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+$status = array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    1 => '收入',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    2 => '支出',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# 手动升级时,如果需要用户手动来触发升级则需要本表
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+return array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	# 表名
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	'name' => 'level_log',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	# 显示给用户看的名称
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	'lang' => '用户等级请求日志',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	'order' => 10,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	'menu' => false,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	# 数据结构
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	'struct' => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'id' 		=> array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'type' 		=> 'int-11',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'name' 		=> 'ID',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'default' 	=> '',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'desc' 		=> '',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'match' 	=> 'is_numeric',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'uid'		=> array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'type' 		=> 'int-11',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'name' 		=> '用户名',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'default' 	=> '0',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'desc' 		=> '请选择用户',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'match' 	=> 'is_numeric',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			//'update'	=> 'select',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			//'search'	=> 'select',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'search'    => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            (
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                'api' => 'passport/user-all',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                'col' => 'username',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                'result' => 'id',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'list'		=> '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'level_type_id'       => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'type'      => 'int-11',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'name'      => '等级类别',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'default'   => '1',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'desc'      => '等级类别',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'match'     => 'is_numeric',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'update'    => 'select',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'option'    => $type_id,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'search'    => 'select',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'list'        => true,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'level_id'		=> array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'type' 		=> 'int-11',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'name' 		=> '等级名称',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'default' 	=> '1',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'desc' 		=> '等级名称',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'match' 	=> 'is_numeric',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'update'	=> 'select',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'option'	=> $level,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'search'	=> 'select',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'list'		=> true,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'edit'		=> true,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'status'        => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'type'      => 'tinyint-1',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'name'      => '收入支出状态',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'default'   => '1',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'desc'      => '收入支出状态',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'match'     => 'is_numeric',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'update'    => 'select',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'option'    => $status,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //'search'  => 'select',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'list'      => true,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //'edit'        => true,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'num'		=> array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'type' 		=> 'varchar-80',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'name' 		=> '增加积分数-如果为负数,则是减少积分',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'default' 	=> '',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'desc' 		=> '增加积分数',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'match' 	=> 'option',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'update'	=> 'textarea',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'list'		=> true,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'total'		=> array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'type' 		=> 'varchar-80',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'name' 		=> '总积分数',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'default' 	=> '',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'desc' 		=> '总积分数',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'match' 	=> 'option',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'update'	=> 'textarea',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'list'		=> true,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'desc'     => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'type'      => 'varchar-300',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'name'      => '描述',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'default'   => '',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'desc'      => '描述',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'match'     => 'option',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'update'    => 'textarea',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '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})',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	'manage' => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'delete' => false,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'edit' => false,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'insert' => false,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		# 列表
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'list_button' => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			//'list' => array('行为日志', '"action_log&search_option_action_id={action_id}&search_option_uid={uid}&oper_parent=user_log"'),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	# request 请求接口定义
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	'request' => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'getNew' => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			# 匹配的正则或函数 选填项
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'option' => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'config_id' => 'yes',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'action_id' => 'yes',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'uid' => 'yes',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'status' => 'yes',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'state' => 1,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'type' => 'one',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'order' => array('cdate' => 'desc'),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'col' => '*',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		'getNewTotal' => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			# 匹配的正则或函数 选填项
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'option' => array
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'config_id' => 'yes',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'action_id' => 'yes',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'uid' => 'yes',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'status' => 'yes',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'state' => 1,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'start' => array('yes-cdate', '>='),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				'end' => array('yes-cdate', '<='),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'type' => 'count',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'order' => array('cdate' => 'desc'),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			'col' => 'count(1) as total',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		),
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+);
 
			 |