Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
f1527bfc
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,发现更多精彩内容 >>
提交
f1527bfc
编写于
5月 17, 2017
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
url redirect部分的bug处理
上级
64f90955
变更
37
隐藏空白更改
内联
并排
Showing
37 changed file
with
88 addition
and
79 deletion
+88
-79
app/appfront/modules/Catalog/block/favoriteproduct/Add.php
app/appfront/modules/Catalog/block/favoriteproduct/Add.php
+4
-4
app/appfront/modules/Catalog/controllers/FavoriteproductController.php
...modules/Catalog/controllers/FavoriteproductController.php
+1
-1
app/appfront/modules/Catalog/controllers/ReviewproductController.php
...t/modules/Catalog/controllers/ReviewproductController.php
+1
-1
app/appfront/modules/Checkout/block/onepage/Index.php
app/appfront/modules/Checkout/block/onepage/Index.php
+2
-2
app/appfront/modules/Checkout/controllers/OnepageController.php
...pfront/modules/Checkout/controllers/OnepageController.php
+5
-2
app/appfront/modules/Customer/block/account/Login.php
app/appfront/modules/Customer/block/account/Login.php
+2
-6
app/appfront/modules/Customer/block/address/Edit.php
app/appfront/modules/Customer/block/address/Edit.php
+2
-2
app/appfront/modules/Customer/block/order/Reorder.php
app/appfront/modules/Customer/block/order/Reorder.php
+6
-7
app/appfront/modules/Customer/controllers/AccountController.php
...pfront/modules/Customer/controllers/AccountController.php
+4
-1
app/appfront/modules/Customer/controllers/AddressController.php
...pfront/modules/Customer/controllers/AddressController.php
+1
-1
app/appfront/modules/Customer/controllers/EditaccountController.php
...nt/modules/Customer/controllers/EditaccountController.php
+1
-1
app/appfront/modules/Customer/controllers/OrderController.php
...appfront/modules/Customer/controllers/OrderController.php
+2
-2
app/appfront/modules/Customer/controllers/PointController.php
...appfront/modules/Customer/controllers/PointController.php
+1
-1
app/appfront/modules/Customer/controllers/ProductfavoriteController.php
...odules/Customer/controllers/ProductfavoriteController.php
+1
-1
app/appfront/modules/Customer/controllers/ProductreviewController.php
.../modules/Customer/controllers/ProductreviewController.php
+1
-1
app/appfront/modules/Payment/block/paypal/express/Review.php
app/appfront/modules/Payment/block/paypal/express/Review.php
+1
-1
app/appfront/modules/Payment/controllers/paypal/ExpressController.php
.../modules/Payment/controllers/paypal/ExpressController.php
+6
-1
app/appfront/modules/Payment/controllers/paypal/StandardController.php
...modules/Payment/controllers/paypal/StandardController.php
+2
-3
app/apphtml5/modules/Catalog/block/favoriteproduct/Add.php
app/apphtml5/modules/Catalog/block/favoriteproduct/Add.php
+3
-4
app/apphtml5/modules/Catalog/controllers/FavoriteproductController.php
...modules/Catalog/controllers/FavoriteproductController.php
+1
-0
app/apphtml5/modules/Catalog/controllers/ReviewproductController.php
...5/modules/Catalog/controllers/ReviewproductController.php
+1
-1
app/apphtml5/modules/Checkout/block/onepage/Index.php
app/apphtml5/modules/Checkout/block/onepage/Index.php
+2
-2
app/apphtml5/modules/Checkout/controllers/OnepageController.php
...phtml5/modules/Checkout/controllers/OnepageController.php
+5
-2
app/apphtml5/modules/Customer/block/account/Login.php
app/apphtml5/modules/Customer/block/account/Login.php
+2
-6
app/apphtml5/modules/Customer/block/address/Edit.php
app/apphtml5/modules/Customer/block/address/Edit.php
+2
-2
app/apphtml5/modules/Customer/block/order/Reorder.php
app/apphtml5/modules/Customer/block/order/Reorder.php
+6
-7
app/apphtml5/modules/Customer/controllers/AccountController.php
...phtml5/modules/Customer/controllers/AccountController.php
+5
-2
app/apphtml5/modules/Customer/controllers/AddressController.php
...phtml5/modules/Customer/controllers/AddressController.php
+1
-1
app/apphtml5/modules/Customer/controllers/EditaccountController.php
...l5/modules/Customer/controllers/EditaccountController.php
+1
-1
app/apphtml5/modules/Customer/controllers/OrderController.php
...apphtml5/modules/Customer/controllers/OrderController.php
+2
-2
app/apphtml5/modules/Customer/controllers/PointController.php
...apphtml5/modules/Customer/controllers/PointController.php
+1
-1
app/apphtml5/modules/Customer/controllers/ProductfavoriteController.php
...odules/Customer/controllers/ProductfavoriteController.php
+1
-1
app/apphtml5/modules/Customer/controllers/ProductreviewController.php
.../modules/Customer/controllers/ProductreviewController.php
+1
-1
app/apphtml5/modules/Payment/block/paypal/express/Review.php
app/apphtml5/modules/Payment/block/paypal/express/Review.php
+1
-1
app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php
.../modules/Payment/controllers/paypal/ExpressController.php
+5
-1
app/apphtml5/modules/Payment/controllers/paypal/StandardController.php
...modules/Payment/controllers/paypal/StandardController.php
+2
-3
services/Customer.php
services/Customer.php
+3
-3
未找到文件。
app/appfront/modules/Catalog/block/favoriteproduct/Add.php
浏览文件 @
f1527bfc
...
...
@@ -25,8 +25,8 @@ class Add {
if
(
Yii
::
$app
->
user
->
isGuest
){
$url
=
Yii
::
$service
->
url
->
getCurrentUrl
();
Yii
::
$service
->
customer
->
setLoginSuccessRedirectUrl
(
$url
);
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
exit
;
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
$identity
=
Yii
::
$app
->
user
->
identity
;
...
...
@@ -39,11 +39,11 @@ class Add {
$favoriteParam
=
Yii
::
$app
->
getModule
(
'catalog'
)
->
params
[
'favorite'
];
# 跳转。
if
(
isset
(
$favoriteParam
[
'addSuccessRedirectFavoriteList'
])
&&
$favoriteParam
[
'addSuccessRedirectFavoriteList'
]){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/productfavorite'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/productfavorite'
);
}
else
{
$product
=
Yii
::
$service
->
product
->
getByPrimaryKey
(
$product_id
);
$urlKey
=
$product
[
'url_key'
];
Yii
::
$service
->
url
->
redirectByUrlKey
(
$urlKey
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
$urlKey
);
}
}
...
...
app/appfront/modules/Catalog/controllers/FavoriteproductController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class FavoriteproductController extends AppfrontController
# 增加收藏
public
function
actionAdd
()
{
$data
=
$this
->
getBlock
()
->
getLastData
();
return
$this
->
getBlock
()
->
getLastData
();
//return $this->render($this->action->id,$data);
}
...
...
app/appfront/modules/Catalog/controllers/ReviewproductController.php
浏览文件 @
f1527bfc
...
...
@@ -31,7 +31,7 @@ class ReviewproductController extends AppfrontController
Yii
::
$service
->
customer
->
setLoginSuccessRedirectUrl
(
$currentUrl
);
# 如果评论产品必须登录用户,则跳转到用户登录页面
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
$editForm
=
Yii
::
$app
->
request
->
post
(
'editForm'
);
...
...
app/appfront/modules/Checkout/block/onepage/Index.php
浏览文件 @
f1527bfc
...
...
@@ -31,7 +31,7 @@ class Index {
$cartInfo
=
Yii
::
$service
->
cart
->
getCartInfo
();
if
(
!
isset
(
$cartInfo
[
'products'
])
||
!
is_array
(
$cartInfo
[
'products'
])
||
empty
(
$cartInfo
[
'products'
])){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
}
$currency_info
=
Yii
::
$service
->
page
->
currency
->
getCurrencyInfo
();
$this
->
initAddress
();
...
...
@@ -549,4 +549,4 @@ class Index {
}
\ No newline at end of file
}
app/appfront/modules/Checkout/controllers/OnepageController.php
浏览文件 @
f1527bfc
...
...
@@ -38,8 +38,11 @@ class OnepageController extends AppfrontController
$data
=
$this
->
getBlock
()
->
getLastData
();
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
if
(
is_array
(
$data
)
&&
!
empty
(
$data
)
){
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
else
{
return
$data
;
}
}
...
...
app/appfront/modules/Customer/block/account/Login.php
浏览文件 @
f1527bfc
...
...
@@ -53,11 +53,7 @@ class Login {
}
}
Yii
::
$service
->
page
->
message
->
addByHelperErrors
();
if
(
!
Yii
::
$app
->
user
->
isGuest
){
//Yii::$service->url->redirectByUrlKey('customer/account');
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
'customer/account'
);
}
return
;
}
/**
* 发送登录邮件
...
...
@@ -70,4 +66,4 @@ class Login {
}
\ No newline at end of file
}
app/appfront/modules/Customer/block/address/Edit.php
浏览文件 @
f1527bfc
...
...
@@ -221,7 +221,7 @@ class Edit {
$identity
=
Yii
::
$app
->
user
->
identity
;
$arr
[
'customer_id'
]
=
$identity
[
'id'
];
Yii
::
$service
->
customer
->
address
->
save
(
$arr
);
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/address'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/address'
);
}
...
...
@@ -230,4 +230,4 @@ class Edit {
}
\ No newline at end of file
}
app/appfront/modules/Customer/block/order/Reorder.php
浏览文件 @
f1527bfc
...
...
@@ -20,18 +20,18 @@ class Reorder {
public
function
getLastData
(){
$order_id
=
Yii
::
$app
->
request
->
get
(
'order_id'
);
if
(
!
$order_id
){
$this
->
errorMessage
(
'The order id is empty'
);
return
$this
->
errorMessage
(
'The order id is empty'
);
}
$order
=
Yii
::
$service
->
order
->
getByPrimaryKey
(
$order_id
);
if
(
!
$order
[
'increment_id'
]){
$this
->
errorMessage
(
'The order is not exist'
);
return
$this
->
errorMessage
(
'The order is not exist'
);
}
$customer_id
=
Yii
::
$app
->
user
->
identity
->
id
;
if
(
!
$order
[
'customer_id'
]
||
(
$order
[
'customer_id'
]
!=
$customer_id
)){
$this
->
errorMessage
(
'The order does not belong to you'
);
return
$this
->
errorMessage
(
'The order does not belong to you'
);
}
$this
->
addOrderProductToCart
(
$order_id
);
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
}
public
function
addOrderProductToCart
(
$order_id
){
$items
=
Yii
::
$service
->
order
->
item
->
getByOrderId
(
$order_id
);
...
...
@@ -55,10 +55,9 @@ class Reorder {
*/
public
function
errorMessage
(
$message
){
Yii
::
$service
->
page
->
message
->
addError
(
$message
);
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/order'
);
exit
;
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/order'
);
}
}
\ No newline at end of file
}
app/appfront/modules/Customer/controllers/AccountController.php
浏览文件 @
f1527bfc
...
...
@@ -51,6 +51,9 @@ class AccountController extends AppfrontController
$param
=
Yii
::
$app
->
request
->
post
(
'editForm'
);
if
(
!
empty
(
$param
)
&&
is_array
(
$param
)){
$this
->
getBlock
()
->
login
(
$param
);
if
(
!
Yii
::
$app
->
user
->
isGuest
){
return
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
'customer/account'
);
}
}
$data
=
$this
->
getBlock
()
->
getLastData
(
$param
);
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
...
...
@@ -82,7 +85,7 @@ class AccountController extends AppfrontController
if
(
isset
(
$params_register
[
'loginSuccessRedirectUrlKey'
])
&&
$params_register
[
'loginSuccessRedirectUrlKey'
]
){
$urlKey
=
$params_register
[
'loginSuccessRedirectUrlKey'
];
}
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
$urlKey
);
return
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
$urlKey
);
}
}
}
...
...
app/appfront/modules/Customer/controllers/AddressController.php
浏览文件 @
f1527bfc
...
...
@@ -22,7 +22,7 @@ class AddressController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/appfront/modules/Customer/controllers/EditaccountController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class EditaccountController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/appfront/modules/Customer/controllers/OrderController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class OrderController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
@@ -39,7 +39,7 @@ class OrderController extends AppfrontController
}
public
function
actionReorder
(){
$this
->
getBlock
()
->
getLastData
();
return
$this
->
getBlock
()
->
getLastData
();
//return $this->render($this->action->id,$data);
}
...
...
app/appfront/modules/Customer/controllers/PointController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class PointController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/appfront/modules/Customer/controllers/ProductfavoriteController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class ProductfavoriteController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/appfront/modules/Customer/controllers/ProductreviewController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class ProductreviewController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/appfront/modules/Payment/block/paypal/express/Review.php
浏览文件 @
f1527bfc
...
...
@@ -56,7 +56,7 @@ class Review {
$cartInfo
=
Yii
::
$service
->
cart
->
getCartInfo
();
if
(
!
isset
(
$cartInfo
[
'products'
])
||
!
is_array
(
$cartInfo
[
'products'
])
||
empty
(
$cartInfo
[
'products'
])){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
}
$currency_info
=
Yii
::
$service
->
page
->
currency
->
getCurrencyInfo
();
$this
->
initAddress
();
...
...
app/appfront/modules/Payment/controllers/paypal/ExpressController.php
浏览文件 @
f1527bfc
...
...
@@ -34,7 +34,12 @@ class ExpressController extends AppfrontController
}
}
$data
=
$this
->
getBlock
()
->
getLastData
();
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
if
(
is_array
(
$data
)
&&
!
empty
(
$data
)
){
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
else
{
return
$data
;
}
}
...
...
app/appfront/modules/Payment/controllers/paypal/StandardController.php
浏览文件 @
f1527bfc
...
...
@@ -26,7 +26,7 @@ class StandardController extends AppfrontController
if
(
is_array
(
$data
)
&&
!
empty
(
$data
)){
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
else
{
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/onepage'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/onepage'
);
}
}
...
...
@@ -45,8 +45,7 @@ class StandardController extends AppfrontController
public
function
actionCancel
(){
Yii
::
$service
->
order
->
cancel
();
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/onepage'
);
exit
;
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/onepage'
);
}
public
function
actionTest
(){
...
...
app/apphtml5/modules/Catalog/block/favoriteproduct/Add.php
浏览文件 @
f1527bfc
...
...
@@ -25,8 +25,7 @@ class Add {
if
(
Yii
::
$app
->
user
->
isGuest
){
$url
=
Yii
::
$service
->
url
->
getCurrentUrl
();
Yii
::
$service
->
customer
->
setLoginSuccessRedirectUrl
(
$url
);
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
exit
;
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
$identity
=
Yii
::
$app
->
user
->
identity
;
...
...
@@ -39,11 +38,11 @@ class Add {
$favoriteParam
=
Yii
::
$app
->
getModule
(
'catalog'
)
->
params
[
'favorite'
];
# 跳转。
if
(
isset
(
$favoriteParam
[
'addSuccessRedirectFavoriteList'
])
&&
$favoriteParam
[
'addSuccessRedirectFavoriteList'
]){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/productfavorite'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/productfavorite'
);
}
else
{
$product
=
Yii
::
$service
->
product
->
getByPrimaryKey
(
$product_id
);
$urlKey
=
$product
[
'url_key'
];
Yii
::
$service
->
url
->
redirectByUrlKey
(
$urlKey
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
$urlKey
);
}
}
...
...
app/apphtml5/modules/Catalog/controllers/FavoriteproductController.php
浏览文件 @
f1527bfc
...
...
@@ -22,6 +22,7 @@ class FavoriteproductController extends AppfrontController
public
function
actionAdd
()
{
$data
=
$this
->
getBlock
()
->
getLastData
();
return
$data
;
//return $this->render($this->action->id,$data);
}
...
...
app/apphtml5/modules/Catalog/controllers/ReviewproductController.php
浏览文件 @
f1527bfc
...
...
@@ -31,7 +31,7 @@ class ReviewproductController extends AppfrontController
Yii
::
$service
->
customer
->
setLoginSuccessRedirectUrl
(
$currentUrl
);
# 如果评论产品必须登录用户,则跳转到用户登录页面
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
$editForm
=
Yii
::
$app
->
request
->
post
(
'editForm'
);
...
...
app/apphtml5/modules/Checkout/block/onepage/Index.php
浏览文件 @
f1527bfc
...
...
@@ -31,7 +31,7 @@ class Index {
$cartInfo
=
Yii
::
$service
->
cart
->
getCartInfo
();
if
(
!
isset
(
$cartInfo
[
'products'
])
||
!
is_array
(
$cartInfo
[
'products'
])
||
empty
(
$cartInfo
[
'products'
])){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
}
$currency_info
=
Yii
::
$service
->
page
->
currency
->
getCurrencyInfo
();
$this
->
initAddress
();
...
...
@@ -549,4 +549,4 @@ class Index {
}
\ No newline at end of file
}
app/apphtml5/modules/Checkout/controllers/OnepageController.php
浏览文件 @
f1527bfc
...
...
@@ -38,8 +38,11 @@ class OnepageController extends AppfrontController
$data
=
$this
->
getBlock
()
->
getLastData
();
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
if
(
is_array
(
$data
)
&&
!
empty
(
$data
)
){
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
else
{
return
$data
;
}
}
...
...
app/apphtml5/modules/Customer/block/account/Login.php
浏览文件 @
f1527bfc
...
...
@@ -53,11 +53,7 @@ class Login {
}
}
Yii
::
$service
->
page
->
message
->
addByHelperErrors
();
if
(
!
Yii
::
$app
->
user
->
isGuest
){
//Yii::$service->url->redirectByUrlKey('customer/account');
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
'customer/account'
);
}
return
;
}
/**
* 发送登录邮件
...
...
@@ -70,4 +66,4 @@ class Login {
}
\ No newline at end of file
}
app/apphtml5/modules/Customer/block/address/Edit.php
浏览文件 @
f1527bfc
...
...
@@ -221,7 +221,7 @@ class Edit {
$identity
=
Yii
::
$app
->
user
->
identity
;
$arr
[
'customer_id'
]
=
$identity
[
'id'
];
Yii
::
$service
->
customer
->
address
->
save
(
$arr
);
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/address'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/address'
);
}
...
...
@@ -230,4 +230,4 @@ class Edit {
}
\ No newline at end of file
}
app/apphtml5/modules/Customer/block/order/Reorder.php
浏览文件 @
f1527bfc
...
...
@@ -20,18 +20,18 @@ class Reorder {
public
function
getLastData
(){
$order_id
=
Yii
::
$app
->
request
->
get
(
'order_id'
);
if
(
!
$order_id
){
$this
->
errorMessage
(
'The order id is empty'
);
return
$this
->
errorMessage
(
'The order id is empty'
);
}
$order
=
Yii
::
$service
->
order
->
getByPrimaryKey
(
$order_id
);
if
(
!
$order
[
'increment_id'
]){
$this
->
errorMessage
(
'The order is not exist'
);
return
$this
->
errorMessage
(
'The order is not exist'
);
}
$customer_id
=
Yii
::
$app
->
user
->
identity
->
id
;
if
(
!
$order
[
'customer_id'
]
||
(
$order
[
'customer_id'
]
!=
$customer_id
)){
$this
->
errorMessage
(
'The order does not belong to you'
);
return
$this
->
errorMessage
(
'The order does not belong to you'
);
}
$this
->
addOrderProductToCart
(
$order_id
);
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
}
public
function
addOrderProductToCart
(
$order_id
){
$items
=
Yii
::
$service
->
order
->
item
->
getByOrderId
(
$order_id
);
...
...
@@ -55,10 +55,9 @@ class Reorder {
*/
public
function
errorMessage
(
$message
){
Yii
::
$service
->
page
->
message
->
addError
(
$message
);
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/order'
);
exit
;
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/order'
);
}
}
\ No newline at end of file
}
app/apphtml5/modules/Customer/controllers/AccountController.php
浏览文件 @
f1527bfc
...
...
@@ -37,7 +37,7 @@ class AccountController extends AppfrontController
/**
* 登录
*/
public
function
actionLogin
()
public
function
actionLogin
()
{
/**
$toEmail = 'zqy234@126.com';
...
...
@@ -51,6 +51,9 @@ class AccountController extends AppfrontController
$param
=
Yii
::
$app
->
request
->
post
(
'editForm'
);
if
(
!
empty
(
$param
)
&&
is_array
(
$param
)){
$this
->
getBlock
()
->
login
(
$param
);
if
(
!
Yii
::
$app
->
user
->
isGuest
){
return
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
'customer/account'
);
}
}
$data
=
$this
->
getBlock
()
->
getLastData
(
$param
);
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
...
...
@@ -82,7 +85,7 @@ class AccountController extends AppfrontController
if
(
isset
(
$params_register
[
'loginSuccessRedirectUrlKey'
])
&&
$params_register
[
'loginSuccessRedirectUrlKey'
]
){
$urlKey
=
$params_register
[
'loginSuccessRedirectUrlKey'
];
}
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
$urlKey
);
return
Yii
::
$service
->
customer
->
loginSuccessRedirect
(
$urlKey
);
}
}
}
...
...
app/apphtml5/modules/Customer/controllers/AddressController.php
浏览文件 @
f1527bfc
...
...
@@ -22,7 +22,7 @@ class AddressController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/apphtml5/modules/Customer/controllers/EditaccountController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class EditaccountController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/apphtml5/modules/Customer/controllers/OrderController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class OrderController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
@@ -39,7 +39,7 @@ class OrderController extends AppfrontController
}
public
function
actionReorder
(){
$this
->
getBlock
()
->
getLastData
();
return
$this
->
getBlock
()
->
getLastData
();
//return $this->render($this->action->id,$data);
}
...
...
app/apphtml5/modules/Customer/controllers/PointController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class PointController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/apphtml5/modules/Customer/controllers/ProductfavoriteController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class ProductfavoriteController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/apphtml5/modules/Customer/controllers/ProductreviewController.php
浏览文件 @
f1527bfc
...
...
@@ -21,7 +21,7 @@ class ProductreviewController extends AppfrontController
public
function
init
(){
if
(
Yii
::
$app
->
user
->
isGuest
){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'customer/account/login'
);
}
parent
::
init
();
}
...
...
app/apphtml5/modules/Payment/block/paypal/express/Review.php
浏览文件 @
f1527bfc
...
...
@@ -56,7 +56,7 @@ class Review {
$cartInfo
=
Yii
::
$service
->
cart
->
getCartInfo
();
if
(
!
isset
(
$cartInfo
[
'products'
])
||
!
is_array
(
$cartInfo
[
'products'
])
||
empty
(
$cartInfo
[
'products'
])){
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/cart'
);
}
$currency_info
=
Yii
::
$service
->
page
->
currency
->
getCurrencyInfo
();
$this
->
initAddress
();
...
...
app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php
浏览文件 @
f1527bfc
...
...
@@ -34,7 +34,11 @@ class ExpressController extends AppfrontController
}
}
$data
=
$this
->
getBlock
()
->
getLastData
();
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
if
(
is_array
(
$data
)
&&
!
empty
(
$data
)){
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
else
{
return
$data
;
}
}
...
...
app/apphtml5/modules/Payment/controllers/paypal/StandardController.php
浏览文件 @
f1527bfc
...
...
@@ -26,7 +26,7 @@ class StandardController extends AppfrontController
if
(
is_array
(
$data
)
&&
!
empty
(
$data
)){
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
else
{
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/onepage'
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/onepage'
);
}
}
...
...
@@ -45,8 +45,7 @@ class StandardController extends AppfrontController
public
function
actionCancel
(){
Yii
::
$service
->
order
->
cancel
();
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/onepage'
);
exit
;
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
'checkout/onepage'
);
}
public
function
actionTest
(){
...
...
services/Customer.php
浏览文件 @
f1527bfc
...
...
@@ -288,10 +288,10 @@ class Customer extends Service
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
);
return
Yii
::
$service
->
url
->
redirect
(
$url
);
}
else
{
Yii
::
$service
->
url
->
redirectByUrlKey
(
$urlKey
);
return
Yii
::
$service
->
url
->
redirectByUrlKey
(
$urlKey
);
}
}
/**
...
...
@@ -394,4 +394,4 @@ class Customer extends Service
return
$authnum
;
}
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录