| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 | <?php$system_source = Dever::config('base')->system_source;$mode = Dever::db('goods/info')->config['config_mode'];$shape = Dever::db('goods/info')->config['config_shape'];$platform = Dever::db('goods/info')->config['config_platform'];$confirm = array(	1 => '未确认',	2 => '已确认',);$status = Dever::config('base', 'pay')->pay['status'];$config = array(	# 表名	'name' => 'order',	# 显示给用户看的名称	'lang' => '商品订单',	'order' => 300,	'auto' => 1000000,	# 数据结构 不同的字段放这里	'struct' => array	(		'id' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> 'ID',			'default' 	=> '',			'desc' 		=> '',			'match' 	=> 'is_numeric',			//'list'		=> true,		),		'parent_uid'       => array        (            'type'      => 'int-11',            'name'      => '邀请人',            'default'   => '0',            'desc'      => '请选择用户',            'match'     => 'is_numeric',            //'update'    => 'text',            //'search'  => 'select',            'search'    => array            (                'api' => 'passport/user-all',                'col' => 'username',                'result' => 'id',            ),            'list_name'	=> '订单详情',            'list'		=> 'Dever::load("goods/manage.order", {id})',            //'list'      => '{parent_uid} > 0 ? Dever::load("passport/user-one#username", {parent_uid}) : "无邀请人"',        ),		'uid'       => array        (            'type'      => 'int-11',            'name'      => '购买人',            'default'   => '0',            'desc'      => '请选择用户',            'match'     => 'is_numeric',            //'update'    => 'text',            //'search'  => 'select',            'search'    => array            (                'api' => 'passport/user-all',                'col' => 'username',                'result' => 'id',            ),            //'list'      => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',        ),        'type' 		=> array		(			'type' 		=> 'varchar-32',			'name' 		=> '所属数据源',			'default' 	=> '',			'desc' 		=> '所属数据源',			'match' 	=> 'is_string',			//'list'		=> true,		),				'type_id' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> '数据源id',			'default' 	=> '',			'desc' 		=> '数据源id',			//'match' 	=> 'is_numeric',			//'list'		=> true,		),		'info_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '商品ID',			'default' 	=> '',			'desc' 		=> '商品ID',			'match' 	=> 'is_numeric',			//'update'	=> 'text',			//'list'		=> true,		),		'platform'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '平台',			'default' 	=> '1',			'desc' 		=> '平台',			'match' 	=> 'is_numeric',			'option'	=> $platform,			'search'	=> 'select',		),		'shape'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '形态',			'default' 	=> '1',			'desc' 		=> '形态',			'match' 	=> 'is_numeric',			'option'	=> $shape,			'search'	=> 'select',		),		'sku_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '商品SKUID',			'default' 	=> '',			'desc' 		=> '商品SKUID',			'match' 	=> 'is_numeric',			//'update'	=> 'text',			//'list'		=> true,		),		'order_id'		=> array		(			'type' 		=> 'varchar-100',			'name' 		=> '订单id',			'default' 	=> '',			'desc' 		=> '订单id',			'match' 	=> 'is_string',			'search'	=> 'text',			//'update'	=> 'text',			//'list'		=> true,		),		'name'		=> array		(			'type' 		=> 'varchar-100',			'name' 		=> '商品名称',			'default' 	=> '',			'desc' 		=> '商品名称',			'match' 	=> 'is_string',			'search'	=> 'fulltext',			//'update'	=> 'text',			//'list'		=> true,		),		'cash'		=> array		(			'type' 		=> 'decimal-10,2',			'name' 		=> '价格',			'default' 	=> '',			'desc' 		=> '价格',			'match' 	=> 'option',			//'update'	=> 'text',			//'list'		=> true,		),		'num'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '数量',			'default' 	=> '',			'desc' 		=> '数量',			'match' 	=> 'option',			//'update'	=> 'text',			//'list'		=> true,		),		'mode'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '配送方式',			'default' 	=> '-1',			'desc' 		=> '配送方式',			'match' 	=> 'is_numeric',			'search'	=> 'select',			'option'	=> $mode,		),		'username'		=> array		(			'type' 		=> 'varchar-100',			'name' 		=> '联系人',			'default' 	=> '',			'desc' 		=> '详细地址',			'match' 	=> 'option',			'search'	=> 'fulltext',			//'update'	=> 'text',			//'list'		=> true,		),		'mobile'		=> array		(			'type' 		=> 'varchar-100',			'name' 		=> '联系电话',			'default' 	=> '',			'desc' 		=> '联系电话',			'match' 	=> 'option',			'search'	=> 'fulltext',			//'update'	=> 'text',			//'list'		=> true,		),		'area_id'		=> array		(			'type' 		=> 'varchar-500',			'name' 		=> '地区',			'default' 	=> '',			'desc' 		=> '地区',			'match' 	=> 'is_string',			'search'	=> 'linkage',			//'update'	=> 'linkage',			'option'	=> Dever::url('api.get', 'area'),			//'show'		=> 'mode=1',			//'list'		=> 'Dever::load("area/api.string", "{area_id}")',		),		'address'		=> array		(			'type' 		=> 'varchar-1000',			'name' 		=> '详细地址',			'default' 	=> '',			'desc' 		=> '详细地址',			'match' 	=> 'option',			//'update'	=> 'text',			//'list'		=> true,		),		'store_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '自提点',			'default' 	=> '',			'desc' 		=> '自提点',			'match' 	=> 'option',		),		'confirm'		=> array		(			'type' 		=> 'tinyint-1',			'name' 		=> '确认收货',			'default' 	=> '1',			'desc' 		=> '确认收货',			'match' 	=> 'is_numeric',			'option'	=> $confirm,			'list'		=> true,			'edit'		=> true,		),		'freight_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '运费模板',			'default' 	=> '',			'desc' 		=> '运费模板',			'match' 	=> 'is_string',		),		'freight_price'		=> array		(			'type' 		=> 'decimal-10,2',			'name' 		=> '运费',			'default' 	=> '',			'desc' 		=> '运费',			'match' 	=> 'option',		),		'price'		=> array		(			'type' 		=> 'decimal-10,2',			'name' 		=> '最终付款价格',			'default' 	=> '',			'desc' 		=> '最终付款价格',			'match' 	=> 'option',			'update'	=> 'text',		),		'system_source'     => array        (            'type'      => 'tinyint-1',            'name'      => '所属终端',            'default'   => '1',            'desc'      => '所属终端',            'match'     => 'is_numeric',            'option'    => $system_source,            //'update'    => 'radio',            'search'    => 'select',        ),		'status'		=> array		(			'type' 		=> 'tinyint-1',			'name' 		=> '订单状态',			'default' 	=> '1',			'desc' 		=> '订单状态',			'match' 	=> 'is_numeric',			//'update'	=> 'radio',			'option'	=> $status,			'search'	=> 'select',			'list'      => true,		),		'state'		=> array		(			'type' 		=> 'tinyint-1',			'name' 		=> '数据状态',			'default' 	=> '1',			'desc' 		=> '请选择状态',			'match' 	=> 'is_numeric',		),		'pay_time'       => array        (            'type'      => 'int-11',            'name'      => '付款时间',            'default'   => '',            'desc'      => '付款时间',            'match'     => 'option',            'search'	=> 'date',            'list'      => '"{pay_time}" ? date("Y-m-d H:i:s", {pay_time}) : ""',            //'update'    => 'date',            //'callback'  => 'maketime',        ),		'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 请求接口定义	'request' => array	(		# 分页		'getData' => array		(			# 匹配的正则或函数 选填项			'option' => array			(				'uid' => 'yes',				'type' => 'yes',				'type_id' => 'yes',				'status' => 'yes',				'state' => 1,			),			'type' => 'all',			'order' => array('id' => 'desc'),			'page' => array(10, 'list'),			'col' => '*',		),	),);return $config;
 |