正在显示
6 个修改的文件
包含
37 行增加
和
6 行删除
@@ -51,12 +51,12 @@ class Litestorenews extends Backend | @@ -51,12 +51,12 @@ class Litestorenews extends Backend | ||
51 | if ($this->dataLimit && $this->dataLimitFieldAutoFill) { | 51 | if ($this->dataLimit && $this->dataLimitFieldAutoFill) { |
52 | $params[$this->dataLimitField] = $this->auth->id; | 52 | $params[$this->dataLimitField] = $this->auth->id; |
53 | } | 53 | } |
54 | - if($params['type'] == 1 && empty($params['goods_id'])) { | ||
55 | - $this->error('请选择商品'); | ||
56 | - } | ||
57 | if($params['type'] == 2 && empty($params['href'])) { | 54 | if($params['type'] == 2 && empty($params['href'])) { |
58 | $this->error('请填写链接'); | 55 | $this->error('请填写链接'); |
59 | } | 56 | } |
57 | + if($params['type'] == 3 && empty($params['goods_id'])) { | ||
58 | + $this->error('请选择商品'); | ||
59 | + } | ||
60 | $result = false; | 60 | $result = false; |
61 | Db::startTrans(); | 61 | Db::startTrans(); |
62 | try { | 62 | try { |
@@ -108,12 +108,12 @@ class Litestorenews extends Backend | @@ -108,12 +108,12 @@ class Litestorenews extends Backend | ||
108 | $params = $this->request->post("row/a"); | 108 | $params = $this->request->post("row/a"); |
109 | if ($params) { | 109 | if ($params) { |
110 | $params = $this->preExcludeFields($params); | 110 | $params = $this->preExcludeFields($params); |
111 | - if($params['type'] == 1 && empty($params['goods_id'])) { | ||
112 | - $this->error('请选择商品'); | ||
113 | - } | ||
114 | if($params['type'] == 2 && empty($params['href'])) { | 111 | if($params['type'] == 2 && empty($params['href'])) { |
115 | $this->error('请填写链接'); | 112 | $this->error('请填写链接'); |
116 | } | 113 | } |
114 | + if($params['type'] == 3 && empty($params['goods_id'])) { | ||
115 | + $this->error('请选择商品'); | ||
116 | + } | ||
117 | $result = false; | 117 | $result = false; |
118 | Db::startTrans(); | 118 | Db::startTrans(); |
119 | try { | 119 | try { |
@@ -15,6 +15,18 @@ | @@ -15,6 +15,18 @@ | ||
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | <div class="form-group"> | 17 | <div class="form-group"> |
18 | + <label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label> | ||
19 | + <div class="col-xs-12 col-sm-8"> | ||
20 | + <input id="c-url" class="form-control" name="row[url]" type="text"> | ||
21 | + </div> | ||
22 | + </div> | ||
23 | + <!--<div class="form-group">--> | ||
24 | + <!--<label class="control-label col-xs-12 col-sm-2">{:__('Typeswitch')}:</label>--> | ||
25 | + <!--<div class="col-xs-12 col-sm-8">--> | ||
26 | + <!--<input id="c-typeswitch" class="form-control" name="row[typeswitch]" type="number">--> | ||
27 | + <!--</div>--> | ||
28 | + <!--</div>--> | ||
29 | + <div class="form-group"> | ||
18 | <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label> | 30 | <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label> |
19 | <div class="col-xs-12 col-sm-8"> | 31 | <div class="col-xs-12 col-sm-8"> |
20 | <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0"> | 32 | <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0"> |
@@ -15,6 +15,18 @@ | @@ -15,6 +15,18 @@ | ||
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | <div class="form-group"> | 17 | <div class="form-group"> |
18 | + <label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label> | ||
19 | + <div class="col-xs-12 col-sm-8"> | ||
20 | + <input id="c-url" class="form-control" name="row[url]" type="text" value="{$row.url|htmlentities}"> | ||
21 | + </div> | ||
22 | + </div> | ||
23 | + <!-- <div class="form-group"> | ||
24 | + <label class="control-label col-xs-12 col-sm-2">{:__('Typeswitch')}:</label> | ||
25 | + <div class="col-xs-12 col-sm-8"> | ||
26 | + <input id="c-typeswitch" class="form-control" name="row[typeswitch]" type="number" value="{$row.typeswitch|htmlentities}"> | ||
27 | + </div> | ||
28 | + </div> --> | ||
29 | + <div class="form-group"> | ||
18 | <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label> | 30 | <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label> |
19 | <div class="col-xs-12 col-sm-8"> | 31 | <div class="col-xs-12 col-sm-8"> |
20 | <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}"> | 32 | <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}"> |
@@ -64,6 +64,8 @@ class Hot extends Api | @@ -64,6 +64,8 @@ class Hot extends Api | ||
64 | "data": [{ | 64 | "data": [{ |
65 | "id": 1, | 65 | "id": 1, |
66 | "image": "http://community.qiniu.brotop.cn/uploads/20200910/0afb1f6a54b2ca30a2fa3f3f6cafbd3f.jpg", | 66 | "image": "http://community.qiniu.brotop.cn/uploads/20200910/0afb1f6a54b2ca30a2fa3f3f6cafbd3f.jpg", |
67 | + "url"://跳转地址 | ||
68 | + "typeswitch"://开关0关1开 | ||
67 | "weigh": 1, | 69 | "weigh": 1, |
68 | "createtime": "2020-09-10 11:47:28" | 70 | "createtime": "2020-09-10 11:47:28" |
69 | }] | 71 | }] |
@@ -26,6 +26,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -26,6 +26,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
26 | {checkbox: true}, | 26 | {checkbox: true}, |
27 | {field: 'id', title: __('Id')}, | 27 | {field: 'id', title: __('Id')}, |
28 | {field: 'image', title: __('Image'), events: Table.api.events.image, formatter: Table.api.formatter.image}, | 28 | {field: 'image', title: __('Image'), events: Table.api.events.image, formatter: Table.api.formatter.image}, |
29 | + {field: 'url', title: __('Url'), formatter: Table.api.formatter.url}, | ||
30 | + {field: 'typeswitch', title: __('是否开启跳转'), table: table, formatter: Table.api.formatter.toggle}, | ||
29 | {field: 'weigh', title: __('Weigh')}, | 31 | {field: 'weigh', title: __('Weigh')}, |
30 | {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | 32 | {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, |
31 | {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | 33 | {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, |
-
请 注册 或 登录 后发表评论