切换导航条
此项目
正在载入...
登录
李忠强
/
temporaryfood
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
李忠强
3 years ago
提交
c0237df8adf6e4586561b38aef2cdfab27634fa5
1 个父辈
54ba9cbb
更新
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
16 行增加
和
13 行删除
application/api/controller/Goods.php
application/api/controller/Goods.php
查看文件 @
c0237df
...
...
@@ -121,21 +121,24 @@ class Goods extends Api
->
where
(
'goods_id'
,
$goods_id
)
->
select
();
$array
=
[];
foreach
(
$list
as
$key
=>
$value
){
if
(
!
isset
(
$array
[
$value
[
'spec_id'
]])){
$array
[
$value
[
'spec_id'
]][
'name'
]
=
Db
::
name
(
'litestore_spec'
)
->
where
(
'id'
,
$value
[
'spec_id'
])
->
value
(
'spec_name'
);
$goods
=
\app\api\model\Goods
::
get
(
$goods_id
);
if
(
$goods
[
'spec_type'
]
==
20
){
foreach
(
$list
as
$key
=>
$value
){
if
(
!
isset
(
$array
[
$value
[
'spec_id'
]])){
$array
[
$value
[
'spec_id'
]][
'name'
]
=
Db
::
name
(
'litestore_spec'
)
->
where
(
'id'
,
$value
[
'spec_id'
])
->
value
(
'spec_name'
);
}
$spec_value
=
Db
::
name
(
'litestore_spec_value'
)
->
where
(
'id'
,
$value
[
'spec_value_id'
])
->
value
(
'spec_value'
);
$array
[
$value
[
'spec_id'
]][
'second'
][]
=
[
'id'
=>
$value
[
'spec_value_id'
],
'name'
=>
$spec_value
];
}
$spec_value
=
Db
::
name
(
'litestore_spec_value'
)
->
where
(
'id'
,
$value
[
'spec_value_id'
])
->
value
(
'spec_value'
);
$array
[
$value
[
'spec_id'
]][
'second'
][]
=
[
'id'
=>
$value
[
'spec_value_id'
],
'name'
=>
$spec_value
];
$array
=
array_values
(
$array
);
}
$array
=
array_values
(
$array
);
$goods_spec
=
GoodsSpec
::
all
([
'goods_id'
=>
$goods_id
]);
$this
->
success
(
'商品规格'
,[
'list'
=>
$goods_spec
,
'sku'
=>
$array
]);
}
...
...
请
注册
或
登录
后发表评论