Skip to content

Commit cdcfb44

Browse files
添加注释和README文件
1 parent bfe39f4 commit cdcfb44

21 files changed

+165
-43
lines changed

app/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fecshop的应用部分
2+
3+
各个入口的模块,配置,模板等都在这里面
4+
5+
详情可以打开各个入口包查看相应的功能

components/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fecshop 自定义的组件部分

config/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FECSHOP配置部分
2+
==============
3+
4+
compoents 是组件部分的配置
5+
6+
services是服务部分的配置
7+
8+
xunsearch是xunsearch搜索引擎部分的配置

interfaces/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fecshop 接口定义部分

lib/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
第三方库

migrations/README.md

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
1-
### 1. 生成迁移文件的命令:
21

3-
1.1 生成mysql文件:
2+
这里是执行的命令,在安装fecshop的时候,文档里面已经
3+
写好了migrate的命令,您不需要再次执行下面的操作。
4+
5+
### 1. 生成迁移文件的命令:
6+
7+
1.1 生成mysql文件:
48

59
```
610
./yii migrate/create --migrationPath=@fecshop/migrations/mysqldb fecshop_tables
711
```
812

9-
1.2 生成mongodb文件:
13+
1.2 生成mongodb文件:
1014

1115
```
1216
./yii mongodb-migrate/create --migrationPath=@fecshop/migrations/mongodb fecshop_tables
1317
```
1418

1519

16-
### 2. 迁移的命令(导入数据库表)
20+
### 2. 迁移的命令(导入数据库表)
1721

18-
2.1 mysql(导入mysql的表,数据,索引):
22+
2.1 mysql(导入mysql的表,数据,索引):
1923

2024
```
2125
./yii migrate --interactive=0 --migrationPath=@fecshop/migrations/mysqldb
2226
```
2327

2428

25-
2.2 mongodb(导入mongodb的表,数据,索引):
29+
2.2 mongodb(导入mongodb的表,数据,索引):
2630

2731
```
2832
./yii mongodb-migrate --interactive=0 --migrationPath=@fecshop/migrations/mongodb
2933
```
3034

31-
2.2.2 mongodb的示例数据存放路径为:
35+
2.2.2 mongodb的示例数据存放路径为:
3236

3337
/vendor/fancyecommerce/fecshop/migrations/mongodb-example-data/example_data.js
3438

35-
可以通过mongodb的后台,或者通过php的rockmongo安装这些mongodb中的示例数据。
39+
可以通过mongodb的后台,或者通过php的rockmongo安装这些mongodb中的示例数据。
3640

3741

3842

models/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
数据库的model部分

models/mongodb/Category.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
1717
*/
1818
class Category extends ActiveRecord
1919
{
20+
/**
21+
* mongodb collection 的名字,相当于mysql的table name
22+
*/
2023
public static function collectionName()
2124
{
2225
return 'category';
2326
}
24-
27+
/**
28+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
29+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
30+
*/
2531
public function attributes()
2632
{
2733
return [

models/mongodb/FecshopServiceLog.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
1717
*/
1818
class FecshopServiceLog extends ActiveRecord
1919
{
20+
/**
21+
* mongodb collection 的名字,相当于mysql的table name
22+
*/
2023
public static function collectionName()
2124
{
2225
return 'fecshop_service_log';
2326
}
24-
27+
/**
28+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
29+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
30+
*/
2531
public function attributes()
2632
{
2733
return [

models/mongodb/Product.php

+11-5
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ class Product extends ActiveRecord
2020
public static $_customProductAttrs;
2121

2222
/**
23-
* 需要做的索引 [sku],[spu],
24-
* [category_id,score],[category_id,created_at]
25-
* [category_id,price].
23+
* mongodb collection 的名字,相当于mysql的table name
2624
*/
2725
public static function collectionName()
2826
{
@@ -36,7 +34,10 @@ public static function addCustomProductAttrs($attrs)
3634
{
3735
self::$_customProductAttrs = $attrs;
3836
}
39-
37+
/**
38+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
39+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
40+
*/
4041
public function attributes()
4142
{
4243
$origin = [
@@ -96,7 +97,12 @@ public function attributes()
9697

9798
return $origin;
9899
}
99-
100+
/**
101+
* 给model对应的表创建索引的方法
102+
* 在indexs数组中填写索引,如果有多个索引,可以填写多行
103+
* 在migrate的时候会运行创建索引,譬如:
104+
* @fecshop/migrations/mongodb/m170228_072455_fecshop_tables
105+
*/
100106
public static function create_index()
101107
{
102108
$indexs = [

models/mongodb/Search.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class Search extends ActiveRecord
2323
*/
2424
public static $_lang;
2525
public static $_filterColumns;
26-
26+
/**
27+
* mongodb collection 的名字,相当于mysql的table name
28+
*/
2729
public static function collectionName()
2830
{
2931
if (self::$_lang) {
@@ -33,7 +35,10 @@ public static function collectionName()
3335
return 'full_search_product_no_lang';
3436
}
3537
}
36-
38+
/**
39+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
40+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
41+
*/
3742
public function attributes()
3843
{
3944
$origin = [

models/mongodb/cms/Article.php

+13-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
1717
*/
1818
class Article extends ActiveRecord
1919
{
20+
/**
21+
* mongodb collection 的名字,相当于mysql的table name
22+
*/
2023
public static function collectionName()
2124
{
2225
return 'article';
2326
}
24-
27+
/**
28+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
29+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
30+
*/
2531
public function attributes()
2632
{
2733
return [
@@ -38,7 +44,12 @@ public function attributes()
3844

3945
];
4046
}
41-
47+
/**
48+
* 给model对应的表创建索引的方法
49+
* 在indexs数组中填写索引,如果有多个索引,可以填写多行
50+
* 在migrate的时候会运行创建索引,譬如:
51+
* @fecshop/migrations/mongodb/m170228_072455_fecshop_tables
52+
*/
4253
public static function create_index()
4354
{
4455
$indexs = [

models/mongodb/cms/StaticBlock.php

+13-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
1717
*/
1818
class StaticBlock extends ActiveRecord
1919
{
20+
/**
21+
* mongodb collection 的名字,相当于mysql的table name
22+
*/
2023
public static function collectionName()
2124
{
2225
return 'static_block';
2326
}
24-
27+
/**
28+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
29+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
30+
*/
2531
public function attributes()
2632
{
2733
return [
@@ -35,7 +41,12 @@ public function attributes()
3541
'created_user_id',
3642
];
3743
}
38-
44+
/**
45+
* 给model对应的表创建索引的方法
46+
* 在indexs数组中填写索引,如果有多个索引,可以填写多行
47+
* 在migrate的时候会运行创建索引,譬如:
48+
* @fecshop/migrations/mongodb/m170228_072455_fecshop_tables
49+
*/
3950
public static function create_index()
4051
{
4152
$indexs = [

models/mongodb/customer/Newsletter.php

+13-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ class Newsletter extends ActiveRecord
1919
{
2020
const ENABLE_STATUS = 1;
2121
const DISABLE_STATUS = 10;
22-
22+
/**
23+
* mongodb collection 的名字,相当于mysql的table name
24+
*/
2325
public static function collectionName()
2426
{
2527
return 'newsletter';
2628
}
27-
29+
/**
30+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
31+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
32+
*/
2833
public function attributes()
2934
{
3035
return [
@@ -40,7 +45,12 @@ public static function primaryKey()
4045
{
4146
return '_id';
4247
}
43-
48+
/**
49+
* 给model对应的表创建索引的方法
50+
* 在indexs数组中填写索引,如果有多个索引,可以填写多行
51+
* 在migrate的时候会运行创建索引,譬如:
52+
* @fecshop/migrations/mongodb/m170228_072455_fecshop_tables
53+
*/
4454
public static function create_index()
4555
{
4656
$indexs = [

models/mongodb/product/Favorite.php

+13-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
1717
*/
1818
class Favorite extends ActiveRecord
1919
{
20+
/**
21+
* mongodb collection 的名字,相当于mysql的table name
22+
*/
2023
public static function collectionName()
2124
{
2225
return 'favorite';
2326
}
24-
27+
/**
28+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
29+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
30+
*/
2531
public function attributes()
2632
{
2733
$origin = [
@@ -35,7 +41,12 @@ public function attributes()
3541

3642
return $origin;
3743
}
38-
44+
/**
45+
* 给model对应的表创建索引的方法
46+
* 在indexs数组中填写索引,如果有多个索引,可以填写多行
47+
* 在migrate的时候会运行创建索引,譬如:
48+
* @fecshop/migrations/mongodb/m170228_072455_fecshop_tables
49+
*/
3950
public static function create_index()
4051
{
4152
$indexs = [

models/mongodb/product/Review.php

+13-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ class Review extends ActiveRecord
2424
const ACTIVE_STATUS = 1;
2525
// 审核拒绝的状态
2626
const REFUSE_STATUS = 2;
27-
27+
/**
28+
* mongodb collection 的名字,相当于mysql的table name
29+
*/
2830
public static function collectionName()
2931
{
3032
return 'review';
@@ -35,7 +37,10 @@ public static function addCustomAttrs($attrs)
3537
{
3638
self::$_customAttrs = $attrs;
3739
}
38-
40+
/**
41+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
42+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
43+
*/
3944
public function attributes($origin = false)
4045
{
4146
$origin = [
@@ -65,7 +70,12 @@ public function attributes($origin = false)
6570

6671
return $origin;
6772
}
68-
73+
/**
74+
* 给model对应的表创建索引的方法
75+
* 在indexs数组中填写索引,如果有多个索引,可以填写多行
76+
* 在migrate的时候会运行创建索引,譬如:
77+
* @fecshop/migrations/mongodb/m170228_072455_fecshop_tables
78+
*/
6979
public static function create_index()
7080
{
7181
$indexs = [

models/mongodb/product/ViewLog.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
class ViewLog extends ActiveRecord
1919
{
2020
public static $_collectionName;
21-
21+
/**
22+
* mongodb collection 的名字,相当于mysql的table name
23+
*/
2224
public static function collectionName()
2325
{
2426
return self::$_collectionName;
@@ -28,7 +30,10 @@ public static function setCurrentCollectionName($name)
2830
{
2931
self::$_collectionName = $name;
3032
}
31-
33+
/**
34+
* mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
35+
* 因此,需要自己定义model的属性,下面的方法就是这个作用
36+
*/
3237
public function attributes()
3338
{
3439
return [

0 commit comments

Comments
 (0)