Browse Source

动态礼物,聊天礼物

lizhen_gitee 2 months ago
parent
commit
a96cdb5328

+ 1 - 38
application/admin/controller/Giftuserdongtai.php

@@ -22,7 +22,7 @@ class Giftuserdongtai extends Backend
     {
         parent::_initialize();
         $this->model = new \app\admin\model\Giftuserdongtai;
-        $this->view->assign("wallettypeList", $this->model->getWallettypeList());
+
     }
 
     public function import()
@@ -37,41 +37,4 @@ class Giftuserdongtai extends Backend
      */
     
 
-    /**
-     * 查看
-     */
-    public function index()
-    {
-        //当前是否为关联查询
-        $this->relationSearch = true;
-        //设置过滤方法
-        $this->request->filter(['strip_tags', 'trim']);
-        if ($this->request->isAjax()) {
-            //如果发送的来源是Selectpage,则转发到Selectpage
-            if ($this->request->request('keyField')) {
-                return $this->selectpage();
-            }
-            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-
-            $list = $this->model
-                    ->with(['user','userto','gift','topicdongtai'])
-                    ->where($where)
-                    ->order($sort, $order)
-                    ->paginate($limit);
-
-            foreach ($list as $row) {
-                
-                $row->getRelation('user')->visible(['nickname','mobile']);
-				$row->getRelation('userto')->visible(['nickname','mobile']);
-//				$row->getRelation('gift')->visible(['name']);
-//				$row->getRelation('topicdongtai')->visible(['content']);
-            }
-
-            $result = array("total" => $list->total(), "rows" => $list->items());
-
-            return json($result);
-        }
-        return $this->view->fetch();
-    }
-
 }

+ 1 - 36
application/admin/controller/Giftusertyping.php

@@ -22,7 +22,7 @@ class Giftusertyping extends Backend
     {
         parent::_initialize();
         $this->model = new \app\admin\model\Giftusertyping;
-        $this->view->assign("wallettypeList", $this->model->getWallettypeList());
+
     }
 
     public function import()
@@ -37,39 +37,4 @@ class Giftusertyping extends Backend
      */
     
 
-    /**
-     * 查看
-     */
-    public function index()
-    {
-        //当前是否为关联查询
-        $this->relationSearch = true;
-        //设置过滤方法
-        $this->request->filter(['strip_tags', 'trim']);
-        if ($this->request->isAjax()) {
-            //如果发送的来源是Selectpage,则转发到Selectpage
-            if ($this->request->request('keyField')) {
-                return $this->selectpage();
-            }
-            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-
-            $list = $this->model
-                    ->with(['user','touser'])
-                    ->where($where)
-                    ->order($sort, $order)
-                    ->paginate($limit);
-
-            foreach ($list as $row) {
-                
-                $row->getRelation('user')->visible(['username']);
-				$row->getRelation('touser')->visible(['username']);
-            }
-
-            $result = array("total" => $list->total(), "rows" => $list->items());
-
-            return json($result);
-        }
-        return $this->view->fetch();
-    }
-
 }

+ 13 - 19
application/admin/lang/zh-cn/giftuserdongtai.php

@@ -1,23 +1,17 @@
 <?php
 
 return [
-    'Id'                   => 'ID',
-    'User_id'              => '赠送用户ID',
-    'User_to_id'           => '获赠用户ID',
-    'Dt_id'                => '动态ID',
-    'Gift_id'              => '礼物ID',
-    'Gift_name'            => '礼物名称',
-    'Number'               => '数量',
-    'Price'                => '金币总价值',
-    'Createtime'           => '创建时间',
-    'User.nickname'        => '赠送用户昵称',
-    'User.mobile'          => '赠送用户手机号',
-    'Userto.nickname'        => '获赠用户昵称',
-    'Userto.mobile'          => '获赠用户手机号',
-    'Gift.name'            => '名称',
-    'Topicdongtai.content' => '描述',
-    'Jewel'        => '钻石总价值',
-    'Wallettype'   => '礼物花费类型',
-    'Wallettype 1' => '金币',
-    'Wallettype 2' => '钻石'
+    'Id'          => 'ID',
+    'User_id'     => '赠送用户ID',
+    'User_to_id'  => '获赠用户ID',
+    'Dt_id'       => '动态ID',
+    'Gift_id'     => '礼物ID',
+    'Gift_name'   => '礼物名称',
+    'Number'      => '数量',
+    'Price'       => '单价(金币)',
+    'Total_price' => '总价值(金币)',
+    'Createtime'  => '创建时间',
+    'Platvalue'   => '平台抽成(金币)',
+    'Getvalue'    => '获赠价值(金币)',
+    'Getmoney'    => '获赠价值(收益)'
 ];

+ 12 - 14
application/admin/lang/zh-cn/giftusertyping.php

@@ -1,18 +1,16 @@
 <?php
 
 return [
-    'Id'            => 'ID',
-    'User_id'       => '赠送用户ID',
-    'User_to_id'    => '获赠用户ID',
-    'Gift_id'       => '礼物ID',
-    'Gift_name'     => '礼物名称',
-    'Number'        => '数量',
-    'Price'         => '金币总价值',
-    'Createtime'    => '创建时间',
-    'User.username' => '赠送用户名',
-    'Touser.username' => '获赠用户名',
-    'Jewel'        => '钻石总价值',
-    'Wallettype'   => '花费类型',
-    'Wallettype 1' => '金币',
-    'Wallettype 2' => '钻石'
+    'Id'          => 'ID',
+    'User_id'     => '赠送用户ID',
+    'User_to_id'  => '获赠用户ID',
+    'Gift_id'     => '礼物ID',
+    'Gift_name'   => '礼物名称',
+    'Number'      => '数量',
+    'Price'       => '单价(金币)',
+    'Total_price' => '总价值(金币)',
+    'Createtime'  => '创建时间',
+    'Platvalue'   => '平台抽成(金币)',
+    'Getvalue'    => '获赠价值(金币)',
+    'Getmoney'    => '获赠价值(收益)'
 ];

+ 1 - 33
application/admin/model/Giftuserdongtai.php

@@ -25,48 +25,16 @@ class Giftuserdongtai extends Model
 
     // 追加属性
     protected $append = [
-        'wallettype_text'
+
     ];
     
 
     
-    public function getWallettypeList()
-    {
-        return ['1' => __('Wallettype 1'), '2' => __('Wallettype 2')];
-    }
-
-
-    public function getWallettypeTextAttr($value, $data)
-    {
-        $value = $value ? $value : (isset($data['wallettype']) ? $data['wallettype'] : '');
-        $list = $this->getWallettypeList();
-        return isset($list[$value]) ? $list[$value] : '';
-    }
-
-
-
-
 
-    public function user()
-    {
-        return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
-    }
 
 
-    public function userto()
-    {
-        return $this->belongsTo('User', 'user_to_id', 'id', [], 'LEFT')->setEagerlyType(0);
-    }
 
 
-    public function gift()
-    {
-        return $this->belongsTo('Gift', 'gift_id', 'id', [], 'LEFT')->setEagerlyType(0);
-    }
 
 
-    public function topicdongtai()
-    {
-        return $this->belongsTo('Topicdongtai', 'dt_id', 'id', [], 'LEFT')->setEagerlyType(0);
-    }
 }

+ 1 - 21
application/admin/model/Giftusertyping.php

@@ -25,36 +25,16 @@ class Giftusertyping extends Model
 
     // 追加属性
     protected $append = [
-        'wallettype_text'
+
     ];
     
 
     
-    public function getWallettypeList()
-    {
-        return ['1' => __('Wallettype 1'), '2' => __('Wallettype 2')];
-    }
-
-
-    public function getWallettypeTextAttr($value, $data)
-    {
-        $value = $value ? $value : (isset($data['wallettype']) ? $data['wallettype'] : '');
-        $list = $this->getWallettypeList();
-        return isset($list[$value]) ? $list[$value] : '';
-    }
 
 
 
 
 
-    public function user()
-    {
-        return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
-    }
 
 
-    public function touser()
-    {
-        return $this->belongsTo('User', 'user_to_id', 'id', [], 'LEFT')->setEagerlyType(0);
-    }
 }

+ 2 - 2
application/admin/view/gift/index.html

@@ -8,7 +8,7 @@
                     <div id="toolbar" class="toolbar">
                         <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                         <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('gift/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
-                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('gift/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <!--<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('gift/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
                         <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('gift/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
                         <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('gift/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
 
@@ -18,7 +18,7 @@
                                 <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
                                 <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
                             </ul>
-                        </div>
+                        </div>-->
 
                         
                     </div>

+ 16 - 10
application/admin/view/giftuserdongtai/add.html

@@ -43,21 +43,27 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Jewel')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Total_price')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-jewel" data-rule="required" class="form-control" name="row[jewel]" type="number" value="0">
+            <input id="c-total_price" data-rule="required" class="form-control" name="row[total_price]" type="number" value="0">
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Wallettype')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Platvalue')}:</label>
         <div class="col-xs-12 col-sm-8">
-                        
-            <select  id="c-wallettype" data-rule="required" class="form-control selectpicker" name="row[wallettype]">
-                {foreach name="wallettypeList" item="vo"}
-                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
-                {/foreach}
-            </select>
-
+            <input id="c-platvalue" data-rule="required" class="form-control" step="0.1" name="row[platvalue]" type="number" value="0.0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Getvalue')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-getvalue" data-rule="required" class="form-control" step="0.1" name="row[getvalue]" type="number" value="0.0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Getmoney')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-getmoney" data-rule="required" class="form-control" step="0.01" name="row[getmoney]" type="number" value="0.00">
         </div>
     </div>
     <div class="form-group layer-footer">

+ 16 - 10
application/admin/view/giftuserdongtai/edit.html

@@ -43,21 +43,27 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Jewel')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Total_price')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-jewel" data-rule="required" class="form-control" name="row[jewel]" type="number" value="{$row.jewel|htmlentities}">
+            <input id="c-total_price" data-rule="required" class="form-control" name="row[total_price]" type="number" value="{$row.total_price|htmlentities}">
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Wallettype')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Platvalue')}:</label>
         <div class="col-xs-12 col-sm-8">
-                        
-            <select  id="c-wallettype" data-rule="required" class="form-control selectpicker" name="row[wallettype]">
-                {foreach name="wallettypeList" item="vo"}
-                    <option value="{$key}" {in name="key" value="$row.wallettype"}selected{/in}>{$vo}</option>
-                {/foreach}
-            </select>
-
+            <input id="c-platvalue" data-rule="required" class="form-control" step="0.1" name="row[platvalue]" type="number" value="{$row.platvalue|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Getvalue')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-getvalue" data-rule="required" class="form-control" step="0.1" name="row[getvalue]" type="number" value="{$row.getvalue|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Getmoney')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-getmoney" data-rule="required" class="form-control" step="0.01" name="row[getmoney]" type="number" value="{$row.getmoney|htmlentities}">
         </div>
     </div>
     <div class="form-group layer-footer">

+ 17 - 11
application/admin/view/giftusertyping/add.html

@@ -21,7 +21,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Gift_name')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-gift_name" data-rule="required" class="form-control" name="row[gift_name]" type="text">
+            <input id="c-gift_name" data-rule="required" class="form-control" name="row[gift_name]" type="text" value="">
         </div>
     </div>
     <div class="form-group">
@@ -37,21 +37,27 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Jewel')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Total_price')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-jewel" data-rule="required" class="form-control" name="row[jewel]" type="number" value="0">
+            <input id="c-total_price" data-rule="required" class="form-control" name="row[total_price]" type="number" value="0">
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Wallettype')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Platvalue')}:</label>
         <div class="col-xs-12 col-sm-8">
-                        
-            <select  id="c-wallettype" data-rule="required" class="form-control selectpicker" name="row[wallettype]">
-                {foreach name="wallettypeList" item="vo"}
-                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
-                {/foreach}
-            </select>
-
+            <input id="c-platvalue" data-rule="required" class="form-control" step="0.1" name="row[platvalue]" type="number" value="0.0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Getvalue')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-getvalue" data-rule="required" class="form-control" step="0.1" name="row[getvalue]" type="number" value="0.0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Getmoney')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-getmoney" data-rule="required" class="form-control" step="0.01" name="row[getmoney]" type="number" value="0.00">
         </div>
     </div>
     <div class="form-group layer-footer">

+ 16 - 10
application/admin/view/giftusertyping/edit.html

@@ -37,21 +37,27 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Jewel')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Total_price')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-jewel" data-rule="required" class="form-control" name="row[jewel]" type="number" value="{$row.jewel|htmlentities}">
+            <input id="c-total_price" data-rule="required" class="form-control" name="row[total_price]" type="number" value="{$row.total_price|htmlentities}">
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Wallettype')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Platvalue')}:</label>
         <div class="col-xs-12 col-sm-8">
-                        
-            <select  id="c-wallettype" data-rule="required" class="form-control selectpicker" name="row[wallettype]">
-                {foreach name="wallettypeList" item="vo"}
-                    <option value="{$key}" {in name="key" value="$row.wallettype"}selected{/in}>{$vo}</option>
-                {/foreach}
-            </select>
-
+            <input id="c-platvalue" data-rule="required" class="form-control" step="0.1" name="row[platvalue]" type="number" value="{$row.platvalue|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Getvalue')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-getvalue" data-rule="required" class="form-control" step="0.1" name="row[getvalue]" type="number" value="{$row.getvalue|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Getmoney')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-getmoney" data-rule="required" class="form-control" step="0.01" name="row[getmoney]" type="number" value="{$row.getmoney|htmlentities}">
         </div>
     </div>
     <div class="form-group layer-footer">

+ 7 - 11
public/assets/js/backend/giftuserdongtai.js

@@ -7,8 +7,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 extend: {
                     index_url: 'giftuserdongtai/index' + location.search,
                     add_url: 'giftuserdongtai/add',
-                    // edit_url: 'giftuserdongtai/edit',
-                    // del_url: 'giftuserdongtai/del',
+                    edit_url: 'giftuserdongtai/edit',
+                    del_url: 'giftuserdongtai/del',
                     multi_url: 'giftuserdongtai/multi',
                     import_url: 'giftuserdongtai/import',
                     table: 'gift_user_dongtai',
@@ -27,22 +27,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
                         {field: 'user_id', title: __('User_id')},
-                        {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
-                        {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
                         {field: 'user_to_id', title: __('User_to_id')},
-                        {field: 'userto.nickname', title: __('Userto.nickname'), operate: 'LIKE'},
-                        {field: 'userto.mobile', title: __('Userto.mobile'), operate: 'LIKE'},
                         {field: 'dt_id', title: __('Dt_id')},
                         {field: 'gift_id', title: __('Gift_id')},
                         {field: 'gift_name', title: __('Gift_name'), operate: 'LIKE'},
                         {field: 'number', title: __('Number')},
                         {field: 'price', title: __('Price')},
+                        {field: 'total_price', title: __('Total_price')},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
-                        {field: 'jewel', title: __('Jewel')},
-                        {field: 'wallettype', title: __('Wallettype'), searchList: {"1":__('Wallettype 1'),"2":__('Wallettype 2')}, formatter: Table.api.formatter.normal},
-                        // {field: 'gift.name', title: __('Gift.name'), operate: 'LIKE'},
-                        // {field: 'topicdongtai.content', title: __('Topicdongtai.content'), operate: 'LIKE'},
-                        // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        {field: 'platvalue', title: __('Platvalue'), operate:'BETWEEN'},
+                        {field: 'getvalue', title: __('Getvalue'), operate:'BETWEEN'},
+                        {field: 'getmoney', title: __('Getmoney'), operate:'BETWEEN'},
+//                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]
             });

+ 8 - 8
public/assets/js/backend/giftusertyping.js

@@ -7,8 +7,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 extend: {
                     index_url: 'giftusertyping/index' + location.search,
                     add_url: 'giftusertyping/add',
-//                    edit_url: 'giftusertyping/edit',
-//                    del_url: 'giftusertyping/del',
+                    edit_url: 'giftusertyping/edit',
+                    del_url: 'giftusertyping/del',
                     multi_url: 'giftusertyping/multi',
                     import_url: 'giftusertyping/import',
                     table: 'gift_user_typing',
@@ -26,17 +26,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
-//                        {field: 'user_id', title: __('User_id')},
-//                        {field: 'user_to_id', title: __('User_to_id')},
-                        {field: 'user.username', title: __('User.username'), operate: 'LIKE'},
-                        {field: 'touser.username', title: __('Touser.username'), operate: 'LIKE'},
+                        {field: 'user_id', title: __('User_id')},
+                        {field: 'user_to_id', title: __('User_to_id')},
                         {field: 'gift_id', title: __('Gift_id')},
                         {field: 'gift_name', title: __('Gift_name'), operate: 'LIKE'},
                         {field: 'number', title: __('Number')},
                         {field: 'price', title: __('Price')},
+                        {field: 'total_price', title: __('Total_price')},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
-                        {field: 'jewel', title: __('Jewel')},
-                        {field: 'wallettype', title: __('Wallettype'), searchList: {"1":__('Wallettype 1'),"2":__('Wallettype 2')}, formatter: Table.api.formatter.normal},
+                        {field: 'platvalue', title: __('Platvalue'), operate:'BETWEEN'},
+                        {field: 'getvalue', title: __('Getvalue'), operate:'BETWEEN'},
+                        {field: 'getmoney', title: __('Getmoney'), operate:'BETWEEN'},
 //                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]