Product.php 2.7 KB
Newer Older
R
init  
root 已提交
1 2 3 4 5 6 7 8 9 10
<?php
/**
 * FecShop file.
 * @link http://www.fecshop.com/
 * @copyright Copyright (c) 2016 FecShop Software LLC
 * @license http://www.fecshop.com/license/
 */
return [
	'product' => [
		'class' => 'fecshop\services\Product',
R
root 已提交
11 12 13 14
		/*
		'customAttrGroup' => [
			'dress_group' => [
				'dresses-length' 	=> [
R
fecshop  
root 已提交
15 16 17 18 19 20
					'dbtype' 	=> 'Int',
					'label'=>'裙长',
					'name'=>'dresses-length',
					'display'=>[
						'type' => 'inputString',
						'lang' => true,
R
root 已提交
21
					],
R
fecshop  
root 已提交
22
					'require' => 1,
R
root 已提交
23 24 25
				],
				'style-status'		=> [
					'dbtype' 	=> 'Int',
R
fecshop  
root 已提交
26 27 28 29 30 31 32 33
					'label'=>'分类状态',
					'name'=>'status',
					'display'=>[
						'type' => 'select',
						'data' => [
							1 	=> '激活',
							2 	=> '关闭',
						]
R
root 已提交
34
					],
R
fecshop  
root 已提交
35 36
					'require' => 1,
					'default' => 1,
R
root 已提交
37 38
				],
			],
R
fecshop  
root 已提交
39
			
R
root 已提交
40
			'computer_group' => [
R
fecshop  
root 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
				'memory_capacity' 	=> [
					'dbtype' 	=> 'String',
					'label'=>'Memory Capacity',
					'name'=>'memory_capacity',
					'display'=>[
						'type' => 'inputString',
						'lang' => true,
					],
					'require' => 1,
				],
				'cpu'		=> [
					'dbtype' 	=> 'Int',
					'label'=>'CPU型号',
					'name'=>'cpu',
					'display'=>[
						'type' => 'select',
						'data' => [
							1 	=> 'i3',
							2 	=> 'i5',
							3 	=> 'i7',
						]
					],
					'require' => 1,
					'default' => 1,
				],
R
root 已提交
66 67
			],
			
R
fecshop  
root 已提交
68
			
R
root 已提交
69 70
		],
		*/
R
root 已提交
71
		# 子服务
R
init  
root 已提交
72 73
		'childService' => [
			'image' => [
74 75 76 77 78
				'class' 		=> 'fecshop\services\product\Image',
				'imageFloder' 	=> 'media/catalog/product',
				//'allowImgType' 	=> ['image/jpeg','image/gif','image/png'],
				'maxUploadMSize'=> 5, #MB
			
R
init  
root 已提交
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
			],
			'price' => [
				'class' => 'fecshop\services\product\Price',
			],
			'review' => [
				'class' => 'fecshop\services\product\Review',
			],
			'info' => [
				'class' => 'fecshop\services\product\Info',
			],
			'coll' => [
				'class' => 'fecshop\services\product\Coll',
				//'numPerPage' => 50,	# default 
				//'pageNum' => 1,		# default
				//'orderBy' => ['_id' => SORT_DESC ],  # default
				//'allowMaxPageNum' => 200, # default
			],
			'bestSell' => [
				'class' => 'fecshop\services\product\BestSell',
			],
			'viewLog' => [
				'class' => 'fecshop\services\product\ViewLog',
				'childService' => [
					'session' => [
						'class' => 'fecshop\services\product\viewLog\Session',
					],
					'db'	=>[
						'class' => 'fecshop\services\product\viewLog\Db',
						//'table' => '',  # custom table, you must create this mysql table before you use it.
					],
					'mongodb'	=>[
						'class' => 'fecshop\services\product\viewLog\Mongodb',
						'collection' => '',
					],
				],
				
			],
		],
	],
];