Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
3b0f177e
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 搜索 >>
提交
3b0f177e
编写于
5月 26, 2017
作者:
T
Terry
提交者:
GitHub
5月 26, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Apply fixes from StyleCI (#15)
上级
e5d90177
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
20 deletion
+24
-20
app/appfront/modules/Checkout/block/onepage/Placeorder.php
app/appfront/modules/Checkout/block/onepage/Placeorder.php
+3
-2
app/appfront/modules/Checkout/controllers/CartController.php
app/appfront/modules/Checkout/controllers/CartController.php
+7
-6
app/appfront/modules/Payment/block/paypal/express/Placeorder.php
...front/modules/Payment/block/paypal/express/Placeorder.php
+2
-2
app/apphtml5/modules/Checkout/block/onepage/Placeorder.php
app/apphtml5/modules/Checkout/block/onepage/Placeorder.php
+3
-2
app/apphtml5/modules/Checkout/controllers/CartController.php
app/apphtml5/modules/Checkout/controllers/CartController.php
+7
-6
app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php
...html5/modules/Payment/block/paypal/express/Placeorder.php
+2
-2
未找到文件。
app/appfront/modules/Checkout/block/onepage/Placeorder.php
浏览文件 @
3b0f177e
...
...
@@ -13,7 +13,7 @@ use Yii;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
* @since 1.0
*/
class
Placeorder
{
...
...
@@ -65,9 +65,10 @@ class Placeorder
$startUrl
=
Yii
::
$service
->
payment
->
getStandardStartUrl
();
$innerTransaction
->
commit
();
Yii
::
$service
->
url
->
redirect
(
$startUrl
);
return
true
;
}
else
{
$innerTransaction
->
rollBack
();
$innerTransaction
->
rollBack
();
}
}
catch
(
Exception
$e
)
{
$innerTransaction
->
rollBack
();
...
...
app/appfront/modules/Checkout/controllers/CartController.php
浏览文件 @
3b0f177e
...
...
@@ -26,8 +26,9 @@ class CartController extends AppfrontController
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
/**
* 把产品加入到购物车
* 把产品加入到购物车
.
*/
public
function
actionAdd
()
{
...
...
@@ -61,7 +62,7 @@ class CartController extends AppfrontController
]);
$innerTransaction
->
commit
();
exit
;
}
else
{
}
else
{
$errors
=
Yii
::
$service
->
helper
->
errors
->
get
(
','
);
echo
json_encode
([
'status'
=>
'fail'
,
...
...
@@ -70,9 +71,9 @@ class CartController extends AppfrontController
]);
$innerTransaction
->
rollBack
();
exit
;
}
}
}
catch
(
Exception
$e
)
{
$innerTransaction
->
rollBack
();
$innerTransaction
->
rollBack
();
}
}
}
...
...
@@ -97,9 +98,9 @@ class CartController extends AppfrontController
if
(
$coupon_code
)
{
$innerTransaction
=
Yii
::
$app
->
db
->
beginTransaction
();
try
{
if
(
Yii
::
$service
->
cart
->
coupon
->
addCoupon
(
$coupon_code
))
{
if
(
Yii
::
$service
->
cart
->
coupon
->
addCoupon
(
$coupon_code
))
{
$innerTransaction
->
commit
();
}
else
{
}
else
{
$innerTransaction
->
rollBack
();
}
}
catch
(
Exception
$e
)
{
...
...
app/appfront/modules/Payment/block/paypal/express/Placeorder.php
浏览文件 @
3b0f177e
...
...
@@ -57,7 +57,7 @@ class Placeorder
$genarateStatus
=
Yii
::
$service
->
order
->
generateOrderByCart
(
$this
->
_billing
,
$this
->
_shipping_method
,
$this
->
_payment_method
,
false
);
if
(
$genarateStatus
)
{
$innerTransaction
->
commit
();
}
else
{
}
else
{
$innerTransaction
->
rollBack
();
}
}
catch
(
Exception
$e
)
{
...
...
@@ -180,7 +180,7 @@ class Placeorder
}
else
{
if
(
!
Yii
::
$service
->
shipping
->
ifIsCorrect
(
$shipping_method
))
{
Yii
::
$service
->
helper
->
errors
->
add
(
'shipping method is not correct'
);
return
false
;
}
}
...
...
app/apphtml5/modules/Checkout/block/onepage/Placeorder.php
浏览文件 @
3b0f177e
...
...
@@ -65,9 +65,10 @@ class Placeorder
$startUrl
=
Yii
::
$service
->
payment
->
getStandardStartUrl
();
$innerTransaction
->
commit
();
Yii
::
$service
->
url
->
redirect
(
$startUrl
);
return
true
;
}
else
{
$innerTransaction
->
rollBack
();
$innerTransaction
->
rollBack
();
}
}
catch
(
Exception
$e
)
{
$innerTransaction
->
rollBack
();
...
...
@@ -263,7 +264,7 @@ class Placeorder
Yii
::
$service
->
helper
->
errors
->
add
(
'payment method can not empty'
);
return
false
;
}
else
{
}
else
{
if
(
!
Yii
::
$service
->
payment
->
ifIsCorrectStandard
(
$payment_method
))
{
Yii
::
$service
->
helper
->
errors
->
add
(
'payment method is not correct'
);
...
...
app/apphtml5/modules/Checkout/controllers/CartController.php
浏览文件 @
3b0f177e
...
...
@@ -26,8 +26,9 @@ class CartController extends AppfrontController
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
/**
* 把产品加入到购物车
* 把产品加入到购物车
.
*/
public
function
actionAdd
()
{
...
...
@@ -61,7 +62,7 @@ class CartController extends AppfrontController
]);
$innerTransaction
->
commit
();
exit
;
}
else
{
}
else
{
$errors
=
Yii
::
$service
->
helper
->
errors
->
get
(
','
);
echo
json_encode
([
'status'
=>
'fail'
,
...
...
@@ -72,7 +73,7 @@ class CartController extends AppfrontController
exit
;
}
}
catch
(
Exception
$e
)
{
$innerTransaction
->
rollBack
();
$innerTransaction
->
rollBack
();
}
}
}
...
...
@@ -96,10 +97,10 @@ class CartController extends AppfrontController
$coupon_code
=
\
Yii
::
$service
->
helper
->
htmlEncode
(
$coupon_code
);
if
(
$coupon_code
)
{
$innerTransaction
=
Yii
::
$app
->
db
->
beginTransaction
();
try
{
if
(
Yii
::
$service
->
cart
->
coupon
->
addCoupon
(
$coupon_code
))
{
try
{
if
(
Yii
::
$service
->
cart
->
coupon
->
addCoupon
(
$coupon_code
))
{
$innerTransaction
->
commit
();
}
else
{
}
else
{
$innerTransaction
->
rollBack
();
}
}
catch
(
Exception
$e
)
{
...
...
app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php
浏览文件 @
3b0f177e
...
...
@@ -57,7 +57,7 @@ class Placeorder
$genarateStatus
=
Yii
::
$service
->
order
->
generateOrderByCart
(
$this
->
_billing
,
$this
->
_shipping_method
,
$this
->
_payment_method
,
false
);
if
(
$genarateStatus
)
{
$innerTransaction
->
commit
();
}
else
{
}
else
{
$innerTransaction
->
rollBack
();
}
}
catch
(
Exception
$e
)
{
...
...
@@ -166,7 +166,7 @@ class Placeorder
$address_one
=
''
;
$billing
=
isset
(
$post
[
'billing'
])
?
$post
[
'billing'
]
:
''
;
if
(
!
Yii
::
$service
->
order
->
checkRequiredAddressAttr
(
$billing
))
{
return
false
;
return
false
;
}
$this
->
_billing
=
$billing
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录