Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
4bb5b730
Y
yii2_fecshop
项目概览
OpenDocCN
/
yii2_fecshop
通知
18
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yii2_fecshop
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4bb5b730
编写于
7月 18, 2019
作者:
T
Terry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
产品收藏,各个入口的调整
上级
731a9cb6
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
36 addition
and
14 deletion
+36
-14
app/appadmin/modules/Catalog/block/productreview/Index.php
app/appadmin/modules/Catalog/block/productreview/Index.php
+2
-2
app/appfront/modules/Customer/block/productfavorite/Index.php
...appfront/modules/Customer/block/productfavorite/Index.php
+10
-4
app/apphtml5/modules/Customer/block/productfavorite/Index.php
...apphtml5/modules/Customer/block/productfavorite/Index.php
+24
-8
未找到文件。
app/appadmin/modules/Catalog/block/productreview/Index.php
浏览文件 @
4bb5b730
...
@@ -122,10 +122,10 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
...
@@ -122,10 +122,10 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
$activeStatus
=
Yii
::
$service
->
product
->
review
->
activeStatus
();
$activeStatus
=
Yii
::
$service
->
product
->
review
->
activeStatus
();
$refuseStatus
=
Yii
::
$service
->
product
->
review
->
refuseStatus
();
$refuseStatus
=
Yii
::
$service
->
product
->
review
->
refuseStatus
();
$noActiveStatus
=
Yii
::
$service
->
product
->
review
->
noActiveStatus
();
$noActiveStatus
=
Yii
::
$service
->
product
->
review
->
noActiveStatus
();
$reviewPrimaryKey
=
Yii
::
$service
->
product
->
review
->
getPrimaryKey
();
$table_th_bar
=
[
$table_th_bar
=
[
[
[
'orderField'
=>
'_id'
,
'orderField'
=>
$reviewPrimaryKey
,
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Id'
),
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Id'
),
'width'
=>
'50'
,
'width'
=>
'50'
,
'align'
=>
'left'
,
'align'
=>
'left'
,
...
...
app/appfront/modules/Customer/block/productfavorite/Index.php
浏览文件 @
4bb5b730
...
@@ -52,6 +52,7 @@ class Index
...
@@ -52,6 +52,7 @@ class Index
$pageToolBar
=
$this
->
getProductPage
(
$count
);
$pageToolBar
=
$this
->
getProductPage
(
$count
);
$product_arr
=
$this
->
getProductInfo
(
$coll
);
$product_arr
=
$this
->
getProductInfo
(
$coll
);
$this
->
breadcrumbs
(
Yii
::
$service
->
page
->
translate
->
__
(
'Customer Product Favorite'
));
$this
->
breadcrumbs
(
Yii
::
$service
->
page
->
translate
->
__
(
'Customer Product Favorite'
));
return
[
return
[
'coll'
=>
$product_arr
,
'coll'
=>
$product_arr
,
'pageToolBar'
=>
$pageToolBar
,
'pageToolBar'
=>
$pageToolBar
,
...
@@ -73,20 +74,24 @@ class Index
...
@@ -73,20 +74,24 @@ class Index
{
{
$product_ids
=
[];
$product_ids
=
[];
$favorites
=
[];
$favorites
=
[];
$favoritePrimaryKey
=
Yii
::
$service
->
product
->
favorite
->
getPrimaryKey
();
foreach
(
$coll
as
$one
)
{
foreach
(
$coll
as
$one
)
{
$p_id
=
(
string
)
$one
[
'product_id'
];
$p_id
=
(
string
)
$one
[
'product_id'
];
$product_ids
[]
=
$one
[
'product_id'
];
$product_ids
[]
=
$one
[
'product_id'
];
$favorites
[
$p_id
]
=
[
$favorites
[
$p_id
]
=
[
'updated_at'
=>
$one
[
'updated_at'
],
'updated_at'
=>
$one
[
'updated_at'
],
'favorite_id'
=>
(
string
)
$one
[
'_id'
],
'favorite_id'
=>
(
string
)
$one
[
$favoritePrimaryKey
],
];
];
}
}
$productPrimaryKey
=
Yii
::
$service
->
product
->
getPrimaryKey
();
// 得到产品的信息
// 得到产品的信息
$product_filter
=
[
$product_filter
=
[
'where'
=>
[
'where'
=>
[
[
'in'
,
'_id'
,
$product_ids
],
[
'in'
,
$productPrimaryKey
,
$product_ids
],
],
],
'select'
=>
[
'select'
=>
[
$productPrimaryKey
,
'name'
,
'image'
,
'name'
,
'image'
,
'price'
,
'special_price'
,
'price'
,
'special_price'
,
'special_from'
,
'special_to'
,
'special_from'
,
'special_to'
,
...
@@ -94,17 +99,18 @@ class Index
...
@@ -94,17 +99,18 @@ class Index
],
],
'asArray'
=>
true
,
'asArray'
=>
true
,
];
];
$data
=
Yii
::
$service
->
product
->
coll
(
$product_filter
);
$data
=
Yii
::
$service
->
product
->
coll
(
$product_filter
);
$product_arr
=
[];
$product_arr
=
[];
if
(
is_array
(
$data
[
'coll'
])
&&
!
empty
(
$data
[
'coll'
]))
{
if
(
is_array
(
$data
[
'coll'
])
&&
!
empty
(
$data
[
'coll'
]))
{
foreach
(
$data
[
'coll'
]
as
$one
)
{
foreach
(
$data
[
'coll'
]
as
$one
)
{
$p_id
=
(
string
)
$one
[
'_id'
];
$p_id
=
(
string
)
$one
[
$productPrimaryKey
];
$one
[
'updated_at'
]
=
$favorites
[
$p_id
][
'updated_at'
];
$one
[
'updated_at'
]
=
$favorites
[
$p_id
][
'updated_at'
];
$one
[
'favorite_id'
]
=
$favorites
[
$p_id
][
'favorite_id'
];
$one
[
'favorite_id'
]
=
$favorites
[
$p_id
][
'favorite_id'
];
$product_arr
[]
=
$one
;
$product_arr
[]
=
$one
;
}
}
}
}
return
\
fec\helpers\CFunc
::
array_sort
(
$product_arr
,
'updated_at'
,
'desc'
);
return
\
fec\helpers\CFunc
::
array_sort
(
$product_arr
,
'updated_at'
,
'desc'
);
}
}
...
...
app/apphtml5/modules/Customer/block/productfavorite/Index.php
浏览文件 @
4bb5b730
...
@@ -18,7 +18,7 @@ use Yii;
...
@@ -18,7 +18,7 @@ use Yii;
class
Index
class
Index
{
{
public
$pageNum
;
public
$pageNum
;
public
$numPerPage
=
2
0
;
public
$numPerPage
=
1
0
;
public
$_page
=
'p'
;
public
$_page
=
'p'
;
public
function
initFavoriteParam
()
public
function
initFavoriteParam
()
...
@@ -51,6 +51,7 @@ class Index
...
@@ -51,6 +51,7 @@ class Index
$count
=
$data
[
'count'
];
$count
=
$data
[
'count'
];
$pageToolBar
=
$this
->
getProductPage
(
$count
);
$pageToolBar
=
$this
->
getProductPage
(
$count
);
$product_arr
=
$this
->
getProductInfo
(
$coll
);
$product_arr
=
$this
->
getProductInfo
(
$coll
);
$this
->
breadcrumbs
(
Yii
::
$service
->
page
->
translate
->
__
(
'Customer Product Favorite'
));
return
[
return
[
'coll'
=>
$product_arr
,
'coll'
=>
$product_arr
,
...
@@ -58,25 +59,39 @@ class Index
...
@@ -58,25 +59,39 @@ class Index
];
];
}
}
// 面包屑导航
protected
function
breadcrumbs
(
$name
)
{
if
(
Yii
::
$app
->
controller
->
module
->
params
[
'customer_product_favorite_breadcrumbs'
])
{
Yii
::
$service
->
page
->
breadcrumbs
->
addItems
([
'name'
=>
$name
]);
}
else
{
Yii
::
$service
->
page
->
breadcrumbs
->
active
=
false
;
}
}
// 得到产品的一些信息,来显示Favorite 的产品列表。
// 得到产品的一些信息,来显示Favorite 的产品列表。
public
function
getProductInfo
(
$coll
)
public
function
getProductInfo
(
$coll
)
{
{
$product_ids
=
[];
$product_ids
=
[];
$favorites
=
[];
$favorites
=
[];
$favoritePrimaryKey
=
Yii
::
$service
->
product
->
favorite
->
getPrimaryKey
();
foreach
(
$coll
as
$one
)
{
foreach
(
$coll
as
$one
)
{
$p_id
=
(
string
)
$one
[
'product_id'
];
$p_id
=
(
string
)
$one
[
'product_id'
];
$product_ids
[]
=
$one
[
'product_id'
];
$product_ids
[]
=
$one
[
'product_id'
];
$favorites
[
$p_id
]
=
[
$favorites
[
$p_id
]
=
[
'updated_at'
=>
$one
[
'updated_at'
],
'updated_at'
=>
$one
[
'updated_at'
],
'favorite_id'
=>
(
string
)
$one
[
'_id'
],
'favorite_id'
=>
(
string
)
$one
[
$favoritePrimaryKey
],
];
];
}
}
$productPrimaryKey
=
Yii
::
$service
->
product
->
getPrimaryKey
();
// 得到产品的信息
// 得到产品的信息
$product_filter
=
[
$product_filter
=
[
'where'
=>
[
'where'
=>
[
[
'in'
,
'_id'
,
$product_ids
],
[
'in'
,
$productPrimaryKey
,
$product_ids
],
],
],
'select'
=>
[
'select'
=>
[
$productPrimaryKey
,
'name'
,
'image'
,
'name'
,
'image'
,
'price'
,
'special_price'
,
'price'
,
'special_price'
,
'special_from'
,
'special_to'
,
'special_from'
,
'special_to'
,
...
@@ -84,17 +99,18 @@ class Index
...
@@ -84,17 +99,18 @@ class Index
],
],
'asArray'
=>
true
,
'asArray'
=>
true
,
];
];
$data
=
Yii
::
$service
->
product
->
coll
(
$product_filter
);
$data
=
Yii
::
$service
->
product
->
coll
(
$product_filter
);
$product_arr
=
[];
$product_arr
=
[];
if
(
is_array
(
$data
[
'coll'
])
&&
!
empty
(
$data
[
'coll'
]))
{
if
(
is_array
(
$data
[
'coll'
])
&&
!
empty
(
$data
[
'coll'
]))
{
foreach
(
$data
[
'coll'
]
as
$one
)
{
foreach
(
$data
[
'coll'
]
as
$one
)
{
$p_id
=
(
string
)
$one
[
'_id'
];
$p_id
=
(
string
)
$one
[
$productPrimaryKey
];
$one
[
'updated_at'
]
=
$favorites
[
$p_id
][
'updated_at'
];
$one
[
'updated_at'
]
=
$favorites
[
$p_id
][
'updated_at'
];
$one
[
'favorite_id'
]
=
$favorites
[
$p_id
][
'favorite_id'
];
$one
[
'favorite_id'
]
=
$favorites
[
$p_id
][
'favorite_id'
];
$product_arr
[]
=
$one
;
$product_arr
[]
=
$one
;
}
}
}
}
return
\
fec\helpers\CFunc
::
array_sort
(
$product_arr
,
'updated_at'
,
'desc'
);
return
\
fec\helpers\CFunc
::
array_sort
(
$product_arr
,
'updated_at'
,
'desc'
);
}
}
...
@@ -112,7 +128,7 @@ class Index
...
@@ -112,7 +128,7 @@ class Index
return
''
;
return
''
;
}
}
$config
=
[
$config
=
[
'class'
=>
'fecshop\app\app
html5
\widgets\Page'
,
'class'
=>
'fecshop\app\app
front
\widgets\Page'
,
'view'
=>
'widgets/page.php'
,
'view'
=>
'widgets/page.php'
,
'pageNum'
=>
$this
->
pageNum
,
'pageNum'
=>
$this
->
pageNum
,
'numPerPage'
=>
$this
->
numPerPage
,
'numPerPage'
=>
$this
->
numPerPage
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录