| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 | 
							- <?php
 
- # 定义几个常用的选项
 
- $option = array
 
- (
 
- 	1 => '显示',
 
- 	2 => '不显示',
 
- );
 
- $message_type = Dever::db('message/type');
 
- $type = function() use($message_type)
 
- {
 
- 	return $message_type->state();
 
- };
 
- $scope = $message_type->config['config_scope'];
 
- $project = function()
 
- {
 
- 	return Dever::load('message/project-state');
 
- };
 
- return array
 
- (
 
- 	# 表名
 
- 	'name' => 'outbox',
 
- 	# 显示给用户看的名称
 
- 	'lang' => '发件箱',
 
- 	'order' => 19,
 
- 	//'menu'	=> false,
 
- 	'end' => array
 
- 	(
 
- 		'update' => 'message/lib/manage.send',
 
- 		'insert' => 'message/lib/manage.send',
 
- 	),
 
- 	# 数据结构
 
- 	'struct' => array
 
- 	(
 
- 		'id' 		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> 'ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '',
 
- 			'match' 	=> 'is_numeric',
 
- 			'search'	=> 'fulltext',
 
- 			'order'		=> 'desc',
 
- 			'list'		=> true,
 
- 		),
 
- 		'uid'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '发件人',
 
- 			'default' 	=> '-1',
 
- 			'desc' 		=> '请填写发件人',
 
- 			'match' 	=> 'is_numeric',
 
- 			//'update'	=> 'text',
 
- 			'list'		=> '{uid} > 0 ? {uid} : "系统"',
 
- 		),
 
- 		'name'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-30',
 
- 			'name' 		=> '发件标题',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请填写发件标题',
 
- 			'match' 	=> 'is_string',
 
- 			'search'	=> 'fulltext',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		'content'		=> array
 
- 		(
 
- 			'type' 		=> 'text-255',
 
- 			'name' 		=> '发件内容',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请填写发件内容',
 
- 			'match' 	=> 'is_string',
 
- 			'search'	=> 'fulltext',
 
- 			'update'	=> 'textarea',
 
- 			'list'		=> true,
 
- 		),
 
- 		'project_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '所属项目',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '所属项目',
 
- 			'match' 	=> 'is_numeric',
 
- 			'option' 	=> $project,
 
- 			'update'	=> 'select',
 
- 			//'search'	=> 'select',
 
- 			'list'		=> true,
 
- 		),
 
- 		'type'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '消息类型',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '消息类型',
 
- 			'match' 	=> 'is_numeric',
 
- 			'option' 	=> $type,
 
- 			'update'	=> 'select',
 
- 			//'search'	=> 'select',
 
- 			'list'		=> true,
 
- 		),
 
- 		'scope'		=> array
 
- 		(
 
- 			'type' 		=> 'tinyint-1',
 
- 			'name' 		=> '消息范围',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '消息范围',
 
- 			'match' 	=> 'is_numeric',
 
- 			'option' 	=> $scope,
 
- 			'update'	=> 'radio',
 
- 			'search'	=> 'select',
 
- 			'list'		=> true,
 
- 			'control'	=> 'scope',
 
- 		),
 
- 		'param'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-800',
 
- 			'name' 		=> '传入参数-一般为json格式数据',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '传入参数',
 
- 			'match' 	=> 'is_string',
 
- 		),
 
- 		'to_uid'		=> array
 
- 		(
 
- 			'type' 		=> 'text-255',
 
- 			'name' 		=> '收件人-直接填写uid,多个用换行隔开,后期升级',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请填写收件人',
 
- 			'match' 	=> 'is_numeric',
 
- 			'update'	=> 'textarea',
 
- 			'show'		=> 'scope=1',
 
- 		),
 
- 		'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
 
- 	(
 
- 		
 
- 	),
 
- 	
 
- 	# request 请求接口定义
 
- 	'request' => array
 
- 	(
 
- 		
 
- 	),
 
- );
 
 
  |