| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 | 
							- <?php
 
- $status = array
 
- (
 
- 	1 => '进行中',
 
- 	2 => '已提交报告',
 
- 	3 => '已完成一次报告',
 
- 	4 => '已完成',
 
- 	9 => '冻结',
 
- );
 
- $company = function()
 
- {
 
- 	$array = array();
 
- 	$info = Dever::load('task/company-state');
 
- 	if($info)
 
- 	{
 
- 		$array += $info;
 
- 	}
 
- 	return $array;
 
- };
 
- $cate = function()
 
- {
 
- 	$array = array();
 
- 	$info = Dever::load('task/cate-state');
 
- 	if($info)
 
- 	{
 
- 		$array += $info;
 
- 	}
 
- 	return $array;
 
- };
 
- $level = function()
 
- {
 
- 	$array = array();
 
- 	$info = Dever::load('task/level-state');
 
- 	if($info)
 
- 	{
 
- 		$array += $info;
 
- 	}
 
- 	return $array;
 
- };
 
- return array
 
- (
 
- 	# 表名
 
- 	'name' => 'user_task',
 
- 	# 显示给用户看的名称
 
- 	'lang' => '用户任务',
 
- 	'menu' => 'passport',
 
- 	'order' => 100,
 
- 	# 数据结构
 
- 	'struct' => array
 
- 	(
 
- 		'id' 		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> 'ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '',
 
- 			'match' 	=> 'is_numeric',
 
- 			//'search'	=> 'order',
 
- 			'order'		=> 'desc',
 
- 			'list'		=> true,
 
- 		),
 
- 		'uid'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '用户名',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '用户名',
 
- 			'match' 	=> 'is_numeric',
 
- 			//'update'	=> 'text',
 
- 			'search'	=> array
 
- 			(
 
- 				'api' => 'passport/user-all',
 
- 				'col' => 'username',
 
- 				'result' => 'id',
 
- 			),
 
- 			'list'		=> 'Dever::load("passport/user-one#username", {uid})',
 
- 		),
 
- 		'task_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '任务名',
 
- 			'default' 	=> '-1',
 
- 			'desc' 		=> '任务名',
 
- 			'match' 	=> 'is_numeric',
 
- 			//'update'	=> 'select',
 
- 			'search'	=> array
 
- 			(
 
- 				'api' => 'task/info-all',
 
- 				'col' => 'name',
 
- 				'result' => 'id',
 
- 			),
 
- 			'list'		=> '{task_id} > 0 ? Dever::load("task/info-one#name", {task_id}) : "系统"',
 
- 		),
 
- 		'company_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '商家',
 
- 			'default' 	=> '-1',
 
- 			'desc' 		=> '商家',
 
- 			'match' 	=> 'is_numeric',
 
- 			//'update'	=> 'select',
 
- 			'search'	=> 'select',
 
- 			'option'	=> $company,
 
- 			'list'		=> true,
 
- 		),
 
- 		'cate_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '类别',
 
- 			'default' 	=> '-1',
 
- 			'desc' 		=> '类别',
 
- 			'match' 	=> 'is_numeric',
 
- 			//'update'	=> 'select',
 
- 			'search'	=> 'select',
 
- 			'option'	=> $cate,
 
- 			'list'		=> true,
 
- 		),
 
- 		'level_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '等级',
 
- 			'default' 	=> '-1',
 
- 			'desc' 		=> '等级',
 
- 			'match' 	=> 'is_numeric',
 
- 			//'update'	=> 'select',
 
- 			'search'	=> 'select',
 
- 			'option'	=> $level,
 
- 			'list'		=> true,
 
- 		),
 
- 		'status'		=> array
 
- 		(
 
- 			'type' 		=> 'tinyint-1',
 
- 			'name' 		=> '状态',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '状态',
 
- 			'match' 	=> 'is_numeric',
 
- 			'update'	=> 'select',
 
- 			'option'	=> $status,
 
- 			//'search'	=> 'select',
 
- 			//'list'		=> true,
 
- 			//'edit'		=> 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,
 
- 			'search'	=> 'date',
 
- 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 
- 		),
 
- 	),
 
- 	
 
- 	'manage' => array
 
- 	(
 
- 		'insert' => false,
 
- 		'edit' => false,
 
- 		'delete' => false,
 
- 	),
 
- 	'request' => array
 
- 	(
 
- 		'getAll' => array
 
- 		(
 
- 			'where' => array
 
- 			(
 
- 				'uid' => 'yes',
 
- 				'state' => 1,
 
- 				'status' => 'yes-t_2.status',
 
- 			),
 
- 			'join' => array
 
- 			(
 
- 				array
 
- 				(
 
- 					'table' => 'task/info',
 
- 					'type' => 'left join',
 
- 					'on' => array('task_id','id'),
 
- 					'col' => 't_2.id as id',
 
- 				),
 
- 			),
 
- 			'type' => 'all',
 
- 			'page' => array(15, 'list'),
 
- 			'order' => array('t_2.reorder' => 'desc', 't_2.edate' => 'asc'),
 
- 			'col' => 'id,t_2.*,t_1.uid',
 
- 		),
 
- 	)
 
- );
 
 
  |