切换导航条
此项目
正在载入...
登录
李忠强
/
temporaryfood
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
李忠强
3 years ago
提交
3d715690292f8c0b383f5e9eafc5fca27cea85f1
1 个父辈
f0842529
更新
隐藏空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
56 行增加
和
6 行删除
application/admin/controller/litestore/Litestorenews.php
application/admin/lang/zh-cn/litestore/litestorenews.php
application/admin/model/litestore/Litestorenews.php
application/admin/view/litestore/litestorenews/add.html
application/admin/view/litestore/litestorenews/edit.html
application/api/controller/Index.php
public/assets/js/backend/litestore/litestorenews.js
application/admin/controller/litestore/Litestorenews.php
查看文件 @
3d71569
...
...
@@ -23,6 +23,7 @@ class Litestorenews extends Backend
parent
::
_initialize
();
$this
->
model
=
new
\app\admin\model\litestore\Litestorenews
;
$this
->
view
->
assign
(
"statusList"
,
$this
->
model
->
getStatusList
());
$this
->
view
->
assign
(
"typeList"
,
$this
->
model
->
getTypeList
());
}
/**
...
...
application/admin/lang/zh-cn/litestore/litestorenews.php
查看文件 @
3d71569
...
...
@@ -7,5 +7,9 @@ return [
'Content'
=>
'内容'
,
'Createtime'
=>
'添加时间'
,
'Updatetime'
=>
'更新时间'
,
'Status'
=>
'状态'
'Status'
=>
'状态'
,
'Type'
=>
'类型'
,
'Type 1'
=>
'邀请有奖'
,
'Type 2'
=>
'商品详情'
,
'Goods_id'
=>
'商品选择'
,
];
...
...
application/admin/model/litestore/Litestorenews.php
查看文件 @
3d71569
...
...
@@ -26,7 +26,12 @@ class Litestorenews extends Model
public
function
getStatusList
()
{
return
[
'normal'
=>
__
(
'Normal'
),
'hidden'
=>
__
(
'Hidden'
)];
}
}
public
function
getTypeList
()
{
return
[
'1'
=>
__
(
'Type 1'
),
'2'
=>
__
(
'Type 2'
)];
}
public
function
getStatusTextAttr
(
$value
,
$data
)
...
...
application/admin/view/litestore/litestorenews/add.html
查看文件 @
3d71569
...
...
@@ -6,6 +6,12 @@
<!-- </div>-->
<!-- </div>-->
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-title"
data-source=
"litestore/Litestoregoods/index"
data-field=
"goods_name"
class=
"form-control selectpage"
name=
"row[goods_id]"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Image')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"input-group"
>
...
...
@@ -26,12 +32,24 @@
<!-- </div>-->
<!-- </div>-->
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('
Status
')}:
</label>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('
Type
')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"radio"
>
{foreach name="typeList" item="vo"}
<label
for=
"row[type]-{$key}"
><input
id=
"row[type]-{$key}"
name=
"row[type]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"1"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Status')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"radio"
>
{foreach name="statusList" item="vo"}
<label
for=
"row[status]-{$key}"
><input
id=
"row[status]-{$key}"
name=
"row[status]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"normal"
}
checked
{/
in
}
/>
{$vo}
</label>
<label
for=
"row[status]-{$key}"
><input
id=
"row[status]-{$key}"
name=
"row[status]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"normal"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
...
...
application/admin/view/litestore/litestorenews/edit.html
查看文件 @
3d71569
...
...
@@ -7,6 +7,12 @@
<!-- </div>-->
<!-- </div>-->
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-title"
data-source=
"litestore/Litestoregoods/index"
data-field=
"goods_name"
class=
"form-control selectpage"
name=
"row[goods_id]"
type=
"text"
value=
"{$row.goods_id}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Image')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"input-group"
>
...
...
@@ -27,6 +33,18 @@
<!-- </div>-->
<!-- </div>-->
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Type')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"radio"
>
{foreach name="typeList" item="vo"}
<label
for=
"row[type]-{$key}"
><input
id=
"row[type]-{$key}"
name=
"row[type]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"$row.type"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Status')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
...
...
application/api/controller/Index.php
查看文件 @
3d71569
...
...
@@ -25,15 +25,18 @@ class Index extends Api
'code':'1',
'msg':'返回成功'
'data':'轮播图数组'
'type':'类型:1=邀请有奖,2=商品详情'
'goods_id':'商品id'
'image':'轮播图'
})
*/
public
function
banner
()
{
$model
=
new
News
();
$list
=
$model
->
where
(
'status'
,
'normal'
)
->
column
(
'image'
);
$list
=
$model
->
where
(
'status'
,
'normal'
)
->
field
(
'type,goods_id,image'
)
->
select
(
);
foreach
(
$list
as
$key
=>
&
$value
){
$value
=
cdnurl
(
$value
,
true
);
$value
[
'image'
]
=
cdnurl
(
$value
[
'image'
]
,
true
);
}
$this
->
success
(
'banner'
,
$list
);
}
...
...
public/assets/js/backend/litestore/litestorenews.js
查看文件 @
3d71569
...
...
@@ -32,6 +32,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{
field
:
'image'
,
title
:
__
(
'Image'
),
formatter
:
Table
.
api
.
formatter
.
image
},
{
field
:
'createtime'
,
title
:
__
(
'Createtime'
),
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'updatetime'
,
title
:
__
(
'Updatetime'
),
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'type'
,
title
:
__
(
'Type'
),
searchList
:
{
"1"
:
__
(
'Type 1'
),
"2"
:
__
(
'Type 2'
)},
formatter
:
Table
.
api
.
formatter
.
status
},
{
field
:
'status'
,
title
:
__
(
'Status'
),
searchList
:
{
"normal"
:
__
(
'Normal'
),
"hidden"
:
__
(
'Hidden'
)},
formatter
:
Table
.
api
.
formatter
.
status
},
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
]
...
...
请
注册
或
登录
后发表评论