Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
d76c6cee
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,发现更多精彩内容 >>
提交
d76c6cee
编写于
3月 11, 2017
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
php mongodb扩展升级2.0,支持php7,已兼容,使用php ext-mongodb扩展,ext-mongo扩展可以废除
上级
ac649a03
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
13 addition
and
13 deletion
+13
-13
app/appfront/modules/Customer/block/productfavorite/Index.php
...appfront/modules/Customer/block/productfavorite/Index.php
+1
-1
services/Product.php
services/Product.php
+1
-1
services/category/CategoryMongodb.php
services/category/CategoryMongodb.php
+2
-2
services/cms/article/ArticleMongodb.php
services/cms/article/ArticleMongodb.php
+1
-1
services/cms/staticblock/StaticBlockMongodb.php
services/cms/staticblock/StaticBlockMongodb.php
+2
-2
services/product/Favorite.php
services/product/Favorite.php
+1
-1
services/product/ProductMongodb.php
services/product/ProductMongodb.php
+3
-3
services/product/Review.php
services/product/Review.php
+1
-1
services/search/XunSearch.php
services/search/XunSearch.php
+1
-1
未找到文件。
app/appfront/modules/Customer/block/productfavorite/Index.php
浏览文件 @
d76c6cee
...
...
@@ -56,7 +56,7 @@ class Index {
foreach
(
$coll
as
$one
){
$p_id
=
$one
[
'product_id'
];
$product_ids
[]
=
new
\
MongoId
(
$p_id
)
;
$product_ids
[]
=
new
\
Mongo
DB\BSON\Object
Id
(
$p_id
)
;
$favorites
[
$p_id
]
=
[
'updated_at'
=>
$one
[
'updated_at'
],
'favorite_id'
=>
(
string
)
$one
[
'_id'
],
...
...
services/Product.php
浏览文件 @
d76c6cee
...
...
@@ -284,7 +284,7 @@ class Product extends Service
if
(
!
empty
(
$ids
)
&&
is_array
(
$ids
)){
$ids_ob_arr
=
[];
foreach
(
$ids
as
$id
){
$ids_ob_arr
[]
=
new
\
MongoId
(
$id
);
$ids_ob_arr
[]
=
new
\
Mongo
DB\BSON\Object
Id
(
$id
);
}
$filter
=
[
'where'
=>
[
...
...
services/category/CategoryMongodb.php
浏览文件 @
d76c6cee
...
...
@@ -85,7 +85,7 @@ class CategoryMongodb implements CategoryInterface
$model
=
new
Category
;
$model
->
created_at
=
time
();
$model
->
created_user_id
=
\
fec\helpers\CUser
::
getCurrentUserId
();
$primaryVal
=
new
\
Mongo
Id
;
$primaryVal
=
new
\
Mongo
DB\BSON\ObjectId
()
;
$model
->
{
$this
->
getPrimaryKey
()}
=
$primaryVal
;
$parent_id
=
$one
[
'parent_id'
];
}
...
...
@@ -224,7 +224,7 @@ class CategoryMongodb implements CategoryInterface
if
(
$parent_id
===
'0'
){
return
[];
}
$category
=
Category
::
find
()
->
asArray
()
->
where
([
'_id'
=>
new
\
MongoId
(
$parent_id
)])
->
one
();
$category
=
Category
::
find
()
->
asArray
()
->
where
([
'_id'
=>
new
\
Mongo
DB\BSON\Object
Id
(
$parent_id
)])
->
one
();
if
(
isset
(
$category
[
'_id'
])
&&
!
empty
(
$category
[
'_id'
])
){
$currentUrlKey
=
$category
[
'url_key'
];
$currentName
=
$category
[
'name'
];
...
...
services/cms/article/ArticleMongodb.php
浏览文件 @
d76c6cee
...
...
@@ -70,7 +70,7 @@ class ArticleMongodb implements ArticleInterface
$model
=
new
Article
;
$model
->
created_at
=
time
();
$model
->
created_user_id
=
\
fec\helpers\CUser
::
getCurrentUserId
();
$primaryVal
=
new
\
Mongo
Id
;
$primaryVal
=
new
\
Mongo
DB\BSON\ObjectId
()
;
$model
->
{
$this
->
getPrimaryKey
()}
=
$primaryVal
;
}
$model
->
updated_at
=
time
();
...
...
services/cms/staticblock/StaticBlockMongodb.php
浏览文件 @
d76c6cee
...
...
@@ -81,7 +81,7 @@ class StaticBlockMongodb implements StaticBlockInterface
$model
=
new
StaticBlock
;
$model
->
created_at
=
time
();
$model
->
created_user_id
=
\
fec\helpers\CUser
::
getCurrentUserId
();
$primaryVal
=
new
\
Mongo
Id
;
$primaryVal
=
new
\
Mongo
DB\BSON\ObjectId
()
;
$model
->
{
$this
->
getPrimaryKey
()}
=
$primaryVal
;
}
...
...
@@ -99,7 +99,7 @@ class StaticBlockMongodb implements StaticBlockInterface
$query
=
StaticBlock
::
find
()
->
asArray
();
$query
->
where
([
'identify'
=>
$identify
]);
if
(
$primaryVal
){
$query
->
andWhere
([
$id
=>
[
'$ne'
=>
new
\
MongoId
(
$primaryVal
)]]);
$query
->
andWhere
([
$id
=>
[
'$ne'
=>
new
\
Mongo
DB\BSON\Object
Id
(
$primaryVal
)]]);
}
$one
=
$query
->
one
();
...
...
services/product/Favorite.php
浏览文件 @
d76c6cee
...
...
@@ -150,7 +150,7 @@ class Favorite extends Service
$user_id
=
$identity
[
'id'
];
$one
=
FavoriteModel
::
findOne
([
'_id'
=>
new
\
MongoId
(
$favorite_id
),
'_id'
=>
new
\
Mongo
DB\BSON\Object
Id
(
$favorite_id
),
'user_id'
=>
$user_id
,
]);
if
(
$one
[
'_id'
]){
...
...
services/product/ProductMongodb.php
浏览文件 @
d76c6cee
...
...
@@ -119,7 +119,7 @@ class ProductMongodb implements ProductInterface
$query
=
Product
::
find
()
->
asArray
();
$mongoIds
=
[];
foreach
(
$product_id_arr
as
$id
){
$mongoIds
[]
=
new
\
MongoId
(
$id
);
$mongoIds
[]
=
new
\
Mongo
DB\BSON\Object
Id
(
$id
);
}
//var_dump($mongoIds);
$query
->
where
([
'in'
,
$this
->
getPrimaryKey
(),
$mongoIds
]);
...
...
@@ -158,7 +158,7 @@ class ProductMongodb implements ProductInterface
}
#验证sku 是否重复
$product_one
=
Product
::
find
()
->
asArray
()
->
where
([
'<>'
,
$this
->
getPrimaryKey
(),(
new
\
MongoId
(
$primaryVal
))
'<>'
,
$this
->
getPrimaryKey
(),(
new
\
Mongo
DB\BSON\Object
Id
(
$primaryVal
))
])
->
andWhere
([
'sku'
=>
$one
[
'sku'
],
])
->
one
();
...
...
@@ -170,7 +170,7 @@ class ProductMongodb implements ProductInterface
$model
=
new
Product
;
$model
->
created_at
=
time
();
$model
->
created_user_id
=
\
fec\helpers\CUser
::
getCurrentUserId
();
$primaryVal
=
new
\
Mongo
Id
;
$primaryVal
=
new
\
Mongo
DB\BSON\ObjectId
()
;
$model
->
{
$this
->
getPrimaryKey
()}
=
$primaryVal
;
#验证sku 是否重复
$product_one
=
Product
::
find
()
->
asArray
()
->
where
([
...
...
services/product/Review.php
浏览文件 @
d76c6cee
...
...
@@ -239,7 +239,7 @@ class Review extends Service
}
else
{
$model
=
new
ReviewModel
;
$model
->
created_admin_user_id
=
\
fec\helpers\CUser
::
getCurrentUserId
();
$primaryVal
=
new
\
Mongo
Id
;
$primaryVal
=
new
\
Mongo
DB\BSON\ObjectId
()
;
$model
->
{
$this
->
getPrimaryKey
()}
=
$primaryVal
;
}
//$review_data['status'] = ReviewModel::ACTIVE_STATUS;
...
...
services/search/XunSearch.php
浏览文件 @
d76c6cee
...
...
@@ -149,7 +149,7 @@ class XunSearch extends Service implements SearchInterface
$limit
=
$numPerPage
;
$productIds
=
[];
foreach
(
$data
as
$d
){
$productIds
[]
=
new
\
MongoId
(
$d
[
'_id'
]);
$productIds
[]
=
new
\
Mongo
DB\BSON\Object
Id
(
$d
[
'_id'
]);
}
$productIds
=
array_slice
(
$productIds
,
$offset
,
$limit
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录