Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
47a38647
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,发现更多精彩内容 >>
提交
47a38647
编写于
2月 28, 2018
作者:
T
Terry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
一些小调整
上级
2c077a6c
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
18 addition
and
9 deletion
+18
-9
app/appfront/theme/base/front/assets/js/js.js
app/appfront/theme/base/front/assets/js/js.js
+1
-1
app/appfront/theme/base/front/catalog/category/index.php
app/appfront/theme/base/front/catalog/category/index.php
+3
-0
services/cart/Quote.php
services/cart/Quote.php
+1
-1
services/cart/QuoteItem.php
services/cart/QuoteItem.php
+0
-3
services/product/Price.php
services/product/Price.php
+13
-4
未找到文件。
app/appfront/theme/base/front/assets/js/js.js
浏览文件 @
47a38647
...
...
@@ -39,7 +39,7 @@ $(document).ready(function(){
logoutStr
=
$
(
'
.logoutStr
'
).
val
();
if
(
data
.
loginStatus
){
customer_name
=
data
.
customer_name
;
str
=
'
<span id="welcome">
'
+
welcome
+
'
'
+
customer_name
+
'
,
</span>
'
;
str
=
'
<span id="welcome">
'
+
welcome
+
'
'
+
customer_name
+
'
</span>
'
;
str
+=
'
<span id="js_isNotLogin">
'
;
str
+=
'
<a href="
'
+
logoutUrl
+
'
" rel="nofollow">
'
+
logoutStr
+
'
</a>
'
;
str
+=
'
</span>
'
;
...
...
app/appfront/theme/base/front/catalog/category/index.php
浏览文件 @
47a38647
...
...
@@ -42,6 +42,9 @@
<ul>
<?php
endif
;
?>
<li>
<div
style=
"display:none"
>
<?=
$currentOff
=
Yii
::
$service
->
product
->
price
->
currentOff
;
// 通过这个函数也可以得到特价折扣值 OFF ?>
</
div
>
<
div
class
=
"c_img"
>
<
a
href
=
"<?=
$product['url']
?>"
>
<
img
class
=
"js_lazy"
src
=
"<?= Yii::
$service->image
->getImgUrl('images/lazyload.gif'); ?>"
data
-
original
=
"<?= Yii::
$service->product
->image->getResize(
$product['image'],[230,230]
,false) ?>"
/>
...
...
services/cart/Quote.php
浏览文件 @
47a38647
...
...
@@ -217,7 +217,7 @@ class Quote extends Service
protected
function
actionClearCart
()
{
//Yii::$service->session->remove(self::SESSION_CART_ID);
Yii
::
$service
->
cart
->
quoteItem
->
removeNoActiveItems
();
Yii
::
$service
->
cart
->
quoteItem
->
removeNoActiveItems
ByCartId
();
}
/**
...
...
services/cart/QuoteItem.php
浏览文件 @
47a38647
...
...
@@ -418,7 +418,6 @@ class QuoteItem extends Service
$active
=
$this
->
activeStatus
;
}
$updateCount
=
$this
->
_itemModel
->
updateAll
(
[
'active'
=>
$active
],
[
'cart_id'
=>
$cart_id
]
);
...
...
@@ -444,8 +443,6 @@ class QuoteItem extends Service
if
(
!
$cart_id
)
{
$cart_id
=
Yii
::
$service
->
cart
->
quote
->
getCartId
();
}
echo
2
;
echo
$cart_id
;
if
(
$cart_id
)
{
$columns
=
$this
->
_itemModel
->
deleteAll
([
'cart_id'
=>
$cart_id
,
...
...
services/product/Price.php
浏览文件 @
47a38647
...
...
@@ -28,6 +28,10 @@ class Price extends Service
protected
$_currencyInfo
;
// 执行函数 getCurrentCurrencyProductPriceInfo,会将折扣数保存到 currentOff 中,
// 您可以通过 Yii::$service->product->price->currentOff 直接获取。
public
$currentOff
=
0
;
/**
* @property $price | Float 产品的价格
* 得到当前货币状态下的产品的价格信息。
...
...
@@ -268,6 +272,7 @@ class Price extends Service
*/
protected
function
actionGetCurrentCurrencyProductPriceInfo
(
$price
,
$special_price
,
$special_from
,
$special_to
)
{
$this
->
currentOff
=
0
;
$price_info
=
$this
->
formatPrice
(
$price
);
$return
[
'price'
]
=
[
'symbol'
=>
$price_info
[
'symbol'
],
...
...
@@ -282,8 +287,12 @@ class Price extends Service
'value'
=>
$special_price_info
[
'value'
],
'code'
=>
$special_price_info
[
'code'
],
];
$off
=
(
$price_info
[
'value'
]
-
$special_price_info
[
'value'
]
)
/
$price_info
[
'value'
];
$this
->
currentOff
=
round
(
$off
*
100
);
}
return
$return
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录