Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
32372590
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 搜索 >>
提交
32372590
编写于
7月 26, 2019
作者:
T
Terry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
product attr service and model
上级
dda8bc72
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
1 deletion
+39
-1
services/product/Attr.php
services/product/Attr.php
+11
-0
services/product/attr/AttrMysqldb.php
services/product/attr/AttrMysqldb.php
+28
-1
未找到文件。
services/product/Attr.php
浏览文件 @
32372590
...
...
@@ -121,6 +121,16 @@ class Attr extends Service
return
$this
->
_attr
->
remove
(
$ids
);
}
protected
function
actionGetActiveColl
(
$ids
)
{
return
$this
->
_attr
->
remove
(
$ids
);
}
public
function
getActiveAllColl
()
{
return
$this
->
_attr
->
getActiveAllColl
();
}
public
function
getAttrTypes
()
{
...
...
@@ -146,6 +156,7 @@ class Attr extends Service
'inputString-Lang'
=>
'inputString-Lang'
,
'inputEmail'
=>
'inputEmail'
,
'inputDate'
=>
'inputDate'
,
'editSelect'
=>
'editSelect'
,
'select'
=>
'select'
,
];
...
...
services/product/attr/AttrMysqldb.php
浏览文件 @
32372590
...
...
@@ -100,7 +100,7 @@ class AttrMysqldb extends Service implements AttrInterface
*/
public
function
save
(
$one
)
{
$primaryVal
=
isset
(
$one
[
$this
->
getPrimaryKey
()])
?
$one
[
$this
->
getPrimaryKey
()]
:
''
;
$primaryVal
=
isset
(
$one
[
$this
->
getPrimaryKey
()])
?
$one
[
$this
->
getPrimaryKey
()]
:
''
;
if
(
$primaryVal
)
{
$model
=
$this
->
_attrModel
->
findOne
(
$primaryVal
);
if
(
!
$model
)
{
...
...
@@ -141,4 +141,31 @@ class AttrMysqldb extends Service implements AttrInterface
return
true
;
}
public
function
getActiveAllColl
()
{
// attribute Group
$filter
=
[
'where'
=>
[
[
'status'
=>
$this
->
getEnableStatus
()]
],
'fetchAll'
=>
true
,
'asArray'
=>
true
,
];
$query
=
$this
->
_attrModel
->
find
();
$query
=
Yii
::
$service
->
helper
->
ar
->
getCollByFilter
(
$query
,
$filter
);
$coll
=
$query
->
all
();
if
(
is_array
(
$coll
))
{
foreach
(
$coll
as
$k
=>
$one
)
{
if
(
$one
[
'display_data'
])
{
$coll
[
$k
][
'display_data'
]
=
unserialize
(
$one
[
'display_data'
]);
}
}
return
$coll
;
}
return
null
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录