| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 | 
							- <?php
 
- /**
 
-  * user
 
-  */
 
-  
 
- # 定义几个常用的选项
 
- $option = array
 
- (
 
- 	1 => '开启',
 
- 	2 => '关闭',
 
- );
 
- $type = array
 
- (
 
- 	1 => '文字',
 
- 	2 => '外链图文',
 
- 	3 => '内链图文',
 
- 	4 => '语音',
 
- 	5 => '视频',
 
- 	6 => '图片',
 
- 	//7 => '音乐',
 
- 	//11 => '站内文章',
 
- );
 
- # 增加站内文章
 
- $thead = function()
 
- {
 
- };
 
- # 是否临时消息
 
- $temp = array
 
- (
 
- 	1 => '临时',
 
- 	2 => '永久',
 
- );
 
- return array
 
- (
 
- 	# 表名
 
- 	'name' => 'content',
 
- 	# 显示给用户看的名称
 
- 	'lang' => '消息内容管理',
 
- 	'desc' => '管理群发消息和关键词自动回复消息,群发消息时可以选择此处的消息',
 
- 	'order' => 19,
 
- 	'end' => array
 
- 	(
 
- 		# 新增素材到微信
 
- 		'insert' => 'weixin/media.update',
 
- 		# 新增素材到微信
 
- 		'update' => 'weixin/media.update',
 
- 	),
 
- 	# 数据结构
 
- 	'struct' => array
 
- 	(
 
- 		'id' 		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> 'ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '',
 
- 			'match' 	=> 'is_numeric',
 
- 			'search'	=> 'order',
 
- 			'list'		=> true,
 
- 		),
 
- 		'site'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '站点',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入站点',
 
- 			'match' 	=> 'is_numeric',
 
- 		),
 
- 		
 
- 		'name'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-32',
 
- 			'name' 		=> '消息名',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入消息名',
 
- 			'match' 	=> 'is_string',
 
- 			'search'	=> 'fulltext',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		
 
- 		'type'		=> array
 
- 		(
 
- 			'type' 		=> 'tinyint-3',
 
- 			'name' 		=> '类型',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '请选择类型',
 
- 			'match' 	=> 'is_numeric',
 
- 			'option' 	=> $type,
 
- 			'update'	=> 'radio',
 
- 			'list'		=> true,
 
- 			# 开启显示控制,可以控制下边的表单
 
- 			'show'		=> 'type',
 
- 		),
 
- 		
 
- 		'temp'		=> array
 
- 		(
 
- 			'type' 		=> 'tinyint-1',
 
- 			'name' 		=> '是否临时素材(临时素材只保留三天,永久素材有一定的上限:图文5000、其他1000)',
 
- 			'default' 	=> '2',
 
- 			'desc' 		=> '请选择是否临时素材',
 
- 			'match' 	=> 'is_numeric',
 
- 			'option' 	=> $temp,
 
- 			'update'	=> 'radio',
 
- 			//'list'		=> true,
 
- 		),
 
- 		
 
- 		'keywords'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-255',
 
- 			'name' 		=> '关键词(选填,多个关键字换行隔开,如填写则根据关键词给关注用户发送相关消息)',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入关键词',
 
- 			'match' 	=> 'option',
 
- 			'search'	=> 'order,fulltext',
 
- 			'update'	=> 'textarea',
 
- 			//'list'		=> true,
 
- 			//'modal'		=> '查看详情',
 
- 			'show'		=> array('type_1', 'type_2', 'type_4', 'type_5', 'type_6', 'type_7'),
 
- 		),
 
- 		
 
- 		'title'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-50',
 
- 			'name' 		=> '标题',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入标题',
 
- 			'match' 	=> 'is_string',
 
- 			'search'	=> 'fulltext',
 
- 			'update'	=> 'text',
 
- 			//'list'		=> true,
 
- 			'show'		=> array('type_5', 'type_7'),
 
- 		),
 
- 		
 
- 		'music_url'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-150',
 
- 			'name' 		=> '普通音乐链接',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入普通音乐链接',
 
- 			'match' 	=> 'is_string',
 
- 			'search'	=> 'fulltext',
 
- 			'update'	=> 'text',
 
- 			'show'		=> array('type_7'),
 
- 		),
 
- 		
 
- 		'music_hq_url'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-150',
 
- 			'name' 		=> '高质量音乐链接(wifi环境使用)',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入高质量音乐链接',
 
- 			'match' 	=> 'is_string',
 
- 			'search'	=> 'fulltext',
 
- 			'update'	=> 'text',
 
- 			'show'		=> array('type_7'),
 
- 		),
 
- 		
 
- 		'pic'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-150',
 
- 			'name' 		=> '图片(大小限制:1M)',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请上传图片',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'image',
 
- 			'key' 		=> '1',
 
- 			'place'		=> '500',
 
- 			'show'		=> array('type_6', 'type_7'),
 
- 		),
 
- 		'mp3'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-150',
 
- 			'name' 		=> '语音(支持mp3等语音格式,大小限制:2M)',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请上传语音',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'image',
 
- 			'key' 		=> '1',
 
- 			'show'		=> array('type_4'),
 
- 		),
 
- 		'mp4'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-150',
 
- 			'name' 		=> '视频(限制大小:10MB)',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请上传视频',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'image',
 
- 			'key' 		=> '1',
 
- 			'show'		=> array('type_5'),
 
- 		),
 
- 		
 
- 		'text'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-150',
 
- 			'name' 		=> '回复文字',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入回复文字',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'textarea',
 
- 			//'list'		=> true,
 
- 			'show'		=> array('type_1'),
 
- 		),
 
- 		
 
- 		'info'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-150',
 
- 			'name' 		=> '简介',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入简介',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'textarea',
 
- 			//'list'		=> true,
 
- 			'show'		=> array('type_5', 'type_7'),
 
- 		),
 
- 		
 
- 		'content_2'		=> array
 
- 		(
 
- 			'type' 		=> 'text-255',
 
- 			'name' 		=> '外链图文',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入外链图文',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> array
 
- 			(
 
- 				array
 
- 				(
 
- 					'col'		=> 'title',
 
- 					'name' 		=> '标题',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请输入标题',
 
- 					'match' 	=> 'is_string',
 
- 					'update'	=> 'text',
 
- 				),
 
- 				array
 
- 				(
 
- 					'col'		=> 'pic',
 
- 					'name' 		=> '封面图(支持JPG、PNG格式,第1条请传大图720*400,其余请传小图400*400)',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请上传封面',
 
- 					'match' 	=> 'is_string',
 
- 					'update'	=> 'image',
 
- 					'key' 		=> '1',
 
- 					'place'		=> '720',
 
- 				),
 
- 				array
 
- 				(
 
- 					'col'		=> 'link',
 
- 					'name' 		=> '原文链接',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请输入原文链接',
 
- 					'match' 	=> 'is_string',
 
- 					'update'	=> 'text',
 
- 				),
 
- 				
 
- 				array
 
- 				(
 
- 					'col' 		=> 'info',
 
- 					'name' 		=> '摘要',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请输入摘要',
 
- 					'match' 	=> 'is_string',
 
- 					'update'	=> 'textarea',
 
- 				),
 
- 			),
 
- 			'show'		=> array('type_2'),
 
- 		),
 
- 		
 
- 		'content_3'		=> array
 
- 		(
 
- 			'type' 		=> 'text-255',
 
- 			'name' 		=> '内链图文',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入多图文',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> array
 
- 			(
 
- 				array
 
- 				(
 
- 					'col'		=> 'title',
 
- 					'name' 		=> '标题',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请输入标题',
 
- 					'match' 	=> 'is_string',
 
- 					'update'	=> 'text',
 
- 				),
 
- 				array
 
- 				(
 
- 					'col'		=> 'pic',
 
- 					'name' 		=> '封面图(支持JPG、PNG格式,第1条请传大图720*400,其余请传小图400*400)',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请上传封面',
 
- 					'match' 	=> 'is_string',
 
- 					'update'	=> 'image',
 
- 					'key' 		=> '1',
 
- 					'place'		=> '720',
 
- 				),
 
- 				array
 
- 				(
 
- 					'col'		=> 'desc',
 
- 					'name' 		=> '正文(选填)',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请输入正文',
 
- 					'match' 	=> 'is_string',
 
- 					'update'	=> 'editor',
 
- 				),
 
- 				
 
- 				array
 
- 				(
 
- 					'col'		=> 'link',
 
- 					'name' 		=> '原文链接(选填)',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请输入原文链接',
 
- 					'match' 	=> 'is_string',
 
- 					'update'	=> 'text',
 
- 				),
 
- 				array
 
- 				(
 
- 					'col'		=> 'author',
 
- 					'name' 		=> '作者(选填)',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请输入作者',
 
- 					'match' 	=> 'option',
 
- 					'update'	=> 'text',
 
- 				),
 
- 				
 
- 				array
 
- 				(
 
- 					'col' 		=> 'info',
 
- 					'name' 		=> '摘要(选填)',
 
- 					'default' 	=> '',
 
- 					'desc' 		=> '请输入摘要',
 
- 					'match' 	=> 'is_string',
 
- 					'update'	=> 'textarea',
 
- 				),
 
- 			),
 
- 			'show'		=> array('type_3'),
 
- 		),
 
- 		'state'		=> array
 
- 		(
 
- 			'type' 		=> 'tinyint-1',
 
- 			'name' 		=> '状态',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '请选择状态',
 
- 			'match' 	=> array('is_numeric', 1),
 
- 			'option' 	=> $option,
 
- 			//'update'	=> 'radio',
 
- 			'list'		=> true,
 
- 		),
 
- 		
 
- 		'cdate'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '录入时间',
 
- 			'match' 	=> array('is_numeric', time()),
 
- 			'desc' 		=> '',
 
- 			# 只有insert时才生效
 
- 			'insert'	=> true,
 
- 		),
 
- 	),
 
- 	
 
- 	# 更新表结构
 
- 	'alter' => array
 
- 	(
 
- 		1 => array
 
- 		(
 
- 			array('add', 'text', 'text', 'varchar-150  回复文字'),
 
- 		),
 
- 		'version' => 1,
 
- 	),
 
- 	
 
- 	'manage' => array
 
- 	(
 
- 		'desc' => '外链图文:无需输入正文内容,一般为直接链接到站内的某个文章,不会发布到微信公众平台<br />内链图文:必须输入正文内容,直接发布到微信公众平台。正文内容请严格遵守微信正文发布规则。<br />其余内容除文字外,均会将素材传到微信公众平台。请确认您的可上传素材上限足够使用。本系统会为您保留所有素材。同时,每次更新都会将素材传到微信公众平台。<br />请到本系统的素材管理中查看您上传的所有素材,以确认素材是否可以删除。',
 
- 	),
 
- 	'auth' => 'site',
 
- 	
 
- 	# request 请求接口定义
 
- 	'request' => array
 
- 	(
 
- 		'main' => array
 
- 		(
 
- 			'where' => array
 
- 			(
 
- 				'state' => 1,
 
- 				'site' => 'yes',
 
- 			),
 
- 			'type' => 'all',
 
- 			'order' => array('id', 'desc'),
 
- 			'col' => 'name,id|id',
 
- 		),
 
- 		
 
- 		'all' => array
 
- 		(
 
- 			'where' => array
 
- 			(
 
- 				'state' => 1,
 
- 				'site' => 'yes',
 
- 			),
 
- 			'type' => 'all',
 
- 			'order' => array('id', 'desc'),
 
- 			'col' => '*|id',
 
- 		),
 
- 		
 
- 		# 获取订阅消息
 
- 		'get_1' => array
 
- 		(
 
- 			'where' => array
 
- 			(
 
- 				'state' => 1,
 
- 				'site' => 'yes',
 
- 				'type' => array('2', '!='),
 
- 			),
 
- 			'type' => 'all',
 
- 			'order' => array('id', 'desc'),
 
- 			'col' => '*|id',
 
- 		),
 
- 		
 
- 		# 获取客服消息
 
- 		'get_2' => array
 
- 		(
 
- 			'where' => array
 
- 			(
 
- 				'state' => 1,
 
- 				'site' => 'yes',
 
- 				'type' => array('3', '!='),
 
- 			),
 
- 			'type' => 'all',
 
- 			'order' => array('id', 'desc'),
 
- 			'col' => '*|id',
 
- 			//'col' => 'id,concat("消息#",id) as name|id',
 
- 		),
 
- 	),
 
- );
 
 
  |