hrjy 3 lat temu
rodzic
commit
b90c3c6ced

+ 6 - 0
app/admin/controller/card/Card.php

@@ -66,6 +66,8 @@ class Card extends AuthController
             'price' => '',
             'details_image' => '',
             'info' => '',
+            'type' => '',
+            'number' => '',
         ];
         if ($id){
             $data = \app\admin\model\card\Card::where('id', $id)->find()->toArray();
@@ -98,6 +100,8 @@ class Card extends AuthController
             'image',
             'details_image',
             'info',
+            'type',
+            'number',
         ]);
         if ($data['id']){
             $list = \app\admin\model\card\Card::where('id', $data['id'])->find();
@@ -110,6 +114,8 @@ class Card extends AuthController
             $list['image'] = $data['image'];
             $list['details_image'] = $data['details_image'];
             $list['info'] = $data['info'];
+            $list['type'] = $data['type'];
+            $list['number'] = $data['number'];
             $res = $list->save();
         }else{
             $res = $model->save($data);

+ 26 - 0
app/admin/view/card/card/create.php

@@ -62,6 +62,26 @@
                        </div>
                    </div>
                </div>
+               <div class="form-group">
+                   <div class="col-md-12">
+                       <div class="input-group">
+                           <span class="input-group-addon">次数</span>
+                           <input maxlength="8" placeholder="输入次数" name="number" class="layui-input" id="number" value="{$list['number']}" type="number">
+                       </div>
+                   </div>
+               </div>
+               <div class="form-group">
+                   <div class="col-md-12">
+                       <div class="input-group">
+                           <span class="input-group-addon">分类</span>
+                           <select data-placeholder="分类" class="chosen-select"  style="width:100%;" tabindex="4" name="type" id="type" value="{$list['type']}">
+                               <option value="0" {if ($list['type'] == 0)}selected ='selected' {/if}>选择分类</option>
+                               <option value="1" {if ($list['type'] == 1)}selected ='selected' {/if}>时效卡</option>
+                               <option value="2" {if ($list['type'] == 2)}selected ='selected' {/if}>次数卡</option>
+                           </select>
+                       </div>
+                   </div>
+               </div>
                <div class="form-group">
                    <div class="col-md-12">
                        <div class="form-control" style="height:auto">
@@ -255,6 +275,8 @@
                 list.end_week = $('#end_week').val();/* 原文链接 */
                 list.details_image = $('#image_inputs').val();/* 原文链接 */
                 list.info = $('#info').val();/* 原文链接 */
+                list.type = $('#type').val();/* 原文链接 */
+                list.number = $('#number').val();/* 原文链接 */
                 var Expression = /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
                 var objExp=new RegExp(Expression);
                 if(list.name == ''){
@@ -288,6 +310,10 @@
                     $eb.message('error','请输入适用结束星期');
                     return false;
                 }
+                if(list.type == 0){
+                    $eb.message('error','请选择分类');
+                    return false;
+                }
 
                 var data = {};
                 var index = layList.layer.load(1, {

+ 14 - 2
app/admin/view/card/card/index.php

@@ -86,6 +86,16 @@
                     <script type="text/html" id="is_show">
                         <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='开启|关闭'  {{ d.status == 1 ? 'checked' : '' }}>
                     </script>
+
+                    <script type="text/html" id="type">
+                        {{# if(d.type==1){ }}
+                            时效卡
+                        {{# } }}
+                        {{# if(d.type==2){ }}
+                            次数卡
+                        {{# } }}
+
+                    </script>
                     <script type="text/html" id="act">
                         <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('编辑','{:Url('card.card_project/index')}?id={{d.id}}',{h:1100,w:1100})">
                             绑定
@@ -115,8 +125,10 @@
             {type: 'checkbox'},
             {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
             {field: 'name', title: '名称', templet: '#name',  align: 'center'},
-            {field: 'time', title: '天数', templet: '#name',  align: 'center'},
-            {field: 'price', title: '金额', templet: '#name',  align: 'center'},
+            {field: 'time', title: '天数',  align: 'center'},
+            {field: 'price', title: '金额',  align: 'center'},
+            {field: 'type', title: '类型', templet: '#type',  align: 'center'},
+            {field: 'number', title: '次数',  align: 'center'},
             {field: 'status', title: '状态', templet: '#is_show',  align: 'center'},
             {field: 'create_time', title: '时间', align: 'center', width: '8%'},
             {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},