Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
0b0922bc
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,发现更多精彩内容 >>
提交
0b0922bc
编写于
8月 04, 2016
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
73a617fe
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
124 addition
and
133 deletion
+124
-133
services/AdminUser.php
services/AdminUser.php
+1
-1
services/Blog.php
services/Blog.php
+9
-9
services/Cart.php
services/Cart.php
+13
-13
services/Customer.php
services/Customer.php
+6
-6
services/FecshopLang.php
services/FecshopLang.php
+5
-5
services/Order.php
services/Order.php
+4
-4
services/Product.php
services/Product.php
+2
-2
services/Search.php
services/Search.php
+2
-2
services/Store.php
services/Store.php
+3
-11
services/Url.php
services/Url.php
+3
-3
services/category/Menu.php
services/category/Menu.php
+2
-2
services/category/Product.php
services/category/Product.php
+1
-1
services/cms/Article.php
services/cms/Article.php
+5
-6
services/helper/Log.php
services/helper/Log.php
+1
-4
services/page/Asset.php
services/page/Asset.php
+3
-4
services/page/Breadcrumbs.php
services/page/Breadcrumbs.php
+12
-10
services/page/Menu.php
services/page/Menu.php
+1
-1
services/page/Newsletter.php
services/page/Newsletter.php
+2
-2
services/page/Theme.php
services/page/Theme.php
+2
-2
services/page/Translate.php
services/page/Translate.php
+1
-1
services/page/Widget.php
services/page/Widget.php
+30
-28
services/product/BestSell.php
services/product/BestSell.php
+2
-2
services/product/Coll.php
services/product/Coll.php
+1
-1
services/product/Image.php
services/product/Image.php
+1
-1
services/product/Info.php
services/product/Info.php
+3
-3
services/url/Rewrite.php
services/url/Rewrite.php
+9
-9
未找到文件。
services/AdminUser.php
浏览文件 @
0b0922bc
...
...
@@ -21,7 +21,7 @@ class AdminUser extends Service
{
#Yii::$service->adminUser->getIdAndNameArrByIds($ids)
p
ublic
function
g
etIdAndNameArrByIds
(
$ids
){
p
rotected
function
actionG
etIdAndNameArrByIds
(
$ids
){
$user_coll
=
\
fecadmin\models\AdminUser
::
find
()
->
asArray
()
->
select
([
'id'
,
'username'
])
->
where
([
'in'
,
'id'
,
$ids
...
...
services/Blog.php
浏览文件 @
0b0922bc
...
...
@@ -19,51 +19,51 @@ use fec\helpers\CSession;
class
Blog
extends
Service
{
p
ublic
function
g
etCategoryMenu
(){
p
rotected
function
actionG
etCategoryMenu
(){
}
p
ublic
function
g
etArticleList
(){
p
rotected
function
actionG
etArticleList
(){
}
p
ublic
function
g
etCategoryArticleList
(){
p
rotected
function
actionG
etCategoryArticleList
(){
}
p
ublic
function
g
etArticleById
(){
p
rotected
function
actionG
etArticleById
(){
}
p
ublic
function
s
aveArticle
(){
p
rotected
function
actionS
aveArticle
(){
}
p
ublic
function
d
eleteArticle
(){
p
rotected
function
actionD
eleteArticle
(){
}
p
ublic
function
s
aveCategory
(){
p
rotected
function
actionS
aveCategory
(){
}
p
ublic
function
d
eleteCategory
(){
p
rotected
function
actionD
eleteCategory
(){
}
p
ublic
function
g
etCategoryById
(){
p
rotected
function
actionG
etCategoryById
(){
}
...
...
services/Cart.php
浏览文件 @
0b0922bc
...
...
@@ -33,24 +33,24 @@ class Cart extends Service
* use session to save custom cart info, also ,you can config varibale $noLoginUserCartStorage ,save cart info to db.
*
*/
p
ublic
function
a
ddProductToCart
(
$item
){
p
rotected
function
actionA
ddProductToCart
(
$item
){
}
p
ublic
function
g
etUserCartInfo
(){
p
rotected
function
actionG
etUserCartInfo
(){
}
p
ublic
function
c
hangeItemQty
(
$sku
){
p
rotected
function
actionC
hangeItemQty
(
$sku
){
}
/**
* merge cart , if current cart currency is not equals to user cart currency when user login account.
*/
p
ublic
function
m
ergeCartAfterUserLogin
(){
p
rotected
function
actionM
ergeCartAfterUserLogin
(){
}
...
...
@@ -59,7 +59,7 @@ class Cart extends Service
* change current cart currency
* 1. check if currency is allowed to change.
*/
p
ublic
function
c
hangeCartCurrency
(){
p
rotected
function
actionC
hangeCartCurrency
(){
}
...
...
@@ -68,7 +68,7 @@ class Cart extends Service
* @property $language|String
* change current language , cart product language change to current language.
*/
p
ublic
function
c
hangeProductLanguage
(
$language
=
''
){
p
rotected
function
actionC
hangeProductLanguage
(
$language
=
''
){
}
...
...
@@ -77,7 +77,7 @@ class Cart extends Service
* @property $address|Array
* save cart address.like,, customer name,tel,email,address ,,etc,,.
*/
p
ublic
function
s
aveCartAddress
(
$address
){
p
rotected
function
actionS
aveCartAddress
(
$address
){
}
...
...
@@ -89,7 +89,7 @@ class Cart extends Service
* 3.change shipping cost after change
*
*/
p
ublic
function
s
aveCartShipping
(
$shippingId
){
p
rotected
function
actionS
aveCartShipping
(
$shippingId
){
}
...
...
@@ -99,7 +99,7 @@ class Cart extends Service
* 1.check if $paymentId is effective
* 2.add or change payment to cart.
*/
p
ublic
function
s
aveCartPayment
(
$paymentId
){
p
rotected
function
actionS
aveCartPayment
(
$paymentId
){
}
...
...
@@ -108,7 +108,7 @@ class Cart extends Service
* $item_ids
* remove cart items by $items_ids
*/
p
ublic
function
r
emoveItems
(
$item_ids
){
p
rotected
function
actionR
emoveItems
(
$item_ids
){
}
...
...
@@ -116,7 +116,7 @@ class Cart extends Service
/**
* clear cart product.
*/
p
ublic
function
c
learCart
(){
p
rotected
function
actionC
learCart
(){
}
...
...
@@ -124,7 +124,7 @@ class Cart extends Service
/**
* generate order by current Cart.
*/
p
ublic
function
g
enerateOrderByCart
(){
p
rotected
function
actionG
enerateOrderByCart
(){
}
...
...
@@ -135,7 +135,7 @@ class Cart extends Service
* 2. get all item sku and custom option.
* 3. add to cart like in product page ,click add to cart button.
*/
p
ublic
function
a
ddItemsByPendingOrder
(
$order_id
){
p
rotected
function
actionA
ddItemsByPendingOrder
(
$order_id
){
}
...
...
services/Customer.php
浏览文件 @
0b0922bc
...
...
@@ -22,7 +22,7 @@ class Customer extends Service
* @property $data|Array
* like :['email'=>'xxx@xxx.com','password'=>'xxxx']
*/
p
ublic
function
l
ogin
(
$data
){
p
rotected
function
actionL
ogin
(
$data
){
}
...
...
@@ -33,7 +33,7 @@ class Customer extends Service
* ,'sex','age',
* ]
*/
p
ublic
function
r
egister
(
$data
){
p
rotected
function
actionR
egister
(
$data
){
}
...
...
@@ -43,7 +43,7 @@ class Customer extends Service
* Get customer info by customerId, if customer id is empty, current customer id will be set,
* if current customer id is empty , false will be return .
*/
p
ublic
function
v
iewInfo
(
$customerId
=
''
){
p
rotected
function
actionV
iewInfo
(
$customerId
=
''
){
}
...
...
@@ -54,7 +54,7 @@ class Customer extends Service
* change customer password.
* if $customer id is empty, it will be equals current customer id.
*/
p
ublic
function
c
hangePassword
(
$password
,
$customerId
=
''
){
p
rotected
function
actionC
hangePassword
(
$password
,
$customerId
=
''
){
}
...
...
@@ -63,14 +63,14 @@ class Customer extends Service
* @property $customerId|Array
* ['firstname','lastname','password','customerId']
*/
p
ublic
function
c
hangeNameAndPassword
(
$data
){
p
rotected
function
actionC
hangeNameAndPassword
(
$data
){
}
/**
* get current customer identify.
*/
p
ublic
function
g
etCurrentAccount
(){
p
rotected
function
actionG
etCurrentAccount
(){
return
Yii
::
$app
->
user
->
identity
->
username
;
}
...
...
services/FecshopLang.php
浏览文件 @
0b0922bc
...
...
@@ -33,11 +33,11 @@ class Fecshoplang extends Service
* @property $langCode|String , language 2 code, like :en ,fr ,es,
* get language child language attr, like: title_fr
*/
p
ublic
function
g
etLangAttrName
(
$attrName
,
$langCode
){
p
rotected
function
actionG
etLangAttrName
(
$attrName
,
$langCode
){
return
$attrName
.
'_'
.
$langCode
;
}
p
ublic
function
g
etDefaultLangAttrName
(
$attrName
){
p
rotected
function
actionG
etDefaultLangAttrName
(
$attrName
){
return
$attrName
.
'_'
.
$this
->
defaultLangCode
;
}
...
...
@@ -47,7 +47,7 @@ class Fecshoplang extends Service
* get default language attr value.
* example getDefaultLangAttrVal(['title_en'=>'xx','title_fr'=>'yy'],'title');
*/
p
ublic
function
g
etDefaultLangAttrVal
(
$attrVal
,
$attrName
){
p
rotected
function
actionG
etDefaultLangAttrVal
(
$attrVal
,
$attrName
){
$defaultLangAttrName
=
$this
->
getDefaultLangAttrName
(
$attrName
);
if
(
isset
(
$attrVal
[
$defaultLangAttrName
])
&&
!
empty
(
$attrVal
[
$defaultLangAttrName
])){
return
$attrVal
[
$defaultLangAttrName
];
...
...
@@ -65,7 +65,7 @@ class Fecshoplang extends Service
* if attribute in default language value is empty, '' will be return.
* example getLangAttrVal(['title_en'=>'xx','title_fr'=>'yy'],'title','fr');
*/
p
ublic
function
g
etLangAttrVal
(
$attrVal
,
$attrName
,
$langCode
){
p
rotected
function
actionG
etLangAttrVal
(
$attrVal
,
$attrName
,
$langCode
){
$langAttrName
=
$this
->
getLangAttrName
(
$attrName
,
$langCode
);
if
(
isset
(
$attrVal
[
$langAttrName
])
&&
!
empty
(
$attrVal
[
$langAttrName
])){
return
$attrVal
[
$langAttrName
];
...
...
@@ -85,7 +85,7 @@ class Fecshoplang extends Service
* @return String , like en ,fr ,es , if $language is not exist in $this->allLangCode
* empty will be return.
*/
p
ublic
function
g
etLangCodeByLanguage
(
$language
){
p
rotected
function
actionG
etLangCodeByLanguage
(
$language
){
if
(
isset
(
$this
->
allLangCode
[
$language
])){
return
$this
->
allLangCode
[
$language
];
}
else
{
...
...
services/Order.php
浏览文件 @
0b0922bc
...
...
@@ -26,7 +26,7 @@ class Order extends Service
/**
* get all order collection
*/
p
ublic
function
g
etOrderList
(){
p
rotected
function
actionG
etOrderList
(){
}
...
...
@@ -34,14 +34,14 @@ class Order extends Service
/**
* get order list by customer account id.
*/
p
ublic
function
g
etAccountOrderList
(){
p
rotected
function
actionG
etAccountOrderList
(){
}
/**
* get order list by customer account id.
*/
p
ublic
function
c
hangeOrderStatus
(){
p
rotected
function
actionC
hangeOrderStatus
(){
}
...
...
@@ -49,7 +49,7 @@ class Order extends Service
/**
* get order by Id.
*/
p
ublic
function
g
etOrderById
(){
p
rotected
function
actionG
etOrderById
(){
}
...
...
services/Product.php
浏览文件 @
0b0922bc
...
...
@@ -20,11 +20,11 @@ class Product extends Service
{
private
$_productId
;
p
ublic
function
s
etCurrentProductId
(
$productId
){
p
rotected
function
actionS
etCurrentProductId
(
$productId
){
$this
->
_productId
=
$productId
;
}
p
ublic
function
g
etCurrentProductId
(){
p
rotected
function
actionG
etCurrentProductId
(){
return
$this
->
_productId
;
}
...
...
services/Search.php
浏览文件 @
0b0922bc
...
...
@@ -19,12 +19,12 @@ use fec\helpers\CSession;
class
Search
extends
Service
{
p
ublic
function
g
etProductList
(
$text
,
$filter
){
p
rotected
function
actionG
etProductList
(
$text
,
$filter
){
}
p
ublic
function
g
etHotSearchText
(){
p
rotected
function
actionG
etHotSearchText
(){
}
...
...
services/Store.php
浏览文件 @
0b0922bc
...
...
@@ -43,8 +43,6 @@ class Store extends Service
* current store code , this property will init value with store code.
*/
public
$currentStore
;
/**
* current language code example : fr es cn ru.
*/
...
...
@@ -55,13 +53,9 @@ class Store extends Service
* if current store_code is not config , InvalidValueException will be throw.
* class property $currentStore will be set value $store_code.
*/
public
function
actionBootstrap
(
$app
){
//Yii::$service = new \fecshop\services\Service;
//Yii::createObject($service);
protected
function
actionBootstrap
(
$app
){
$host
=
explode
(
'://'
,
$app
->
getHomeUrl
());
$stores
=
$this
->
stores
;
$init_compelte
=
0
;
if
(
is_array
(
$stores
)
&&
!
empty
(
$stores
)){
foreach
(
$stores
as
$store_code
=>
$store
){
...
...
@@ -97,7 +91,6 @@ class Store extends Service
}
else
{
$currency
=
''
;
}
Yii
::
$service
->
page
->
currency
->
initCurrency
(
$currency
);
/**
* current domian is config is store config.
...
...
@@ -110,7 +103,6 @@ class Store extends Service
if
(
!
$init_compelte
){
throw
new
InvalidValueException
(
'this domain is not config in store component'
);
}
}
/**
...
...
@@ -164,7 +156,7 @@ class Store extends Service
* if lang attribute in current store language is empty , default language attribute will be return.
* if attribute in default language value is empty, $attrVal will be return.
*/
p
ublic
function
g
etStoreAttrVal
(
$attrVal
,
$attrName
){
p
rotected
function
actionG
etStoreAttrVal
(
$attrVal
,
$attrName
){
$lang
=
$this
->
currentLangCode
;
return
Yii
::
$service
->
fecshoplang
->
getLangAttrVal
(
$attrVal
,
$attrName
,
$lang
);
}
...
...
@@ -173,7 +165,7 @@ class Store extends Service
* @return Array
* get all store info, one item in array format is: ['storeCode' => 'store language'].
*/
p
ublic
function
g
etStoresLang
(){
p
rotected
function
actionG
etStoresLang
(){
$stores
=
$this
->
stores
;
$topLang
=
[];
foreach
(
$stores
as
$storeCode
=>
$store
){
...
...
services/Url.php
浏览文件 @
0b0922bc
...
...
@@ -136,7 +136,7 @@ class Url extends Service
* Yii::$service->url->getUrlByPath('cms/article/index',['id'=>33]);
* Yii::$service->url->getUrlByPath('cms/article/index',['id'=>33],true);
*/
protected
function
g
etUrl
(
$path
,
$params
=
[],
$https
=
false
){
protected
function
actionG
etUrl
(
$path
,
$params
=
[],
$https
=
false
){
if
(
$https
){
$baseUrl
=
$this
->
getHttpsBaseUrl
();
}
else
{
...
...
@@ -155,7 +155,7 @@ class Url extends Service
/**
* get current base url , is was generate by http(or https ).'://'.store_code
*/
p
ublic
function
g
etCurrentBaseUrl
(){
p
rotected
function
actionG
etCurrentBaseUrl
(){
if
(
!
$this
->
_currentBaseUrl
){
$homeUrl
=
$this
->
homeUrl
();
if
(
$this
->
showScriptName
){
...
...
@@ -172,7 +172,7 @@ class Url extends Service
/**
* get current home url , is was generate by 'http://'.store_code
*/
p
ublic
function
h
omeUrl
(){
p
rotected
function
actionH
omeUrl
(){
return
Yii
::
$app
->
getHomeUrl
();
}
...
...
services/category/Menu.php
浏览文件 @
0b0922bc
...
...
@@ -26,7 +26,7 @@ class Menu extends Service
* get category menu as array. array key is: _id ,name ,urlPath,childMenu
*
*/
p
ublic
function
g
etCategoryMenuArr
(
$parentId
=
''
){
p
rotected
function
actionG
etCategoryMenuArr
(
$parentId
=
''
){
$arr
=
[];
if
(
!
$parentId
)
$parentId
=
$this
->
rootCategoryId
;
...
...
@@ -57,7 +57,7 @@ class Menu extends Service
* @property $categoryId|Array
* check if cateogry has child .
*/
p
ublic
function
hasChild
(
$categoryId
){
p
rotected
function
hasChild
(
$categoryId
){
$one
=
Category
::
find
()
->
asArray
()
->
where
([
'parent_id'
=>
$categoryId
])
->
one
();
...
...
services/category/Product.php
浏览文件 @
0b0922bc
...
...
@@ -41,7 +41,7 @@ class Product extends Service
]
*/
p
ublic
function
g
etFilterProduct
(
$filter
){
p
rotected
function
actionG
etFilterProduct
(
$filter
){
$where
=
isset
(
$filter
[
'where'
])
?
$filter
[
'where'
]
:
''
;
$categoryId
=
isset
(
$filter
[
'categoryId'
])
?
$filter
[
'categoryId'
]
:
''
;
if
(
$categoryId
){
...
...
services/cms/Article.php
浏览文件 @
0b0922bc
...
...
@@ -25,7 +25,6 @@ class Article extends Service
public
$storage
=
'mongodb'
;
protected
$_article
;
public
function
init
(){
if
(
$this
->
storage
==
'mongodb'
){
$this
->
_article
=
new
ArticleMongodb
;
...
...
@@ -43,13 +42,13 @@ class Article extends Service
/**
* get artile's primary key.
*/
p
ublic
function
g
etPrimaryKey
(){
p
rotected
function
actionG
etPrimaryKey
(){
return
$this
->
_article
->
getPrimaryKey
();
}
/**
* get artile model by primary key.
*/
p
ublic
function
g
etByPrimaryKey
(
$primaryKey
){
p
rotected
function
actionG
etByPrimaryKey
(
$primaryKey
){
return
$this
->
_article
->
getByPrimaryKey
(
$primaryKey
);
}
...
...
@@ -73,7 +72,7 @@ class Article extends Service
* 'asArray' => true,
* ]
*/
p
ublic
function
c
oll
(
$filter
=
''
){
p
rotected
function
actionC
oll
(
$filter
=
''
){
return
$this
->
_article
->
coll
(
$filter
);
}
...
...
@@ -82,11 +81,11 @@ class Article extends Service
* @property $originUrlKey|String , article origin url key.
* save $data to cms model,then,add url rewrite info to system service urlrewrite.
*/
p
ublic
function
s
ave
(
$one
,
$originUrlKey
){
p
rotected
function
actionS
ave
(
$one
,
$originUrlKey
){
return
$this
->
_article
->
save
(
$one
,
$originUrlKey
);
}
p
ublic
function
r
emove
(
$ids
){
p
rotected
function
actionR
emove
(
$ids
){
return
$this
->
_article
->
remove
(
$ids
);
}
...
...
services/helper/Log.php
浏览文件 @
0b0922bc
...
...
@@ -22,12 +22,9 @@ use fecshop\models\mongodb\FecshopServiceLog;
*/
class
Log
extends
Service
{
public
$log_config
;
protected
$_serviceContent
;
protected
$_serviceUid
;
public
$log_config
;
protected
$_isServiceLog
;
protected
$_isServiceLogDbPrint
;
protected
$_isServiceLogHtmlPrint
;
...
...
services/page/Asset.php
浏览文件 @
0b0922bc
...
...
@@ -18,14 +18,13 @@ use yii\web\AssetBundle;
use
yii\base\Object
;
use
yii\helpers\ArrayHelper
;
use
yii\helpers\Url
;
/**
* page asset services
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
extends AssetBundle
*/
class
Asset
class
Asset
extends
Service
{
public
$cssOptions
;
public
$jsOptions
;
...
...
@@ -38,7 +37,7 @@ class Asset
/**
* 文件路径默认放到模板路径下面的assets里面
*/
p
ublic
function
r
egister
(
$view
){
p
rotected
function
actionR
egister
(
$view
){
$assetArr
=
[];
$themeDir
=
Yii
::
$service
->
page
->
theme
->
getThemeDirArr
();
if
(
is_array
(
$themeDir
)
&&
!
empty
(
$themeDir
)){
...
...
@@ -103,7 +102,7 @@ class Asset
}
p
ublic
function
initOptions
(
$options
){
p
rotected
function
initOptions
(
$options
){
if
(
isset
(
$options
[
'position'
])){
if
(
$options
[
'position'
]
==
'POS_HEAD'
){
$options
[
'position'
]
=
\
yii\web\View
::
POS_HEAD
;
...
...
services/page/Breadcrumbs.php
浏览文件 @
0b0922bc
...
...
@@ -25,15 +25,6 @@ class Breadcrumbs extends Service
public
$intervalSymbol
=
' > '
;
protected
$_items
;
/**
* property $items|Array. add $items to $this->_items.
* $items format example.
* $items = ['name'=>'fashion handbag','url'=>'http://www.xxx.com'];
*/
public
function
addItems
(
$items
){
$this
->
_items
[]
=
$items
;
}
public
function
init
(){
if
(
$this
->
homeName
){
$items
[
'name'
]
=
$this
->
homeName
;
...
...
@@ -43,10 +34,21 @@ class Breadcrumbs extends Service
}
}
/**
* property $items|Array. add $items to $this->_items.
* $items format example.
* $items = ['name'=>'fashion handbag','url'=>'http://www.xxx.com'];
*/
protected
function
actionAddItems
(
$items
){
$this
->
_items
[]
=
$items
;
}
/**
* generate Breadcrumbs html ,before generate , you should use addItems function to add breadcrumbs items.
*/
p
ublic
function
g
enerateHtml
(){
p
rotected
function
actionG
enerateHtml
(){
$arr
=
[];
if
(
$this
->
_items
){
foreach
(
$this
->
_items
as
$item
){
...
...
services/page/Menu.php
浏览文件 @
0b0922bc
...
...
@@ -55,7 +55,7 @@ class Menu extends Service
]
]
*/
p
ublic
function
g
etMenuData
(){
p
rotected
function
actionG
etMenuData
(){
$this
->
_homeUrl
=
CUrl
::
getHomeUrl
();
$arr
=
[];
if
(
$displayHome
=
$this
->
displayHome
){
...
...
services/page/Newsletter.php
浏览文件 @
0b0922bc
...
...
@@ -25,7 +25,7 @@ class Newsletter extends Service
/**
* newsletter subscription
*/
p
ublic
function
s
ubscription
(
$email
){
p
rotected
function
actionS
ubscription
(
$email
){
$mongoNewsletter
=
new
MongoNewsletter
();
$mongoNewsletter
->
attributes
=
[
'email'
=>
$email
,
...
...
@@ -58,7 +58,7 @@ class Newsletter extends Service
* @property $filter|array
* get subscription email collection
*/
p
ublic
function
g
etSubscriptionList
(
$filter
){
p
rotected
function
actionG
etSubscriptionList
(
$filter
){
}
...
...
services/page/Theme.php
浏览文件 @
0b0922bc
...
...
@@ -45,7 +45,7 @@ class Theme extends Service
protected
$_themeDirArr
;
p
ublic
function
g
etThemeDirArr
(){
p
rotected
function
actionG
etThemeDirArr
(){
if
(
!
$this
->
_themeDirArr
){
$arr
=
[];
if
(
$localThemeDir
=
Yii
::
getAlias
(
$this
->
localThemeDir
)){
...
...
@@ -67,7 +67,7 @@ class Theme extends Service
/**
* find theme file by mutil theme ,if not find view file and $throwError=true, it will throw InvalidValueException.
*/
p
ublic
function
g
etViewFile
(
$view
,
$throwError
=
true
){
p
rotected
function
actionG
etViewFile
(
$view
,
$throwError
=
true
){
$view
=
trim
(
$view
);
if
(
substr
(
$view
,
0
,
1
)
==
'@'
){
return
Yii
::
getAlias
(
$view
);
...
...
services/page/Translate.php
浏览文件 @
0b0922bc
...
...
@@ -38,7 +38,7 @@ class Translate extends Service
}
}
p
ublic
function
s
etLanguage
(
$language
){
p
rotected
function
actionS
etLanguage
(
$language
){
Yii
::
$app
->
language
=
$language
;
}
...
...
services/page/Widget.php
浏览文件 @
0b0922bc
...
...
@@ -43,7 +43,7 @@ class Widget extends Service
]
]
*/
p
ublic
function
r
ender
(
$configKey
,
$parentThis
=
''
){
p
rotected
function
actionR
ender
(
$configKey
,
$parentThis
=
''
){
$config
=
''
;
if
(
is_array
(
$configKey
)){
$config
=
$configKey
;
...
...
@@ -59,33 +59,7 @@ class Widget extends Service
return
$this
->
renderContent
(
$configKey
,
$config
,
$parentThis
);
}
protected
function
renderContent
(
$configKey
,
$config
,
$parentThis
=
''
){
if
(
isset
(
$config
[
'cache'
][
'enable'
])
&&
$config
[
'cache'
][
'enable'
]){
if
(
!
isset
(
$config
[
'class'
])
||
!
$config
[
'class'
]){
throw
new
InvalidConfigException
(
'in widget ['
.
$configKey
.
'],you enable cache ,you must config widget class .'
);
}
else
if
(
$ob
=
new
$config
[
'class'
]){
if
(
$ob
instanceof
BlockCache
){
$cacheKey
=
$ob
->
getCacheKey
();
if
(
!
(
$content
=
CCache
::
get
(
$cacheKey
))){
$cache
=
$config
[
'cache'
];
$timeout
=
isset
(
$cache
[
'timeout'
])
?
$cache
[
'timeout'
]
:
0
;
unset
(
$config
[
'cache'
]);
$content
=
$this
->
renderContentHtml
(
$configKey
,
$config
,
$parentThis
);
CCache
::
set
(
$cacheKey
,
$content
,
$timeout
);
}
return
$content
;
}
else
{
throw
new
InvalidConfigException
(
$config
[
'class'
]
.
' must implete fecshop\interfaces\block\BlockCache when you use block cache .'
);
}
}
}
$content
=
$this
->
renderContentHtml
(
$configKey
,
$config
,
$parentThis
);
return
$content
;
}
public
function
renderContentHtml
(
$configKey
,
$config
,
$parentThis
=
''
){
protected
function
actionRenderContentHtml
(
$configKey
,
$config
,
$parentThis
=
''
){
if
(
!
isset
(
$config
[
'view'
])
||
empty
(
$config
[
'view'
])
){
throw
new
InvalidConfigException
(
'view and class must exist in array config!'
);
...
...
@@ -120,6 +94,34 @@ class Widget extends Service
}
protected
function
renderContent
(
$configKey
,
$config
,
$parentThis
=
''
){
if
(
isset
(
$config
[
'cache'
][
'enable'
])
&&
$config
[
'cache'
][
'enable'
]){
if
(
!
isset
(
$config
[
'class'
])
||
!
$config
[
'class'
]){
throw
new
InvalidConfigException
(
'in widget ['
.
$configKey
.
'],you enable cache ,you must config widget class .'
);
}
else
if
(
$ob
=
new
$config
[
'class'
]){
if
(
$ob
instanceof
BlockCache
){
$cacheKey
=
$ob
->
getCacheKey
();
if
(
!
(
$content
=
CCache
::
get
(
$cacheKey
))){
$cache
=
$config
[
'cache'
];
$timeout
=
isset
(
$cache
[
'timeout'
])
?
$cache
[
'timeout'
]
:
0
;
unset
(
$config
[
'cache'
]);
$content
=
$this
->
renderContentHtml
(
$configKey
,
$config
,
$parentThis
);
CCache
::
set
(
$cacheKey
,
$content
,
$timeout
);
}
return
$content
;
}
else
{
throw
new
InvalidConfigException
(
$config
[
'class'
]
.
' must implete fecshop\interfaces\block\BlockCache when you use block cache .'
);
}
}
}
$content
=
$this
->
renderContentHtml
(
$configKey
,
$config
,
$parentThis
);
return
$content
;
}
/**
* find theme file by mutil theme ,if not find view file and $throwError=true, it will throw InvalidValueException.
*/
...
...
services/product/BestSell.php
浏览文件 @
0b0922bc
...
...
@@ -21,7 +21,7 @@ class BestSell extends Service
* 得到全部产品中热销的产品
*/
p
ublic
function
g
etCategoryProduct
()
p
rotected
function
actionG
etCategoryProduct
()
{
return
'category best sell product'
;
}
...
...
@@ -29,7 +29,7 @@ class BestSell extends Service
/**
* 得到全部产品中热销的产品
*/
p
ublic
function
g
etProduct
(){
p
rotected
function
actionG
etProduct
(){
}
...
...
services/product/Coll.php
浏览文件 @
0b0922bc
...
...
@@ -56,7 +56,7 @@ class Coll extends Service
* 'asArray' => true,
* ]
*/
p
ublic
function
g
etProducts
(
$filter
){
p
rotected
function
actionG
etProducts
(
$filter
){
$numPerPage
=
isset
(
$filter
[
'numPerPage'
])
?
$filter
[
'numPerPage'
]
:
$this
->
numPerPage
;
$pageNum
=
isset
(
$filter
[
'pageNum'
])
?
$filter
[
'pageNum'
]
:
$this
->
pageNum
;
$orderBy
=
isset
(
$filter
[
'orderBy'
])
?
$filter
[
'orderBy'
]
:
$this
->
orderBy
;
...
...
services/product/Image.php
浏览文件 @
0b0922bc
...
...
@@ -70,7 +70,7 @@ class Image extends Service
* return , if success ,return image saved relative file path , like '/b/i/big.jpg'
* if fail, reutrn false;
*/
p
ublic
function
s
aveProductUploadImg
(
$param_img_file
){
p
rotected
function
actionS
aveProductUploadImg
(
$param_img_file
){
$this
->
initUploadImage
();
$size
=
$param_img_file
[
'size'
];
$file
=
$param_img_file
[
'tmp_name'
];
...
...
services/product/Info.php
浏览文件 @
0b0922bc
...
...
@@ -30,7 +30,7 @@ class Info extends Service
* image will return full image url
* this function will be use for front product info page.
*/
p
ublic
function
g
etProduct
(
$productId
=
''
,
$selectAttr
=
[])
p
rotected
function
actionG
etProduct
(
$productId
=
''
,
$selectAttr
=
[])
{
//echo 33;exit;
if
(
!
$this
->
_product
){
...
...
@@ -59,7 +59,7 @@ class Info extends Service
* @property $product is object.
* convert product language attribute to current language value.
*/
p
ublic
function
g
etCurrentLangProduct
(
$product
){
p
rotected
function
actionG
etCurrentLangProduct
(
$product
){
$lang_attrs
=
$this
->
getLangAttr
();
foreach
(
$lang_attrs
as
$attr
){
$product
->
$attr
=
Yii
::
$service
->
store
->
getLangVal
(
$product
->
$attr
,
$attr
);
...
...
@@ -69,7 +69,7 @@ class Info extends Service
/**
* product language attributes array.
*/
p
ublic
function
g
etLangAttr
(){
p
rotected
function
actionG
etLangAttr
(){
return
[
'name'
,
'title'
,
...
...
services/url/Rewrite.php
浏览文件 @
0b0922bc
...
...
@@ -34,20 +34,20 @@ class Rewrite extends Service
}
}
p
ublic
function
actionGetOriginUrl
(
$urlKey
){
p
rotected
function
actionGetOriginUrl
(
$urlKey
){
return
$this
->
_urlRewrite
->
getOriginUrl
(
$urlKey
);
}
/**
* get artile's primary key.
*/
p
ublic
function
actionGetPrimaryKey
(){
p
rotected
function
actionGetPrimaryKey
(){
return
$this
->
_urlRewrite
->
getPrimaryKey
();
}
/**
* get artile model by primary key.
*/
p
ublic
function
actionGetByPrimaryKey
(
$primaryKey
){
p
rotected
function
actionGetByPrimaryKey
(
$primaryKey
){
return
$this
->
_urlRewrite
->
getByPrimaryKey
(
$primaryKey
);
}
...
...
@@ -73,7 +73,7 @@ class Rewrite extends Service
* 'asArray' => true,
* ]
*/
p
ublic
function
actionColl
(
$filter
=
''
){
p
rotected
function
actionColl
(
$filter
=
''
){
return
$this
->
_urlRewrite
->
coll
(
$filter
);
}
...
...
@@ -82,24 +82,24 @@ class Rewrite extends Service
* @property $originUrlKey|String , article origin url key.
* save $data to cms model,then,add url rewrite info to system service urlrewrite.
*/
p
ublic
function
actionSave
(
$one
){
p
rotected
function
actionSave
(
$one
){
return
$this
->
_urlRewrite
->
save
(
$one
);
}
p
ublic
function
actionRemove
(
$ids
){
p
rotected
function
actionRemove
(
$ids
){
return
$this
->
_urlRewrite
->
remove
(
$ids
);
}
p
ublic
function
actionFind
(){
p
rotected
function
actionFind
(){
return
$this
->
_urlRewrite
->
find
();
}
p
ublic
function
actionFindOne
(
$where
){
p
rotected
function
actionFindOne
(
$where
){
return
$this
->
_urlRewrite
->
findOne
(
$where
);
}
p
ublic
function
actionNewModel
(){
p
rotected
function
actionNewModel
(){
return
$this
->
_urlRewrite
->
newModel
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录