Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
17c0c047
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 搜索 >>
提交
17c0c047
编写于
6月 17, 2017
作者:
T
Terry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug修复:block cache key
上级
db27f5d4
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
29 addition
and
37 deletion
+29
-37
app/appfront/widgets/Footer.php
app/appfront/widgets/Footer.php
+1
-1
app/appfront/widgets/Head.php
app/appfront/widgets/Head.php
+1
-1
app/appfront/widgets/Headers.php
app/appfront/widgets/Headers.php
+1
-1
app/appfront/widgets/Menu.php
app/appfront/widgets/Menu.php
+1
-1
app/apphtml5/widgets/Footer.php
app/apphtml5/widgets/Footer.php
+1
-1
app/apphtml5/widgets/Head.php
app/apphtml5/widgets/Head.php
+1
-1
app/apphtml5/widgets/Headers.php
app/apphtml5/widgets/Headers.php
+1
-1
app/apphtml5/widgets/Menu.php
app/apphtml5/widgets/Menu.php
+1
-1
services/AdminUser.php
services/AdminUser.php
+4
-1
services/Cart.php
services/Cart.php
+16
-20
services/Category.php
services/Category.php
+1
-8
未找到文件。
app/appfront/widgets/Footer.php
浏览文件 @
17c0c047
...
...
@@ -16,7 +16,7 @@ class Footer implements BlockCache
public
function
getCacheKey
()
{
$lang
=
Yii
::
$service
->
store
->
currentLang
uag
e
;
$lang
=
Yii
::
$service
->
store
->
currentLang
Cod
e
;
return
self
::
BLOCK_CACHE_PREFIX
.
'_'
.
$lang
;
}
...
...
app/appfront/widgets/Head.php
浏览文件 @
17c0c047
...
...
@@ -16,7 +16,7 @@ class Head implements BlockCache
public
function
getCacheKey
()
{
$store
=
Yii
::
$service
->
store
->
current
Stor
e
;
$store
=
Yii
::
$service
->
store
->
current
LangCod
e
;
$moduleId
=
Yii
::
$app
->
controller
->
module
->
id
;
$controllerId
=
Yii
::
$app
->
controller
->
id
;
$actionId
=
Yii
::
$app
->
controller
->
action
->
id
;
...
...
app/appfront/widgets/Headers.php
浏览文件 @
17c0c047
...
...
@@ -28,7 +28,7 @@ class Headers implements BlockCache
public
function
getCacheKey
()
{
$lang
=
Yii
::
$service
->
store
->
current
Stor
e
;
$lang
=
Yii
::
$service
->
store
->
current
LangCod
e
;
$currency
=
Yii
::
$service
->
page
->
currency
->
getCurrentCurrency
();
return
self
::
BLOCK_CACHE_PREFIX
.
'_'
.
$lang
.
'_'
.
$currency
;
...
...
app/appfront/widgets/Menu.php
浏览文件 @
17c0c047
...
...
@@ -18,7 +18,7 @@ class Menu implements BlockCache
public
function
getCacheKey
()
{
$lang
=
Yii
::
$service
->
store
->
currentLang
uag
e
;
$lang
=
Yii
::
$service
->
store
->
currentLang
Cod
e
;
return
self
::
BLOCK_CACHE_PREFIX
.
'_'
.
$lang
;
}
...
...
app/apphtml5/widgets/Footer.php
浏览文件 @
17c0c047
...
...
@@ -16,7 +16,7 @@ class Footer implements BlockCache
public
function
getCacheKey
()
{
$lang
=
Yii
::
$service
->
store
->
currentLang
uag
e
;
$lang
=
Yii
::
$service
->
store
->
currentLang
Cod
e
;
return
self
::
BLOCK_CACHE_PREFIX
.
'_'
.
$lang
;
}
...
...
app/apphtml5/widgets/Head.php
浏览文件 @
17c0c047
...
...
@@ -16,7 +16,7 @@ class Head implements BlockCache
public
function
getCacheKey
()
{
$store
=
Yii
::
$service
->
store
->
current
Stor
e
;
$store
=
Yii
::
$service
->
store
->
current
LangCod
e
;
$moduleId
=
Yii
::
$app
->
controller
->
module
->
id
;
$controllerId
=
Yii
::
$app
->
controller
->
id
;
$actionId
=
Yii
::
$app
->
controller
->
action
->
id
;
...
...
app/apphtml5/widgets/Headers.php
浏览文件 @
17c0c047
...
...
@@ -28,7 +28,7 @@ class Headers implements BlockCache
public
function
getCacheKey
()
{
$lang
=
Yii
::
$service
->
store
->
current
Stor
e
;
$lang
=
Yii
::
$service
->
store
->
current
LangCod
e
;
$currency
=
Yii
::
$service
->
page
->
currency
->
getCurrentCurrency
();
return
self
::
BLOCK_CACHE_PREFIX
.
'_'
.
$lang
.
'_'
.
$currency
;
...
...
app/apphtml5/widgets/Menu.php
浏览文件 @
17c0c047
...
...
@@ -18,7 +18,7 @@ class Menu implements BlockCache
public
function
getCacheKey
()
{
$lang
=
Yii
::
$service
->
store
->
currentLang
uag
e
;
$lang
=
Yii
::
$service
->
store
->
currentLang
Cod
e
;
return
self
::
BLOCK_CACHE_PREFIX
.
'_'
.
$lang
;
}
...
...
services/AdminUser.php
浏览文件 @
17c0c047
...
...
@@ -18,7 +18,10 @@ use Yii;
*/
class
AdminUser
extends
Service
{
//Yii::$service->adminUser->getIdAndNameArrByIds($ids)
/**
* @property $ids | Int Array
* @return 得到相应用户的数组。
*/
protected
function
actionGetIdAndNameArrByIds
(
$ids
)
{
$user_coll
=
\
fecadmin\models\AdminUser
::
find
()
->
asArray
()
->
select
([
'id'
,
'username'
])
->
where
([
...
...
services/Cart.php
浏览文件 @
17c0c047
...
...
@@ -36,7 +36,6 @@ class Cart extends Service
if
(
isset
(
$item
[
'custom_option_sku'
])
&&
!
empty
(
$item
[
'custom_option_sku'
]))
{
if
(
is_array
(
$item
[
'custom_option_sku'
]))
{
$custom_option_sku
=
Yii
::
$service
->
cart
->
info
->
getCustomOptionSku
(
$item
,
$product
);
if
(
!
$custom_option_sku
)
{
Yii
::
$service
->
helper
->
errors
->
add
(
'product custom_option_sku is not exist'
);
...
...
@@ -52,18 +51,11 @@ class Cart extends Service
}
// 开始加入购物车
// service 里面不允许有事务,请在调用层使用事务。
//$innerTransaction = Yii::$app->db->beginTransaction();
//try {
$beforeEventName
=
'event_add_to_cart_before'
;
$afterEventName
=
'event_add_to_cart_after'
;
$beforeEventName
=
'event_add_to_cart_before'
;
$afterEventName
=
'event_add_to_cart_after'
;
Yii
::
$service
->
event
->
trigger
(
$beforeEventName
,
$item
);
// 触发事件 - 加购物车前事件
Yii
::
$service
->
cart
->
quoteItem
->
addItem
(
$item
);
Yii
::
$service
->
event
->
trigger
(
$afterEventName
,
$item
);
// 触发事件 - 加购物车前事件
//$innerTransaction->commit();
//} catch (Exception $e) {
// $innerTransaction->rollBack();
//}
return
true
;
}
...
...
@@ -74,6 +66,9 @@ class Cart extends Service
}
/**
* @property $shipping_method | String 货运方式code
* @property $country | String 国家code
* @property $region | String 省市code
* 得到购物车中的信息。
*/
protected
function
actionGetCartInfo
(
$shipping_method
=
''
,
$country
=
''
,
$region
=
'*'
)
...
...
@@ -126,15 +121,9 @@ class Cart extends Service
}
/**
* @property $coupon_code 优惠卷码
* @return bool 优惠券使用成功则返回true,失败则返回false
*/
//protected function actionAddCoupon($coupon_code){
//}
/**
* merge cart , if current cart currency is not equals to user cart currency when user login account.
* 购物车合并:用户未登录账号,把一部分产品加入购物车,当用户
* 登录账号的时候,账号对应的购物车信息和用户未登录前的购物车产品信息进行合并的操作
* 在用户登录账户的时候,会执行该方法。
*/
protected
function
actionMergeCartAfterUserLogin
()
{
...
...
@@ -143,13 +132,20 @@ class Cart extends Service
/**
* @property $address|array
* @property $shipping_method | String 发货方式
* @property $payment_method | String 支付方式
* save cart address.like,, customer name,tel,email,address ,,etc,,.
*/
protected
function
actionUpdateGuestCart
(
$address
,
$shipping_method
,
$payment_method
)
{
return
Yii
::
$service
->
cart
->
quote
->
updateGuestCart
(
$address
,
$shipping_method
,
$payment_method
);
}
/**
* @property $address_id | Int
* @property $shipping_method | String 货运方式
* @property $payment_method | String 支付方式
* 更新登录用户的购物车。
*/
protected
function
actionUpdateLoginCart
(
$address_id
,
$shipping_method
,
$payment_method
)
{
return
Yii
::
$service
->
cart
->
quote
->
updateLoginCart
(
$address_id
,
$shipping_method
,
$payment_method
);
...
...
services/Category.php
浏览文件 @
17c0c047
...
...
@@ -25,6 +25,7 @@ class Category extends Service
/**
* init function , 初始化category,使用哪一个category service.
* 目前只支持mongodb,不支持mysql
*/
public
function
init
()
{
...
...
@@ -35,14 +36,6 @@ class Category extends Service
}
}
/**
* Get Url by article's url key.
*/
//public function getUrlByPath($urlPath){
//return Yii::$service->url->getHttpBaseUrl().'/'.$urlKey;
//return Yii::$service->url->getUrlByPath($urlPath);
//}
/**
* 得到当前的category service 对应的主键名称,譬如如果是mongo,返回的是 _id.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录