Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
8e709b42
Y
yii2_fecshop
项目概览
OpenDocCN
/
yii2_fecshop
通知
17
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,体验更适合开发者的 AI 搜索 >>
提交
8e709b42
编写于
10月 28, 2016
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
product review config section and customer account center product review
上级
a8ca0405
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
470 addition
and
130 deletion
+470
-130
app/appadmin/modules/Catalog/block/productreview/Index.php
app/appadmin/modules/Catalog/block/productreview/Index.php
+15
-6
app/appadmin/modules/Catalog/block/productreview/Manageredit.php
...admin/modules/Catalog/block/productreview/Manageredit.php
+6
-8
app/appfront/config/modules/Catalog.php
app/appfront/config/modules/Catalog.php
+19
-3
app/appfront/modules/Catalog/block/product/Index.php
app/appfront/modules/Catalog/block/product/Index.php
+2
-0
app/appfront/modules/Catalog/block/product/Review.php
app/appfront/modules/Catalog/block/product/Review.php
+24
-4
app/appfront/modules/Catalog/block/reviewproduct/Add.php
app/appfront/modules/Catalog/block/reviewproduct/Add.php
+14
-2
app/appfront/modules/Catalog/block/reviewproduct/Lists.php
app/appfront/modules/Catalog/block/reviewproduct/Lists.php
+25
-6
app/appfront/modules/Catalog/controllers/ReviewproductController.php
...t/modules/Catalog/controllers/ReviewproductController.php
+19
-1
app/appfront/modules/Catalog/helpers/Review.php
app/appfront/modules/Catalog/helpers/Review.php
+39
-0
app/appfront/modules/Customer/block/account/Login.php
app/appfront/modules/Customer/block/account/Login.php
+2
-1
app/appfront/modules/Customer/block/productreview/Index.php
app/appfront/modules/Customer/block/productreview/Index.php
+50
-1
app/appfront/modules/Customer/controllers/AccountController.php
...pfront/modules/Customer/controllers/AccountController.php
+10
-5
app/appfront/theme/base/front/assets/css/style.css
app/appfront/theme/base/front/assets/css/style.css
+58
-13
app/appfront/theme/base/front/catalog/product/index.php
app/appfront/theme/base/front/catalog/product/index.php
+4
-4
app/appfront/theme/base/front/catalog/product/index/review.php
...ppfront/theme/base/front/catalog/product/index/review.php
+7
-2
app/appfront/theme/base/front/catalog/reviewproduct/add.php
app/appfront/theme/base/front/catalog/reviewproduct/add.php
+2
-2
app/appfront/theme/base/front/catalog/reviewproduct/lists.php
...appfront/theme/base/front/catalog/reviewproduct/lists.php
+16
-3
app/appfront/theme/base/front/customer/contacts/index.php
app/appfront/theme/base/front/customer/contacts/index.php
+1
-1
app/appfront/theme/base/front/customer/productreview/index.php
...ppfront/theme/base/front/customer/productreview/index.php
+58
-39
app/appfront/theme/base/front/widgets/scroll.php
app/appfront/theme/base/front/widgets/scroll.php
+1
-1
models/mongodb/product/Review.php
models/mongodb/product/Review.php
+6
-1
services/Customer.php
services/Customer.php
+33
-8
services/product/Review.php
services/product/Review.php
+59
-19
未找到文件。
app/appadmin/modules/Catalog/block/productreview/Index.php
浏览文件 @
8e709b42
...
...
@@ -72,6 +72,9 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
* get search bar Arr config
*/
public
function
getSearchArr
(){
$activeStatus
=
Yii
::
$service
->
product
->
review
->
activeStatus
();
$refuseStatus
=
Yii
::
$service
->
product
->
review
->
refuseStatus
();
$noActiveStatus
=
Yii
::
$service
->
product
->
review
->
noActiveStatus
();
$data
=
[
[
# selecit的Int 类型
'type'
=>
'select'
,
...
...
@@ -79,8 +82,9 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
'name'
=>
'status'
,
'columns_type'
=>
'int'
,
# int使用标准匹配, string使用模糊查询
'value'
=>
[
# select 类型的值
1
=>
'已审核'
,
10
=>
'未审核'
,
$noActiveStatus
=>
'未审核'
,
$activeStatus
=>
'审核通过'
,
$refuseStatus
=>
'审核拒绝'
,
],
],
[
# 字符串类型
...
...
@@ -108,6 +112,10 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
*
*/
public
function
getTableFieldArr
(){
$activeStatus
=
Yii
::
$service
->
product
->
review
->
activeStatus
();
$refuseStatus
=
Yii
::
$service
->
product
->
review
->
refuseStatus
();
$noActiveStatus
=
Yii
::
$service
->
product
->
review
->
noActiveStatus
();
$table_th_bar
=
[
[
'orderField'
=>
'_id'
,
...
...
@@ -175,10 +183,11 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
[
'orderField'
=>
'status'
,
'label'
=>
'审核状态'
,
'width'
=>
'
7
0'
,
'width'
=>
'
12
0'
,
'display'
=>
[
1
=>
'已审核'
,
10
=>
'未审核'
,
$noActiveStatus
=>
'未审核'
,
$activeStatus
=>
'审核通过'
,
$refuseStatus
=>
'审核拒绝'
,
],
],
[
...
...
@@ -309,7 +318,7 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
return
'<ul class="toolBar">
<li><a title="确实要批量审核这些记录吗?" target="selectedTodo" rel="'
.
$this
->
_primaryKey
.
's" postType="string" href="'
.
$this
->
_auditUrl
.
'" class="edit"><span>批量审核通过</span></a></li>
<li><a title="确实要批量审核拒绝这些记录吗?" target="selectedTodo" rel="'
.
$this
->
_primaryKey
.
's" postType="string" href="'
.
$this
->
_auditRejectedUrl
.
'" class="edit"><span>批量审核拒绝
通过
</span></a></li>
<li><a title="确实要批量审核拒绝这些记录吗?" target="selectedTodo" rel="'
.
$this
->
_primaryKey
.
's" postType="string" href="'
.
$this
->
_auditRejectedUrl
.
'" class="edit"><span>批量审核拒绝</span></a></li>
<li><a target="dialog" height="580" width="1000" drawable="true" mask="true" class="edit" href="'
.
$this
->
_editUrl
.
'?'
.
$this
->
_primaryKey
.
'={sid_user}" ><span>修改</span></a></li>
<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="'
.
$this
->
_primaryKey
.
's" postType="string" href="'
.
$this
->
_deleteUrl
.
'" class="delete"><span>批量删除</span></a></li>
...
...
app/appadmin/modules/Catalog/block/productreview/Manageredit.php
浏览文件 @
8e709b42
...
...
@@ -45,6 +45,9 @@ class Manageredit extends AppadminbaseBlockEdit implements AppadminbaseBlockEdi
public
function
getEditArr
(){
$activeStatus
=
Yii
::
$service
->
product
->
review
->
activeStatus
();
$refuseStatus
=
Yii
::
$service
->
product
->
review
->
refuseStatus
();
$noActiveStatus
=
Yii
::
$service
->
product
->
review
->
noActiveStatus
();
return
[
[
...
...
@@ -111,25 +114,20 @@ class Manageredit extends AppadminbaseBlockEdit implements AppadminbaseBlockEdi
'require'
=>
0
,
],
[
'label'
=>
'审核状态'
,
'name'
=>
'status'
,
'display'
=>
[
'type'
=>
'select'
,
'data'
=>
[
1
=>
'已审核'
,
10
=>
'未审核'
,
$noActiveStatus
=>
'未审核'
,
$activeStatus
=>
'审核通过'
,
$refuseStatus
=>
'审核拒绝'
,
]
],
'require'
=>
1
,
'default'
=>
4
,
],
];
}
/**
...
...
app/appfront/config/modules/Catalog.php
浏览文件 @
8e709b42
...
...
@@ -10,6 +10,9 @@ return [
'catalog'
=>
[
'class'
=>
'\fecshop\app\appfront\modules\Catalog\Module'
,
'params'
=>
[
###############################
## category部分设置 ##
###############################
'category_breadcrumbs'
=>
false
,
# 是否显示分类的面包屑导航。
/**
* 注意:做侧栏分类产品过滤的属性,必须是select类型的,其他的类型请不要用,
...
...
@@ -62,7 +65,9 @@ return [
'1000-'
,
],
],
# 产品部分的设置
###############################
## Product部分设置 ##
###############################
# 产品页面图片的设置
'productImgSize'
=>
[
'small_img_width'
=>
80
,
# 底部小图的宽度
...
...
@@ -71,9 +76,20 @@ return [
],
'productImgMagnifier'
=>
false
,
# 是否已放大镜的方式显示,如果否,则是内窥的方式查看
###############################
## Review部分设置 ##
###############################
'review'
=>
[
'add_captcha'
=>
true
,
# 增加review页面是否开启验证码验证。
'productPageReviewCount'
=>
20
,
# 在产品页面显示的review的个数。
'add_captcha'
=>
true
,
# 增加review页面是否开启验证码验证。
'productPageReviewCount'
=>
20
,
# 在产品页面显示的review的个数。
'reviewPageReviewCount'
=>
40
,
# 在review列表页面,显示的review的个数
'addReviewOnlyLogin'
=>
true
,
# 只有登录用户才有资格进行评论。
'ifShowCurrentUserNoAuditReview'
=>
true
,
# 当前用户添加的评论,后台未审核的评论,是否显示?这个是通过ip来判断。
'filterByStore'
=>
false
,
# 是否通过store的值进行评论过滤?
'filterByLang'
=>
true
,
# 是否通过语言进行评论过滤?默认只显示当前的语言下的评论,也就是客户在添加评论的store的语言。
'newReviewAudit'
=>
true
,
# 新的前台评论是否需要审核,true代表需要后台审核。
],
],
],
...
...
app/appfront/modules/Catalog/block/product/Index.php
浏览文件 @
8e709b42
...
...
@@ -32,6 +32,8 @@ class Index {
'image'
=>
$this
->
_product
[
'image'
],
'sku'
=>
$this
->
_product
[
'sku'
],
'spu'
=>
$this
->
_product
[
'spu'
],
'review_count'
=>
$this
->
_product
[
'review_count'
]
?
$this
->
_product
[
'review_count'
]
:
0
,
'reviw_rate_star_average'
=>
$this
->
_product
[
'reviw_rate_star_average'
]
?
$this
->
_product
[
'reviw_rate_star_average'
]
:
0
,
'price_info'
=>
$this
->
getProductPriceInfo
(),
'tier_price'
=>
$this
->
_product
[
'tier_price'
],
'media_size'
=>
[
...
...
app/appfront/modules/Catalog/block/product/Review.php
浏览文件 @
8e709b42
...
...
@@ -11,6 +11,7 @@ use Yii;
use
fec\helpers\CModule
;
use
fec\helpers\CRequest
;
use
yii\base\InvalidValueException
;
use
fecshop\app\appfront\modules\Catalog\helpers\Review
as
ReviewHelper
;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
...
...
@@ -22,6 +23,11 @@ class Review {
public
$filterBySpu
=
true
;
public
$filterOrderBy
=
'review_date'
;
public
function
__construct
(){
# 初始化当前appfront的设置,覆盖service的初始设置。
ReviewHelper
::
initReviewConfig
();
}
public
function
getLastData
(){
if
(
!
$this
->
spu
||
!
$this
->
product_id
){
return
;
...
...
@@ -35,6 +41,7 @@ class Review {
'spu'
=>
$this
->
spu
,
'review_count'
=>
$count
,
'coll'
=>
$coll
,
'noActiveStatus'
=>
Yii
::
$service
->
product
->
review
->
noActiveStatus
(),
];
}
...
...
@@ -44,17 +51,30 @@ class Review {
public
function
getReviewsBySpu
(
$spu
){
$review
=
Yii
::
$app
->
getModule
(
'catalog'
)
->
params
[
'review'
];
$productPageReviewCount
=
isset
(
$review
[
'productPageReviewCount'
])
?
$review
[
'productPageReviewCount'
]
:
10
;
$currentIp
=
\
fec\helpers\CFunc
::
get_real_ip
();
$filter
=
[
'numPerPage'
=>
$productPageReviewCount
,
'pageNum'
=>
1
,
'orderBy'
=>
[
$this
->
filterOrderBy
=>
SORT_DESC
],
'where'
=>
[
//['status' => Yii::$service->product->review->activeStatus()],
[
'product_spu'
=>
$spu
],
[
'$or'
=>
[
[
'status'
=>
Yii
::
$service
->
product
->
review
->
activeStatus
(),
'product_spu'
=>
$spu
],
[
'status'
=>
Yii
::
$service
->
product
->
review
->
noActiveStatus
(),
'product_spu'
=>
$spu
,
'ip'
=>
$currentIp
]
]
],
],
];
return
Yii
::
$service
->
product
->
review
->
list
(
$filter
);
# 调出来 review 信息。
return
Yii
::
$service
->
product
->
review
->
getListBySpu
(
$filter
);
}
...
...
app/appfront/modules/Catalog/block/reviewproduct/Add.php
浏览文件 @
8e709b42
...
...
@@ -11,6 +11,8 @@ use Yii;
use
fec\helpers\CModule
;
use
fec\helpers\CRequest
;
use
yii\base\InvalidValueException
;
use
fecshop\app\appfront\modules\Catalog\helpers\Review
as
ReviewHelper
;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
...
...
@@ -19,6 +21,10 @@ class Add {
protected
$_add_captcha
;
public
function
__construct
(){
ReviewHelper
::
initReviewConfig
();
}
public
function
getAddCaptcha
(){
if
(
!
$this
->
_add_captcha
){
$reviewParam
=
Yii
::
$app
->
getModule
(
'catalog'
)
->
params
[
'review'
];
...
...
@@ -47,10 +53,16 @@ class Add {
$image
=
$product
[
'image'
];
$main_img
=
isset
(
$image
[
'main'
][
'image'
])
?
$image
[
'main'
][
'image'
]
:
''
;
$url_key
=
$product
[
'url_key'
];
$name
=
Yii
::
$service
->
store
->
getStoreAttrVal
(
$product
[
'name'
],
'name'
);
$product_name
=
Yii
::
$service
->
store
->
getStoreAttrVal
(
$product
[
'name'
],
'name'
);
$customer_name
=
''
;
if
(
!
Yii
::
$app
->
user
->
isGuest
){
$identity
=
Yii
::
$app
->
user
->
identity
;
$customer_name
=
$identity
[
'firstname'
]
.
' '
.
$identity
[
'lastname'
];
}
return
[
'customer_name'
=>
$customer_name
,
'product_id'
=>
$_id
,
'
name'
=>
$
name
,
'
product_name'
=>
$product_
name
,
'spu'
=>
$spu
,
'price_info'
=>
$price_info
,
'main_img'
=>
$main_img
,
...
...
app/appfront/modules/Catalog/block/reviewproduct/Lists.php
浏览文件 @
8e709b42
...
...
@@ -11,6 +11,8 @@ use Yii;
use
fec\helpers\CModule
;
use
fec\helpers\CRequest
;
use
yii\base\InvalidValueException
;
use
fecshop\app\appfront\modules\Catalog\helpers\Review
as
ReviewHelper
;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
...
...
@@ -25,9 +27,14 @@ class Lists {
public
$numPerPage
=
20
;
public
$pageNum
;
public
function
__construct
(){
ReviewHelper
::
initReviewConfig
();
}
protected
function
getProductPage
(
$countTotal
){
if
(
$countTotal
<=
$this
->
numPerPage
){
return
''
;
}
$config
=
[
'class'
=>
'fecshop\app\appfront\widgets\Page'
,
'view'
=>
'widgets/page.php'
,
...
...
@@ -79,6 +86,7 @@ class Lists {
'pageToolBar'
=>
$pageToolBar
,
'review_count'
=>
$count
,
'coll'
=>
$coll
,
'noActiveStatus'
=>
Yii
::
$service
->
product
->
review
->
noActiveStatus
(),
'addReviewUrl'
=>
$addReviewUrl
,
'name'
=>
$name
,
'price_info'
=>
$price_info
,
...
...
@@ -92,17 +100,28 @@ class Lists {
}
public
function
getReviewsBySpu
(
$spu
){
$currentIp
=
\
fec\helpers\CFunc
::
get_real_ip
();
$filter
=
[
'numPerPage'
=>
$this
->
numPerPage
,
'pageNum'
=>
$this
->
pageNum
,
'orderBy'
=>
[
$this
->
filterOrderBy
=>
SORT_DESC
],
'where'
=>
[
//['status' => Yii::$service->product->review->activeStatus()],
[
'product_spu'
=>
$spu
],
[
'$or'
=>
[
[
'status'
=>
Yii
::
$service
->
product
->
review
->
activeStatus
(),
'product_spu'
=>
$spu
],
[
'status'
=>
Yii
::
$service
->
product
->
review
->
noActiveStatus
(),
'product_spu'
=>
$spu
,
'ip'
=>
$currentIp
]
]
],
],
];
return
Yii
::
$service
->
product
->
review
->
list
(
$filter
);
return
Yii
::
$service
->
product
->
review
->
getListBySpu
(
$filter
);
}
...
...
app/appfront/modules/Catalog/controllers/ReviewproductController.php
浏览文件 @
8e709b42
...
...
@@ -24,9 +24,27 @@ class ReviewproductController extends AppfrontController
# 增加评论
public
function
actionAdd
()
{
$reviewParam
=
Yii
::
$app
->
getModule
(
'catalog'
)
->
params
[
'review'
];
$addReviewOnlyLogin
=
isset
(
$reviewParam
[
'addReviewOnlyLogin'
])
?
$reviewParam
[
'addReviewOnlyLogin'
]
:
false
;
if
(
$addReviewOnlyLogin
&&
Yii
::
$app
->
user
->
isGuest
){
$currentUrl
=
Yii
::
$service
->
url
->
getCurrentUrl
();
Yii
::
$service
->
customer
->
setLoginSuccessRedirectUrl
(
$currentUrl
);
# 如果评论产品必须登录用户,则跳转到用户登录页面
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
$editForm
=
Yii
::
$app
->
request
->
post
(
'editForm'
);
if
(
!
empty
(
$editForm
)){
$this
->
getBlock
()
->
saveReview
(
$editForm
);
$saveStatus
=
$this
->
getBlock
()
->
saveReview
(
$editForm
);
if
(
$saveStatus
){
$spu
=
Yii
::
$app
->
request
->
get
(
'spu'
);
$_id
=
Yii
::
$app
->
request
->
get
(
'_id'
);
if
(
$spu
&&
$_id
){
$url
=
Yii
::
$service
->
url
->
getUrl
(
'catalog/reviewproduct/lists'
,[
'spu'
=>
$spu
,
'_id'
=>
$_id
]);
$this
->
redirect
(
$url
);
}
}
}
//echo 1;exit;
$data
=
$this
->
getBlock
()
->
getLastData
(
$editForm
);
...
...
app/appfront/modules/Catalog/helpers/Review.php
0 → 100644
浏览文件 @
8e709b42
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace
fecshop\app\appfront\modules\Catalog\helpers
;
use
Yii
;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class
Review
{
# 初始化当前appfront的设置,覆盖service的初始设置。
public
static
function
initReviewConfig
(){
# 用当前的配置,覆盖service的公用配置。
$reviewParam
=
Yii
::
$app
->
getModule
(
"catalog"
)
->
params
[
'review'
];
if
(
isset
(
$reviewParam
[
'filterByStore'
])){
Yii
::
$service
->
product
->
review
->
filterByStore
=
$reviewParam
[
'filterByStore'
];
}
if
(
isset
(
$reviewParam
[
'filterByLang'
])){
Yii
::
$service
->
product
->
review
->
filterByLang
=
$reviewParam
[
'filterByLang'
];
}
# 新添加的评论是否需要审核
if
(
isset
(
$reviewParam
[
'newReviewAudit'
])){
Yii
::
$service
->
product
->
review
->
newReviewAudit
=
$reviewParam
[
'newReviewAudit'
];
}
}
}
\ No newline at end of file
app/appfront/modules/Customer/block/account/Login.php
浏览文件 @
8e709b42
...
...
@@ -47,7 +47,8 @@ class Login {
}
}
if
(
!
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account'
);
//Yii::$service->url->redirectByUrlKey('customer/account');
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
'customer/account'
);
}
$errors
=
Yii
::
$service
->
helper
->
errors
->
get
(
true
);
if
(
$errors
){
...
...
app/appfront/modules/Customer/block/productreview/Index.php
浏览文件 @
8e709b42
...
...
@@ -16,10 +16,59 @@ use yii\base\InvalidValueException;
* @since 1.0
*/
class
Index
{
public
$pageNum
;
public
$numPerPage
=
20
;
public
$_page
=
'p'
;
public
function
getLastData
(){
return
[
$this
->
pageNum
=
Yii
::
$app
->
request
->
get
(
$this
->
_page
);
$this
->
pageNum
=
$this
->
pageNum
?
$this
->
pageNum
:
1
;
$identity
=
Yii
::
$app
->
user
->
identity
;
$user_id
=
$identity
[
'id'
];
$filter
=
[
'numPerPage'
=>
$this
->
numPerPage
,
'pageNum'
=>
$this
->
pageNum
,
'orderBy'
=>
[
'review_date'
=>
SORT_DESC
],
'where'
=>
[
[
'user_id'
=>
$user_id
],
],
'asArray'
=>
true
,
];
$data
=
Yii
::
$service
->
product
->
review
->
getReviewsByUserId
(
$filter
);
$count
=
$data
[
'count'
];
//echo $count;exit;
$pageToolBar
=
$this
->
getProductPage
(
$count
);
$coll
=
$data
[
'coll'
];
if
(
is_array
(
$coll
)
&&
!
empty
(
$coll
)){
foreach
(
$coll
as
$k
=>
$one
){
$product_id
=
$one
[
'product_id'
];
$productModel
=
Yii
::
$service
->
product
->
getByPrimaryKey
(
$product_id
);
$coll
[
$k
][
'image'
]
=
$productModel
[
'image'
];
$coll
[
$k
][
'url_key'
]
=
$productModel
[
'url_key'
];
}
}
return
[
'pageToolBar'
=>
$pageToolBar
,
'coll'
=>
$coll
,
'noActiveStatus'
=>
Yii
::
$service
->
product
->
review
->
noActiveStatus
(),
'refuseStatus'
=>
Yii
::
$service
->
product
->
review
->
refuseStatus
(),
'activeStatus'
=>
Yii
::
$service
->
product
->
review
->
activeStatus
(),
];
}
protected
function
getProductPage
(
$countTotal
){
if
(
$countTotal
<=
$this
->
numPerPage
){
return
''
;
}
$config
=
[
'class'
=>
'fecshop\app\appfront\widgets\Page'
,
'view'
=>
'widgets/page.php'
,
'pageNum'
=>
$this
->
pageNum
,
'numPerPage'
=>
$this
->
numPerPage
,
'countTotal'
=>
$countTotal
,
'page'
=>
$this
->
_page
,
];
return
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_page'
,
$config
);
}
}
\ No newline at end of file
app/appfront/modules/Customer/controllers/AccountController.php
浏览文件 @
8e709b42
...
...
@@ -49,7 +49,9 @@ class AccountController extends AppfrontController
exit;
*/
$param
=
Yii
::
$app
->
request
->
post
(
'editForm'
);
$this
->
getBlock
()
->
login
(
$param
);
if
(
!
empty
(
$param
)
&&
is_array
(
$param
)){
$this
->
getBlock
()
->
login
(
$param
);
}
$data
=
$this
->
getBlock
()
->
getLastData
();
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
...
...
@@ -68,10 +70,13 @@ class AccountController extends AppfrontController
if
(
isset
(
$params_register
[
'successAutoLogin'
])
&&
$params_register
[
'successAutoLogin'
]
){
Yii
::
$service
->
customer
->
login
(
$param
);
}
# 注册成功后,跳转的页面,如果值为false, 则不跳转。
if
(
isset
(
$params_register
[
'loginSuccessRedirectUrlKey'
])
&&
$params_register
[
'loginSuccessRedirectUrlKey'
]
){
$redirectUrl
=
Yii
::
$service
->
url
->
getUrl
(
$params_register
[
'loginSuccessRedirectUrlKey'
]);
Yii
::
$service
->
url
->
redirect
(
$redirectUrl
);
if
(
!
Yii
::
$app
->
user
->
isGuest
){
# 注册成功后,跳转的页面,如果值为false, 则不跳转。
$urlKey
=
'customer/account'
;
if
(
isset
(
$params_register
[
'loginSuccessRedirectUrlKey'
])
&&
$params_register
[
'loginSuccessRedirectUrlKey'
]
){
$urlKey
=
$params_register
[
'loginSuccessRedirectUrlKey'
];
}
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
$urlKey
);
}
}
}
...
...
app/appfront/theme/base/front/assets/css/style.css
浏览文件 @
8e709b42
...
...
@@ -1628,7 +1628,7 @@ height: 77px;
border
:
solid
1px
#adadad
;
}
.product-Reviews_top
{
padding
:
20
px
0
20px
10px
;
padding
:
8
px
0
20px
10px
;
width
:
100%
;
}
.product-Reviews_bottom
{
...
...
@@ -1899,13 +1899,28 @@ a:hover{text-decoration: underline;}
display
:
block
;
float
:
left
;
height
:
15px
;
margin
:
0
10px
0
0
;
margin
:
2px
10px
0
5px
;
text-align
:
right
;
width
:
95px
;
}
.review_star_5
{
background
:
rgba
(
0
,
0
,
0
,
0
)
url("../images/Star_5.png")
no-repeat
scroll
0
0
;
}
.review_star_4
{
background
:
rgba
(
0
,
0
,
0
,
0
)
url("../images/Star_4.png")
no-repeat
scroll
0
0
;
}
.review_star_3
{
background
:
rgba
(
0
,
0
,
0
,
0
)
url("../images/Star_3.png")
no-repeat
scroll
0
0
;
}
.review_star_2
{
background
:
rgba
(
0
,
0
,
0
,
0
)
url("../images/Star_2.png")
no-repeat
scroll
0
0
;
}
.review_star_1
{
background
:
rgba
(
0
,
0
,
0
,
0
)
url("../images/Star_1.png")
no-repeat
scroll
0
0
;
}
.review_star_0
{
background
:
rgba
(
0
,
0
,
0
,
0
)
url("../images/Star_0.png")
no-repeat
scroll
0
0
;
}
.review_star
{
display
:
block
;
height
:
15px
;
...
...
@@ -2040,12 +2055,14 @@ a.next_images {
overflow
:
hidden
;
padding
:
10px
0
0
;
position
:
relative
;
width
:
1170px
;
}
.review_lists
.scroll_left
{
border-bottom
:
1px
solid
#ccc
;
}
.product-Reviews_top
{
padding
:
20px
0
20px
10px
;
width
:
100%
;
width
:
auto
;
}
...
...
@@ -2080,9 +2097,7 @@ a.next_images {
font-family
:
Georgia
;
text-transform
:
uppercase
;
}
.review_star_5
{
background
:
rgba
(
0
,
0
,
0
,
0
)
url("../images/Star_5.png")
no-repeat
scroll
0
0
;
}
.review_star
{
display
:
block
;
height
:
15px
;
...
...
@@ -2157,7 +2172,7 @@ a.next_images {
border-radius
:
2px
;
color
:
#777
;
height
:
100px
;
padding
:
0
10px
;
padding
:
10px
;
resize
:
none
;
width
:
676px
;
}
...
...
@@ -2214,19 +2229,49 @@ a.next_images {
margin
:
20px
0
20px
;
}
.moderation
,
.review_moderation
{
color
:
#ccc
;
margin
:
10px
0
;
font-style
:
italic
;
}
.review_refuse
{
color
:
#cc0000
;
margin
:
10px
0
;
font-style
:
italic
;
}
.review_accept
{
color
:
green
;
margin
:
10px
0
;
font-style
:
italic
;
}
.average_rating
{
float
:
left
;}
#review_description
li
{
min-height
:
90px
;}
.account_review_product
.review_description_right_span
{
margin-bottom
:
2px
;
float
:
left
;
}
.account_review_product
.review_description_centen
{
margin-top
:
15px
;
}
.review_date_time
{
display
:
block
;
float
:
right
;
}
.account_review_product
.product_img
{
display
:
block
;
margin
:
auto
;
width
:
120px
;
}
.account_review_product
.review_star
{
display
:
block
;
margin
:
auto
;
margin
:
3px
auto
10px
;
}
...
...
app/appfront/theme/base/front/catalog/product/index.php
浏览文件 @
8e709b42
...
...
@@ -9,10 +9,10 @@
<div
class=
"rbc_cold"
>
<span>
<span
class=
"average_rating"
>
Average rating :
</span>
<span
class=
"review_star review_star_
4"
style=
"font-weight:bold;"
itemprop=
"average"
>
0
</span>
<span
class=
"review_star review_star_
<?=
$reviw_rate_star_average
?>
"
style=
"font-weight:bold;"
itemprop=
"average"
>
</span>
<a
rel=
"nofollow"
href=
"
http://www.intosmile.com/fashion-solid-color-long-sleeve-round-neck-dress-1-1-1-1-1.html
"
>
(
<span
itemprop=
"count"
>
0
reviews
</span>
)
<a
rel=
"nofollow"
href=
"
#text-reviews
"
>
(
<span
itemprop=
"count"
>
<?=
$review_count
?>
reviews
</span>
)
</a>
</span>
</div>
...
...
@@ -119,7 +119,7 @@
<div
class=
"text-description"
style=
""
>
<?=
$description
;
?>
</div>
<div
class=
"text-reviews"
style=
""
>
<div
class=
"text-reviews"
id=
"text-reviews"
style=
""
>
<?php
# review部分。
$reviewView
=
[
'class'
=>
'fecshop\app\appfront\modules\Catalog\block\product\Review'
,
...
...
app/appfront/theme/base/front/catalog/product/index/review.php
浏览文件 @
8e709b42
...
...
@@ -13,7 +13,7 @@
<li>
<div
class=
"review_description_left"
>
<a
href=
"#"
class=
"review_star review_star_
5
"
onclick=
"javascript:return false;"
></a>
<a
href=
"#"
class=
"review_star review_star_
<?=
$one
[
'rate_star'
]
?>
"
onclick=
"javascript:return false;"
></a>
<p>
By
<?=
$one
[
'name'
]
?>
</p>
<span>
<?=
$one
[
'review_date'
]
?
date
(
'Y-m-d H:i:s'
,
$one
[
'review_date'
])
:
''
?>
</span>
</div>
...
...
@@ -25,7 +25,12 @@
<div
class=
"review-content"
>
<?=
$one
[
'review_content'
]
?>
</div>
<br>
<?php
if
(
$one
[
'status'
]
==
$noActiveStatus
){
?>
<div
class=
"moderation"
>
Your comment is awaiting moderation...
</div>
<?php
}
?>
</div>
</div>
<div
class=
"clear"
></div>
...
...
app/appfront/theme/base/front/catalog/reviewproduct/add.php
浏览文件 @
8e709b42
...
...
@@ -11,7 +11,7 @@
<div
style=
"width:700px;float:left;"
>
<div
style=
""
>
<a
href=
"
<?=
$url
?>
"
>
<?=
$name
?>
</a>
<a
href=
"
<?=
$url
?>
"
>
<?=
$
product_
name
?>
</a>
</div>
<div
class=
"product_info review_add_price"
>
<div
class=
"price_info"
>
...
...
@@ -61,7 +61,7 @@
<strong>
Your Name
</strong><em
class=
"product-description_em"
>
*
</em></label>
<div
class=
"input-box"
>
<input
name=
"editForm[name]"
id=
"review_email_field"
class=
"input-text review-input-text required-entry"
value=
"
<?=
$editForm
[
'name'
]
?>
"
type=
"text"
>
<input
name=
"editForm[name]"
id=
"review_email_field"
class=
"input-text review-input-text required-entry"
value=
"
<?=
$editForm
[
'name'
]
?
$editForm
[
'name'
]
:
$customer_name
?
>
"
type=
"text"
>
</div>
<span
class=
"review_span_error"
id=
"review_email_span"
></span>
</li>
...
...
app/appfront/theme/base/front/catalog/reviewproduct/lists.php
浏览文件 @
8e709b42
<div
class=
"main container one-column"
>
<?=
Yii
::
$service
->
page
->
widget
->
render
(
'flashmessage'
);
?>
<div
class=
"col-main"
>
<div
class=
"std"
>
<div
class=
"review_lists"
>
...
...
@@ -51,14 +52,17 @@
</div>
<div
class=
"product-Reviews"
>
<div
class=
"clear"
></div>
<div
class=
"scroll_left"
>
<a
href=
""
>
Product Review
</a>
</div>
<div
class=
"product-Reviews_top"
>
<?php
if
(
is_array
(
$coll
)
&&
!
empty
(
$coll
)){
?>
<ul
id=
"review_description"
>
<?php
foreach
(
$coll
as
$one
){
?>
<li>
<div
class=
"review_description_left"
>
<a
href=
"#"
class=
"review_star review_star_
5
"
onclick=
"javascript:return false;"
></a>
<a
href=
"#"
class=
"review_star review_star_
<?=
$one
[
'rate_star'
]
?>
"
onclick=
"javascript:return false;"
></a>
<p>
By
<?=
$one
[
'name'
]
?>
</p>
<span>
<?=
$one
[
'review_date'
]
?
date
(
'Y-m-d H:i:s'
,
$one
[
'review_date'
])
:
''
?>
</span>
</div>
...
...
@@ -70,7 +74,14 @@
<div
class=
"review-content"
>
<?=
$one
[
'review_content'
]
?>
</div>
<br>
<div
class=
"moderation"
>
<?php
if
(
$one
[
'status'
]
==
$noActiveStatus
){
?>
Your Review is awaiting moderation...
<?php
}
else
if
(
$one
[
'status'
]
==
$refuseStatus
){
?>
Your Review is refused.
<?php
}
?>
</div>
</div>
</div>
<div
class=
"clear"
></div>
...
...
@@ -79,9 +90,11 @@
</ul>
<?php
}
?>
</div>
<?php
if
(
$pageToolBar
){
?>
<div
class=
"pageToolbar"
>
<label
class=
"title"
>
Page:
</label>
<?=
$pageToolBar
?>
</div>
<?php
}
?>
</div>
</div>
</div>
...
...
app/appfront/theme/base/front/customer/contacts/index.php
浏览文件 @
8e709b42
...
...
@@ -73,7 +73,7 @@
<!--
<p class="back-link"><a href="http://10.10.10.252:3800/index.php/customer/account/"><small>? </small>Back</a></p>
-->
<button
type=
"submit"
title=
"Save"
class=
"button"
onclick=
"return check_contacts()"
><span><span>
S
ave
</span></span></button>
<button
type=
"submit"
title=
"Save"
class=
"button"
onclick=
"return check_contacts()"
><span><span>
S
ubmit
</span></span></button>
</div>
</form>
</div>
...
...
app/appfront/theme/base/front/customer/productreview/index.php
浏览文件 @
8e709b42
...
...
@@ -2,50 +2,69 @@
<div
class=
"col-main account_center"
>
<div
class=
"
std
"
>
<div
class=
"
account_review_product
"
>
<div
style=
"margin:19px 0 0"
>
<div
class=
"page-title"
>
<h2>
My Product Reviews
</h2>
</div>
<div
style=
"width:100%;min-height:500px;"
>
<div
style=
"width:100%;"
>
<ul
id=
"review_description"
style=
"padding:0px;"
>
<li
style=
"width:100%;min-height:160px;"
>
<div
class=
"review_description_left"
>
<a
target=
"_blank"
href=
"http://www.intosmile.com/prise-crane-de-cristal-creative-glass-coupe-novetly.html"
>
<p
style=
"text-align:center;"
>
<img
src=
"http://img.intosmile.com/media/catalog/product/cache/110/110/710aa4d924f51b2be23e7fd5eda0d13f/f/i/file.jpg"
style=
"width:110px;height:110px;"
>
</p>
<span>
Creative Crystal Skull Shot Glass Cup Novetly
</span>
</a>
</div>
<div
class=
"review_description_right"
style=
"width:600px;"
>
<span
class=
"review_description_right_span"
>
<b>
summary your review
</b>
</span>
<div
class=
"review_description_centen"
>
review content
<br>
</div>
</div>
</li>
<li
style=
"width:100%;min-height:160px;"
>
<div
class=
"review_description_left"
>
<div
class=
"product-Reviews"
>
<div
class=
"clear"
></div>
<div
class=
"scroll_left"
>
<a
href=
""
>
Product Review
</a>
</div>
<div
class=
"product-Reviews_top"
>
<?php
if
(
is_array
(
$coll
)
&&
!
empty
(
$coll
)){
?>
<ul
id=
"review_description"
>
<?php
foreach
(
$coll
as
$one
){
?>
<a
target=
"_blank"
href=
"http://www.intosmile.com/prise-crane-de-cristal-creative-glass-coupe-novetly.html"
>
<p
style=
"text-align:center;"
><img
src=
"http://img.intosmile.com/media/catalog/product/cache/110/110/710aa4d924f51b2be23e7fd5eda0d13f/f/i/file.jpg"
style=
"width:110px;height:110px;"
></p>
<span>
Creative Crystal Skull Shot Glass Cup Novetly
</span>
</a>
</div>
<div
class=
"review_description_right"
style=
"width:600px;"
>
<span
class=
"review_description_right_span"
><b>
yyy
</b></span>
<div
class=
"review_description_centen"
>
dddd
<br></div>
</div>
</li>
</ul>
<li>
<?php
$main_image
=
isset
(
$one
[
'image'
][
'main'
][
'image'
])
?
$one
[
'image'
][
'main'
][
'image'
]
:
''
?>
<div
class=
"review_description_left"
>
<a
class=
"product_img"
href=
"
<?=
Yii
::
$service
->
url
->
getUrl
(
$one
[
'url_key'
]);
?>
"
>
<img
src=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$main_image
,[
120
,
120
],
false
)
?>
"
/>
</a>
<a
href=
"#"
class=
"review_star review_star_
<?=
$one
[
'rate_star'
]
?>
"
onclick=
"javascript:return false;"
></a>
</div>
<div
class=
"review_description_right"
>
<span
class=
"review_description_right_span"
><b>
<?=
$one
[
'summary'
]
?>
</b></span>
<span
class=
"review_date_time"
>
<?=
$one
[
'review_date'
]
?
date
(
'Y-m-d H:i:s'
,
$one
[
'review_date'
])
:
''
?>
</span>
<div
class=
"clear"
></div>
<div
class=
"review_description_centen"
>
<div
class=
"addsize"
></div>
<div
class=
"review-content"
>
<?=
$one
[
'review_content'
]
?>
</div>
<?php
if
(
$one
[
'status'
]
==
$noActiveStatus
){
?>
<div
class=
"review_moderation"
>
Your Review is awaiting moderation...
</div>
<?php
}
else
if
(
$one
[
'status'
]
==
$refuseStatus
){
?>
<div
class=
"review_refuse"
>
Your Review is refused.
</div>
<?php
}
else
if
(
$one
[
'status'
]
==
$activeStatus
){
?>
<div
class=
"review_accept"
>
Your Review is accept.
</div>
<?php
}
?>
</div>
</div>
<div
class=
"clear"
></div>
</li>
<?php
}
?>
</ul>
<?php
}
?>
</div>
<?php
if
(
$pageToolBar
){
?>
<div
class=
"pageToolbar"
>
<label
class=
"title"
>
Page:
</label>
<?=
$pageToolBar
?>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
...
...
app/appfront/theme/base/front/widgets/scroll.php
浏览文件 @
8e709b42
...
...
@@ -9,6 +9,6 @@
?>
<div
class=
"footer_fixed"
>
<a
id=
"goTop"
class=
"go_top"
href=
"#gotop"
style=
"display: block;"
>
go to top
</a>
<a
class=
"cus_survey"
href=
"
http://www.intosmile.com/contacts
"
title=
"customer survey"
target=
"_blank"
>
customer survey
</a>
<a
class=
"cus_survey"
href=
"
<?=
Yii
::
$service
->
url
->
getUrl
(
'customer/contacts'
);
?>
"
title=
"customer survey"
target=
"_blank"
>
customer survey
</a>
<div
class=
"ph"
><a
id=
"goBottom"
class=
"go_bottom"
href=
"#gobottom"
>
go to bottom
</a></div>
</div>
\ No newline at end of file
models/mongodb/product/Review.php
浏览文件 @
8e709b42
...
...
@@ -16,9 +16,12 @@ use yii\mongodb\ActiveRecord;
class
Review
extends
ActiveRecord
{
public
static
$_customAttrs
;
# 评论默认状态,也就是用户添加了评论后的状态(前面是客户的评论信息需要审核的前提下,如果客户信息不需要审核的话,则就是ACTIVE_STATUS)
const
NOACTIVE_STATUS
=
10
;
# 审核通过的状态
const
ACTIVE_STATUS
=
1
;
# 审核拒绝的状态
const
REFUSE_STATUS
=
2
;
public
static
function
collectionName
()
{
...
...
@@ -38,6 +41,8 @@ class Review extends ActiveRecord
'product_id'
,
'rate_star'
,
'name'
,
'user_id'
,
'ip'
,
'summary'
,
'review_content'
,
# 评论的内容
'review_date'
,
# 评论的最后更新时间
...
...
services/Customer.php
浏览文件 @
8e709b42
...
...
@@ -22,7 +22,7 @@ use fecshop\models\mysqldb\Customer as CustomerModel;
class
Customer
extends
Service
{
public
$customer_register
;
const
USER_LOGIN_SUCCESS_REDIRECT_URL_KEY
=
'usr_login_success_redirect_url'
;
/**
* 注册用户名字的最小长度
*/
...
...
@@ -200,14 +200,39 @@ class Customer extends Service
protected
function
actionFindByPasswordResetToken
(
$token
){
return
CustomerModel
::
findByPasswordResetToken
(
$token
);
}
/**
* @property $url|String
* 在一些功能中,需要用户进行登录操作,等用户操作成功后,应该跳转到相应的页面中,这里通过session存储需要跳转到的url。
* 某些页面 , 譬如评论页面,需要用户登录后才能进行登录操作,那么可以通过这个方法把url set 进去,登录成功
* 后,页面不会跳转到账户中心,而是需要操作的页面中。
*/
protected
function
actionSetLoginSuccessRedirectUrl
(
$url
){
return
Yii
::
$app
->
session
->
set
(
$this
::
USER_LOGIN_SUCCESS_REDIRECT_URL_KEY
,
$url
);
}
/**
* @property $url|String
* 在一些功能中,需要用户进行登录操作,等用户操作成功后,应该跳转到相应的页面中,这里通过session得到需要跳转到的url。
*/
protected
function
actionGetLoginSuccessRedirectUrl
(){
$url
=
Yii
::
$app
->
session
->
get
(
$this
::
USER_LOGIN_SUCCESS_REDIRECT_URL_KEY
);
return
$url
?
$url
:
''
;
}
protected
function
actionLoginSuccessRedirect
(
$urlKey
){
$url
=
$this
->
getLoginSuccessRedirectUrl
();
if
(
$url
){
# 这个优先级最高
# 在跳转之前,去掉这个session存储的值。跳转后,这个值必须失效。
Yii
::
$app
->
session
->
remove
(
$this
::
USER_LOGIN_SUCCESS_REDIRECT_URL_KEY
);
//echo Yii::$app->session->get($this::USER_LOGIN_SUCCESS_REDIRECT_URL_KEY);
//exit;
Yii
::
$service
->
url
->
redirect
(
$url
);
}
else
{
Yii
::
$service
->
url
->
redirectByUrlKey
(
$urlKey
);
}
}
...
...
services/product/Review.php
浏览文件 @
8e709b42
...
...
@@ -23,6 +23,28 @@ class Review extends Service
public
$filterByStore
;
public
$filterByLang
;
public
$newReviewAudit
;
/**
* 得到review noactive status,默认状态
*/
protected
function
actionNoActiveStatus
(){
return
ReviewModel
::
NOACTIVE_STATUS
;
}
/**
* 得到review active status 审核通过的状态
*/
protected
function
actionActiveStatus
(){
return
ReviewModel
::
ACTIVE_STATUS
;
}
/**
* 得到review refuse status 审核拒绝的状态
*/
protected
function
actionRefuseStatus
(){
return
ReviewModel
::
REFUSE_STATUS
;
}
/**
* @property $arr | Array
* 初始化review model的属性,因为每一个产品的可能添加的评论字段不同。
...
...
@@ -88,19 +110,7 @@ class Review extends Service
}
/**
* 得到review noactive status
*/
protected
function
actionNoActiveStatus
(){
return
ReviewModel
::
NOACTIVE_STATUS
;
}
/**
* 得到review active status
*/
protected
function
actionActiveStatus
(){
return
ReviewModel
::
ACTIVE_STATUS
;
}
/**
* @property $review_data | Array
...
...
@@ -115,13 +125,20 @@ class Review extends Service
}
# 默认状态。
if
(
$this
->
newReviewAudit
){
$review_data
[
'status'
]
=
ReviewModel
::
NOACTIVE_STATUS
;
$review_data
[
'status'
]
=
ReviewModel
::
NOACTIVE_STATUS
;
}
else
{
$review_data
[
'status'
]
=
ReviewModel
::
ACTIVE_STATUS
;
$review_data
[
'status'
]
=
ReviewModel
::
ACTIVE_STATUS
;
}
$review_data
[
'store'
]
=
Yii
::
$service
->
store
->
currentStore
;
$review_data
[
'lang_code'
]
=
Yii
::
$service
->
store
->
currentLangCode
;
$review_data
[
'store'
]
=
Yii
::
$service
->
store
->
currentStore
;
$review_data
[
'lang_code'
]
=
Yii
::
$service
->
store
->
currentLangCode
;
$review_data
[
'review_date'
]
=
time
();
if
(
!
Yii
::
$app
->
user
->
isGuest
){
$identity
=
Yii
::
$app
->
user
->
identity
;
$user_id
=
$identity
[
'id'
];
$review_data
[
'user_id'
]
=
$user_id
;
}
$review_data
[
'ip'
]
=
\
fec\helpers\CFunc
::
get_real_ip
();
$saveStatus
=
Yii
::
$service
->
helper
->
ar
->
save
(
$model
,
$review_data
);
return
true
;
...
...
@@ -310,7 +327,7 @@ class Review extends Service
if
(
$model
[
$this
->
getPrimaryKey
()]){
$model
->
audit_user
=
$user_id
;
$model
->
audit_date
=
time
();
$model
->
status
=
ReviewModel
::
NOACTIV
E_STATUS
;
$model
->
status
=
ReviewModel
::
REFUS
E_STATUS
;
$model
->
save
();
# 更新评论的信息到产品表
$this
->
updateProductSpuReview
(
$model
[
'product_spu'
]);
...
...
@@ -350,8 +367,31 @@ class Review extends Service
return
true
;
}
/**
* @property $filter|Array
* get artile collection by $filter
* example filter:
* [
* 'numPerPage' => 20,
* 'pageNum' => 1,
* 'orderBy' => [$this->getPrimaryKey() => SORT_DESC, 'sku' => SORT_ASC ],
'where' => [
['>','price',1],
['<=','price',10]
* ['sku' => 'uk10001'],
* ],
* 'asArray' => true,
* ]
*/
protected
function
actionGetReviewsByUserId
(
$filter
){
$query
=
ReviewModel
::
find
();
$query
=
Yii
::
$service
->
helper
->
ar
->
getCollByFilter
(
$query
,
$filter
);
return
[
'coll'
=>
$query
->
all
(),
'count'
=>
$query
->
count
(),
];
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录