浏览代码

存储列表

afa 7 月之前
父节点
当前提交
91ba876f49

+ 3 - 8
application/admin/controller/ledger/LedgerPowerChange.php → application/admin/controller/ledger/LedgerTeacChange.php

@@ -11,11 +11,11 @@ use think\exception\DbException;
 use think\response\Json;
 
 /**
- * 算力变动明细管理
+ * Teac变动明细管理
  *
  * @icon fa fa-circle-o
  */
-class LedgerPowerChange extends Backend
+class LedgerTeacChange extends Backend
 {
 
     /**
@@ -27,17 +27,12 @@ class LedgerPowerChange extends Backend
     public function _initialize()
     {
         parent::_initialize();
-        $this->model = new \app\admin\model\LedgerPowerChange;
+        $this->model = new \app\common\model\LedgerTeacChangeModel;
 
     }
 
 
 
-    /**
-     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
-     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
-     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
-     */
 
     /**
      * 查看

+ 31 - 21
application/admin/controller/user/TeamRewards.php → application/admin/controller/user/Userpledge.php

@@ -3,16 +3,16 @@
 namespace app\admin\controller\user;
 
 use app\common\controller\Backend;
-use app\common\model\UserModel;
+use app\common\model\ProductLists;
 use think\exception\DbException;
 use think\response\Json;
 
 /**
- * 团队奖励发放统计
+ * 用户存储列表 TeamRewards
  *
  * @icon fa fa-circle-o
  */
-class TeamRewards extends Backend
+class Userpledge extends Backend
 {
 
     /**
@@ -24,20 +24,12 @@ class TeamRewards extends Backend
     public function _initialize()
     {
         parent::_initialize();
-        $this->model = new \app\admin\model\TeamRewards;
+        $this->model = new \app\common\model\UserPledge;
 
     }
 
 
 
-    /**
-     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
-     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
-     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
-     */
-
-
-
     /**
      * 查看
      *
@@ -57,17 +49,35 @@ class TeamRewards extends Backend
             return $this->selectpage();
         }
         [$where, $sort, $order, $offset, $limit] = $this->buildparams();
-        $list     = $this->model->alias('r')
-            ->join('user u','r.user_id=u.id','LEFT')
-            ->where($where)
-            ->field('r.*,u.address')
-            ->order($sort, $order)
-            ->paginate($limit);
-        foreach ($list as $k => $v) {
-            $list[$k]['address'] = (new UserModel())->getById($v['user_id'])['address'];
-        }
+        $list     = $this->model->with('users,pledges')
+                 ->where($where)
+                 ->order($sort, $order)
+                 ->paginate($limit);
+      
         $result = ['total' => $list->total(), 'rows' => $list->items()];
         return json($result);
     }
 
+
+    /**
+     * 详情
+     */
+    public function detail($ids)
+    {
+        $row = $this->model->get(['id' => $ids]);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        if ($this->request->isAjax()) {
+            $this->success("Ajax请求成功", null, ['id' => $ids]);
+        }
+        $product = new ProductLists();
+        $details = json_decode($row->details, true);
+        foreach ($details as &$detail) {
+            $detail['name'] = $product::where('id', $detail['id'])->value('zh_name');
+        }
+        $this->view->assign("row", $details);
+        return $this->view->fetch();
+    }
+
 }

+ 0 - 0
application/admin/lang/zh-cn/ledger/ledger_power_change.php → application/admin/lang/zh-cn/ledger/ledger_teac_change.php


+ 0 - 17
application/admin/lang/zh-cn/user/team_rewards.php

@@ -1,17 +0,0 @@
-<?php
-
-return [
-    'Id'              => 'ID',
-    'User_id'         => '用户ID',
-    'Date_time'       => '统计日期',
-    'Address'         => '用户钱包地址',
-    'Today_power'     => '当日团队新增业绩',
-    'Team_power'      => '当前团队总业绩',
-    'Level_id'        => '等级ID',
-    'Rate'            => '算力收益比例',
-    'Commission'      => '理论收益值',
-    'Team_commission' => '下级团队收益',
-    'Send_commission' => '实际发放收益',
-    'Status'          => '发放状态',
-    'Update_time'     => '更新时间'
-];

+ 13 - 0
application/admin/lang/zh-cn/user/userpledge.php

@@ -0,0 +1,13 @@
+<?php
+
+return [
+    'Id'              => 'ID',
+    'User_id'         => '用户地址',
+    'Pledge_id'       => '低质标题',
+    'Num'             => '质抵数(套)',
+    'Total_self'      => '累计Teac收益',
+    'Day_num'         => '日产币量',
+    'Last_time'       => '最后收取时间',
+    'Status'          => '状态',
+    'Update_time'     => '更新时间'
+];

+ 0 - 0
application/admin/validate/LedgerPowerChange.php → application/admin/validate/LedgerTeacChange.php


+ 0 - 0
application/admin/validate/TeamRewards.php → application/admin/validate/Userpledge.php


+ 0 - 0
application/admin/view/ledger/ledger_power_change/index.html → application/admin/view/ledger/ledger_teac_change/index.html


+ 25 - 0
application/admin/view/user/userpledge/detail.html

@@ -0,0 +1,25 @@
+<table class="table table-striped">
+    <thead>
+        <tr>
+            <th>{:__('订单号')}</th>
+            <th>{:__('商品')}</th>
+            <th>{:__('图片')}</th>
+        </tr>
+    </thead>
+    <tbody>
+        {volist name="row" id="vo"  }
+        <tr>
+            <td>{$vo.order_no}</td>
+            <td >{$vo.name|htmlentities}</td>
+            <td ><img src="{$vo.thum|htmlentities}" width="100px" height="80px"></td>
+        </tr>
+        {/volist}
+     
+    </tbody>
+</table>
+<div class="hide layer-footer">
+    <label class="control-label col-xs-12 col-sm-2"></label>
+    <div class="col-xs-12 col-sm-8">
+        <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
+    </div>
+</div>

+ 0 - 0
application/admin/view/user/team_rewards/index.html → application/admin/view/user/userpledge/index.html


+ 2 - 2
application/api/controller/Pledge.php

@@ -126,8 +126,8 @@ class Pledge extends Api
             try {
                   // 质抵押订单
                   $res = $pledgeLogic::getPledgeCollect($this->auth->id);
-                  
-                  //cache('collect_time', time(), 300);
+                  //请求限制      
+                  cache('collect_'.$this->auth->id, time(), 300);
                  // 提交事务
                   Db::commit();
             } catch (Exception $e) {

+ 12 - 0
application/common/model/UserPledge.php

@@ -46,6 +46,18 @@ class UserPledge extends Model
         ]);
     }
 
+    //用户
+    public function users()
+    {
+        return $this->hasOne('UserModel', 'id', 'user_id', [], 'LEFT')->setEagerlyType(0);
+    }
+
+    //低质押
+    public function pledges()
+    {
+        return $this->hasOne('ProductPledges', 'id', 'pledge_id', [], 'LEFT')->setEagerlyType(0);
+    }
+
 
     public function getCreateTimeTextAttr($value, $data)
     {

+ 8 - 8
public/assets/js/backend/ledger/ledger_power_change.js → public/assets/js/backend/ledger/ledger_teac_change.js

@@ -5,13 +5,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             // 初始化表格参数配置
             Table.api.init({
                 extend: {
-                    index_url: 'ledger/ledger_power_change/index' + location.search,
-                    add_url: 'ledger/ledger_power_change/add',
-                    edit_url: 'ledger/ledger_power_change/edit',
-                    del_url: 'ledger/ledger_power_change/del',
-                    multi_url: 'ledger/ledger_power_change/multi',
-                    import_url: 'ledger/ledger_power_change/import',
-                    table: 'ledger_power_change',
+                    index_url: 'ledger/ledger_teac_change/index' + location.search,
+                    add_url: 'ledger/ledger_teac_change/add',
+                    edit_url: 'ledger/ledger_teac_change/edit',
+                    del_url: 'ledger/ledger_teac_change/del',
+                    multi_url: 'ledger/ledger_teac_change/multi',
+                    import_url: 'ledger/ledger_teac_change/import',
+                    table: 'ledger_teac_change',
                 }
             });
 
@@ -34,7 +34,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {
                             field: 'action', title: __('Action'), searchList: {
-                                '1': '服务器算力',
+                                '0': '质押存储',
                                 '2': '直推奖励',
                                 '3': '算力奖励',
                                 '4': '平级奖励',

+ 0 - 62
public/assets/js/backend/user/team_rewards.js

@@ -1,62 +0,0 @@
-define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
-
-    var Controller = {
-        index: function () {
-            // 初始化表格参数配置
-            Table.api.init({
-                extend: {
-                    index_url: 'user/team_rewards/index' + location.search,
-                    add_url: 'user/team_rewards/add',
-                    edit_url: 'user/team_rewards/edit',
-                    del_url: 'user/team_rewards/del',
-                    multi_url: 'user/team_rewards/multi',
-                    import_url: 'user/team_rewards/import',
-                    table: 'team_rewards',
-                }
-            });
-
-            var table = $("#table");
-
-            // 初始化表格
-            table.bootstrapTable({
-                url: $.fn.bootstrapTable.defaults.extend.index_url,
-                pk: 'id',
-                sortName: 'id',
-                fixedColumns: true,
-                fixedRightNumber: 1,
-                columns: [
-                    [
-                        {checkbox: true},
-                        {field: 'id', title: __('Id')},
-                        {field: 'user_id', title: __('User_id')},
-                        {field: 'address', title: __('Address')},
-                        {field: 'date_time', title: __('Date_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
-                        {field: 'team_power', title: __('Team_power'), operate:'BETWEEN'},
-                        {field: 'level_id', title: '当日等级', operate:'BETWEEN'},
-                        {field: 'team_power_bonus_rate', title: '发放比例', operate:'BETWEEN'},
-                        {field: 'smh_team', title: '当日团队产币量', operate:'BETWEEN'},
-                        {field: 'commission', title: '当日收益', operate:'BETWEEN'},
-                        {field: 'team_commission', title: '当日伞下收益', operate:'BETWEEN'},
-                        {field: 'send_commission', title: '当日实际收益', operate:'BETWEEN'},
-                        {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
-                    ]
-                ]
-            });
-
-            // 为表格绑定事件
-            Table.api.bindevent(table);
-        },
-        add: function () {
-            Controller.api.bindevent();
-        },
-        edit: function () {
-            Controller.api.bindevent();
-        },
-        api: {
-            bindevent: function () {
-                Form.api.bindevent($("form[role=form]"));
-            }
-        }
-    };
-    return Controller;
-});

+ 68 - 0
public/assets/js/backend/user/userpledge.js

@@ -0,0 +1,68 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'user/userpledge/index' + location.search,
+                    import_url: 'user/userpledge/import',
+                    table: 'userpledge',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                fixedColumns: true,
+                fixedRightNumber: 1,
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'users.address', title: __('User_id')},
+                        {field: 'pledges.title', title: __('Pledge_id')},
+                        {field: 'num', title: __('Num'), operate:false},
+                        {field: 'day_num', title: __('Day_num'), operate: false},
+                        {field: 'total_self', title: __('Total_self'), operate: false},
+                        {field: 'last_time', title: __('Last_time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
+                        {field: 'update_time', title: __('Updatetime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
+                        { field: 'operate', title: __('Operate'),
+                            buttons:[
+                                {
+                                    classname: 'btn btn-xs btn-info btn-dialog',
+                                    name: '存储详情',
+                                    text: __('存储详情'),
+                                    title: __('存储详情'),
+                                    url: 'user/userpledge/detail',
+                                },
+                              ],
+                            table: table, events: Table.api.events.operate,
+                            formatter: Table.api.formatter.operate 
+                        }
+
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});