Browse Source

后台礼物修改优化

lizhen_gitee 1 năm trước cách đây
mục cha
commit
0d9c71136e

+ 1 - 1
application/admin/lang/zh-cn/gift/gift.php

@@ -10,7 +10,7 @@ return [
     'Type 2'      => '人气',
     'Type 3'      => '浪漫',
     'Type 4'      => '豪华',
-    'Is_big'      => '大礼物',
+    'Is_big'      => '大礼物飘屏',
     'Is_big 0'    => '否',
     'Is_big 1'    => '是',
     'Box_type'    => '宝箱类型',

+ 7 - 1
application/admin/model/gift/Gift.php

@@ -29,8 +29,14 @@ class Gift extends Model
         'complex_text',
         'timelimit_text'
     ];
-    
 
+    protected static function init()
+    {
+        self::beforeInsert(function ($row) {
+            //礼物价值=价格
+            $row->value = $row->price;
+        });
+    }
     
     public function getIsBigList()
     {

+ 6 - 6
application/admin/view/gift/gift/add.html

@@ -1,11 +1,11 @@
 <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
 
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('No')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-no" data-rule="required" class="form-control" name="row[no]" type="number" value="0">
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
         <div class="col-xs-12 col-sm-8">
@@ -42,7 +42,7 @@
 
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Complex')}:</label>
         <div class="col-xs-12 col-sm-8">
                         
@@ -65,19 +65,19 @@
             </select>
 
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-price" data-rule="required" class="form-control" name="row[price]" type="number" value="0">
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Value')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-value" data-rule="required" class="form-control" name="row[value]" type="number" value="0">
         </div>
-    </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">

+ 6 - 6
application/admin/view/gift/gift/edit.html

@@ -1,11 +1,11 @@
 <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
 
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('No')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-no" data-rule="required" class="form-control" name="row[no]" type="number" value="{$row.no|htmlentities}">
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
         <div class="col-xs-12 col-sm-8">
@@ -42,7 +42,7 @@
 
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Complex')}:</label>
         <div class="col-xs-12 col-sm-8">
                         
@@ -65,19 +65,19 @@
             </select>
 
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-price" data-rule="required" class="form-control" name="row[price]" type="number" value="{$row.price|htmlentities}">
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Value')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-value" data-rule="required" class="form-control" name="row[value]" type="number" value="{$row.value|htmlentities}">
         </div>
-    </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">

+ 4 - 4
public/assets/js/backend/gift/gift.js

@@ -26,14 +26,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
-                        {field: 'no', title: __('No')},
+//                        {field: 'no', title: __('No')},
                         {field: 'name', title: __('Name'), operate: 'LIKE'},
                         {field: 'gifttype.name', title: __('Type'), formatter: Table.api.formatter.normal},
                         {field: 'is_big', title: __('Is_big'), searchList: {"0":__('Is_big 0'),"1":__('Is_big 1')}, formatter: Table.api.formatter.normal},
-                        {field: 'complex', title: __('Complex'), searchList: {"1":__('Complex 1'),"0":__('Complex 0')}, formatter: Table.api.formatter.normal},
-                        {field: 'timelimit', title: __('Timelimit'), searchList: {"1":__('Timelimit 1'),"0":__('Timelimit 0')}, formatter: Table.api.formatter.normal},
+//                        {field: 'complex', title: __('Complex'), searchList: {"1":__('Complex 1'),"0":__('Complex 0')}, formatter: Table.api.formatter.normal},
+//                        {field: 'timelimit', title: __('Timelimit'), searchList: {"1":__('Timelimit 1'),"0":__('Timelimit 0')}, formatter: Table.api.formatter.normal},
                         {field: 'price', title: __('Price')},
-                        {field: 'value', title: __('Value')},
+//                        {field: 'value', title: __('Value')},
                         {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                         // {field: 'special', title: __('Special'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                         {field: 'sort', title: __('Sort')},