Browse Source

解决冲突

Jason 1 year ago
parent
commit
440d26db7e
73 changed files with 1767 additions and 757 deletions
  1. 55 0
      application/admin/controller/news/Lists.php
  2. 37 0
      application/admin/controller/news/Types.php
  3. 31 3
      application/admin/controller/trade/Moneylog.php
  4. 35 7
      application/admin/controller/trade/Mongyin.php
  5. 64 5
      application/admin/controller/trade/Mongyout.php
  6. 78 5
      application/admin/controller/trade/Order.php
  7. 27 23
      application/admin/controller/user/Group.php
  8. 0 108
      application/admin/controller/user/Rule.php
  9. 49 0
      application/admin/controller/user/Team.php
  10. 210 22
      application/admin/controller/user/User.php
  11. 14 0
      application/admin/lang/vn/news/lists.php
  12. 5 0
      application/admin/lang/vn/news/types.php
  13. 11 0
      application/admin/lang/vn/trade/moneylog.php
  14. 19 0
      application/admin/lang/vn/trade/mongyin.php
  15. 17 0
      application/admin/lang/vn/trade/mongyout.php
  16. 20 0
      application/admin/lang/vn/trade/order.php
  17. 14 6
      application/admin/lang/vn/user/group.php
  18. 13 0
      application/admin/lang/zh-cn/news/lists.php
  19. 5 0
      application/admin/lang/zh-cn/news/types.php
  20. 2 2
      application/admin/lang/zh-cn/trade/moneylog.php
  21. 11 3
      application/admin/lang/zh-cn/trade/mongyin.php
  22. 10 3
      application/admin/lang/zh-cn/trade/mongyout.php
  23. 16 9
      application/admin/lang/zh-cn/trade/order.php
  24. 2 1
      application/admin/lang/zh-cn/user/group.php
  25. 20 3
      application/admin/lang/zh-cn/user/user.php
  26. 6 4
      application/admin/model/User.php
  27. 0 34
      application/admin/model/UserGroup.php
  28. 28 0
      application/admin/model/UserPath.php
  29. 0 67
      application/admin/model/UserRule.php
  30. 27 0
      application/admin/validate/news/Lists.php
  31. 27 0
      application/admin/validate/news/Types.php
  32. 0 4
      application/admin/view/goods/goods/index.html
  33. 44 0
      application/admin/view/news/lists/add.html
  34. 51 0
      application/admin/view/news/lists/edit.html
  35. 29 0
      application/admin/view/news/lists/index.html
  36. 15 0
      application/admin/view/news/types/add.html
  37. 15 0
      application/admin/view/news/types/edit.html
  38. 29 0
      application/admin/view/news/types/index.html
  39. 0 45
      application/admin/view/trade/moneylog/add.html
  40. 0 45
      application/admin/view/trade/moneylog/edit.html
  41. 0 10
      application/admin/view/trade/moneylog/index.html
  42. 0 69
      application/admin/view/trade/mongyin/add.html
  43. 10 12
      application/admin/view/trade/mongyin/index.html
  44. 9 10
      application/admin/view/trade/mongyout/index.html
  45. 0 63
      application/admin/view/trade/order/add.html
  46. 0 63
      application/admin/view/trade/order/edit.html
  47. 1 10
      application/admin/view/trade/order/index.html
  48. 24 0
      application/admin/view/trade/order/operate.html
  49. 29 21
      application/admin/view/user/group/edit.html
  50. 2 4
      application/admin/view/user/group/index.html
  51. 0 0
      application/admin/view/user/team/add.html
  52. 0 0
      application/admin/view/user/team/edit.html
  53. 0 0
      application/admin/view/user/team/index.html
  54. 41 0
      application/admin/view/user/user/balance.html
  55. 40 0
      application/admin/view/user/user/cardslip.html
  56. 42 0
      application/admin/view/user/user/collection.html
  57. 2 24
      application/admin/view/user/user/edit.html
  58. 13 10
      application/admin/view/user/user/index.html
  59. 22 0
      application/common.php
  60. 65 0
      application/common/model/Lists.php
  61. 11 3
      application/common/model/Moneylog.php
  62. 13 0
      application/common/model/Mongyin.php
  63. 14 1
      application/common/model/Mongyout.php
  64. 18 2
      application/common/model/Order.php
  65. 38 0
      application/common/model/Types.php
  66. 59 0
      public/assets/js/backend/news/lists.js
  67. 51 0
      public/assets/js/backend/news/types.js
  68. 9 12
      public/assets/js/backend/trade/moneylog.js
  69. 40 10
      public/assets/js/backend/trade/mongyin.js
  70. 53 9
      public/assets/js/backend/trade/mongyout.js
  71. 23 13
      public/assets/js/backend/trade/order.js
  72. 23 4
      public/assets/js/backend/user/group.js
  73. 79 8
      public/assets/js/backend/user/user.js

+ 55 - 0
application/admin/controller/news/Lists.php

@@ -0,0 +1,55 @@
+<?php
+
+namespace app\admin\controller\news;
+
+use app\common\controller\Backend;
+
+/**
+ * 信息列管理
+ *
+ * @icon fa fa-circle-o
+ */
+class Lists extends Backend
+{
+
+    /**
+     * Lists模型对象
+     * @var \app\admin\model\news\Lists
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\common\model\Lists;
+
+    }
+
+     /**
+     * 查看
+     *
+     * @return string|Json
+     * @throws \think\Exception
+     * @throws DbException
+     */
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+        $list = $this->model->with('types')
+            ->where($where)
+            ->order($sort, $order)
+            ->paginate($limit);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
+
+}

+ 37 - 0
application/admin/controller/news/Types.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace app\admin\controller\news;
+
+use app\common\controller\Backend;
+
+/**
+ * 信息分类
+ *
+ * @icon fa fa-circle-o
+ */
+class Types extends Backend
+{
+
+    /**
+     * Types模型对象
+     * @var \app\admin\model\news\Types
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\common\model\Types;
+
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+}

+ 31 - 3
application/admin/controller/trade/Moneylog.php

@@ -22,16 +22,44 @@ class Moneylog extends Backend
     {
         parent::_initialize();
         $this->model = new \app\common\model\Moneylog;
+        $this->assignconfig('user_id', $this->request->param('ids/d', 0));
 
     }
 
 
 
     /**
-     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
-     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
-     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     * 查看
+     * @return string|Json
+     * @throws \think\Exception
+     * @throws DbException
      */
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+
+        $map = [];
+        $user_id = $this->request->param('user_id/d', 0);
+
 
+        if($user_id > 0) $map['user_id'] = $user_id ;
+
+
+        $list = $this->model->with('users,fromuser')
+            ->where($where)->where($map)
+            ->order($sort, $order)
+            ->paginate($limit);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
 
 }

+ 35 - 7
application/admin/controller/trade/Mongyin.php

@@ -16,22 +16,50 @@ class Mongyin extends Backend
      * Mongyin模型对象
      * @var \app\admin\model\trade\Mongyin
      */
-    protected $model = null;
+    protected $model  = null;
+
+    protected $mapType = null;
 
     public function _initialize()
     {
         parent::_initialize();
-        $this->model = new \app\common\model\Mongyin;
-
+        $this->mapType  = array();
+        $this->model    = new \app\common\model\Mongyin;
+        $this->assign('typeList', $this->model->getTypeList());
     }
 
 
-
     /**
-     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
-     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
-     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     * 查看
+     * @return string|Json
+     * @throws \think\Exception
+     * @throws DbException
      */
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+
+        //tab
+        $type = $this->request->param('order_type/d');
+        if($type > 0) $this->mapType['order_type'] = $type;
+        
+        $list = $this->model->with('users,admins')
+            ->where($where)
+            ->where($this->mapType)
+            ->order($sort, $order)
+            ->paginate($limit);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
 
 
 }

+ 64 - 5
application/admin/controller/trade/Mongyout.php

@@ -2,7 +2,12 @@
 
 namespace app\admin\controller\trade;
 
+use think\Db;
+use Exception;
+use think\exception\DbException;
+use think\exception\PDOException;
 use app\common\controller\Backend;
+use think\exception\ValidateException;
 
 /**
  * 提现记录管理
@@ -18,20 +23,74 @@ class Mongyout extends Backend
      */
     protected $model = null;
 
+    protected $mapType = null;
+
     public function _initialize()
     {
         parent::_initialize();
+        $this->mapType  = array();
         $this->model = new \app\common\model\Mongyout;
-
+        $this->assign('typeList', $this->model->getTypeList());
     }
 
 
 
-    /**
-     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
-     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
-     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+      /**
+     * 查看
+     * @return string|Json
+     * @throws \think\Exception
+     * @throws DbException
      */
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+
+        //tab
+        $type = $this->request->param('order_type/d');
+        if($type > 0) $this->mapType['order_type'] = $type;
+        
+        $list = $this->model->with('users,admins')
+            ->where($where)
+            ->where($this->mapType)
+            ->order($sort, $order)
+            ->paginate($limit);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
 
 
+    
+    /**
+     * 审核
+     * @param $ids
+     * @return string
+     * @throws DbException
+     * @throws \think\Exception
+     */
+    public function review($ids = null, $status= 0)
+    {
+        $row = $this->model->get($ids);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        $result = false;
+        try {
+            $result = $row->allowField(true)->save(['status'=>$status]);
+        } catch (ValidateException|PDOException|Exception $e) {
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success();
+    }
 }

+ 78 - 5
application/admin/controller/trade/Order.php

@@ -2,7 +2,13 @@
 
 namespace app\admin\controller\trade;
 
+use think\Db;
+use Exception;
+use think\exception\DbException;
+use think\exception\PDOException;
 use app\common\controller\Backend;
+use think\exception\ValidateException;
+
 
 /**
  * 充值记录管理
@@ -18,20 +24,87 @@ class Order extends Backend
      */
     protected $model = null;
 
+
     public function _initialize()
     {
         parent::_initialize();
         $this->model = new \app\common\model\Order;
-
+        $this->view->assign("statusList", $this->model->getstatusList());
     }
 
+    /**
+     * 查看
+     *
+     * @return string|Json
+     * @throws \think\Exception
+     * @throws DbException
+     */
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+        $list = $this->model->with('users')
+            ->where($where)
+            ->order($sort, $order)
+            ->paginate($limit);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
 
 
     /**
-     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
-     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
-     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     * 操作
+     * @param $ids
+     * @return string
+     * @throws DbException
+     * @throws \think\Exception
      */
-
+    public function operate($ids = null)
+    {
+        $row = $this->model->get($ids);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        $adminIds = $this->getDataLimitAdminIds();
+        if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
+            $this->error(__('You have no permission'));
+        }
+        if (false === $this->request->isPost()) {
+            $this->view->assign('row', $row);
+            return $this->view->fetch();
+        }
+        $params = $this->request->post('row/a');
+        if (empty($params)) {
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $params = $this->preExcludeFields($params);
+        $result = false;
+        Db::startTrans();
+        try {
+            //是否采用模型验证
+            if ($this->modelValidate) {
+                $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
+                $row->validateFailException()->validate($validate);
+            }
+            $result = $row->allowField(true)->save($params);
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success();
+    }
 
 }

+ 27 - 23
application/admin/controller/user/Group.php

@@ -2,7 +2,13 @@
 
 namespace app\admin\controller\user;
 
+
+use think\Db;
+use Exception;
+use think\exception\DbException;
+use think\exception\PDOException;
 use app\common\controller\Backend;
+use think\exception\ValidateException;
 
 /**
  * 会员组管理
@@ -38,14 +44,10 @@ class Group extends Backend
             }
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
             $list = $this->model
-           
                 ->where($where)->where('is_agent', 1)
                 ->order($sort, $order)
                 ->paginate($limit);
-            // foreach ($list as $k => $v) {
-            //     $v->avatar = $v->avatar ? cdnurl($v->avatar, true) : letter_avatar($v->nickname);
-            //     $v->hidden(['password', 'salt']);
-            // }
+
             $result = array("total" => $list->total(), "rows" => $list->items());
 
             return json($result);
@@ -55,29 +57,31 @@ class Group extends Backend
 
     
 
-    public function add()
-    {
-        if ($this->request->isPost()) {
-            $this->token();
-        }
-        $nodeList = \app\admin\model\UserRule::getTreeList();
-        $this->assign("nodeList", $nodeList);
-        return parent::add();
-    }
-
-    public function edit($ids = null)
+    /**
+     * 禁用
+     * @param $ids
+     * @return string
+     * @throws DbException
+     * @throws \think\Exception
+     */
+    public function disable($ids = null, $is_lock=0)
     {
-        if ($this->request->isPost()) {
-            $this->token();
-        }
         $row = $this->model->get($ids);
         if (!$row) {
             $this->error(__('No Results were found'));
         }
-        $rules = explode(',', $row['rules']);
-        $nodeList = \app\admin\model\UserRule::getTreeList($rules);
-        $this->assign("nodeList", $nodeList);
-        return parent::edit($ids);
+        $result = false;
+        try {
+            $result = $row->allowField(true)->save(['is_lock'=>$is_lock]);
+        } catch (ValidateException|PDOException|Exception $e) {
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success();
     }
 
+
+
 }

+ 0 - 108
application/admin/controller/user/Rule.php

@@ -1,108 +0,0 @@
-<?php
-
-namespace app\admin\controller\user;
-
-use app\common\controller\Backend;
-use fast\Tree;
-
-/**
- * 会员规则管理
- *
- * @icon fa fa-circle-o
- */
-class Rule extends Backend
-{
-
-    /**
-     * @var \app\admin\model\UserRule
-     */
-    protected $model = null;
-    protected $rulelist = [];
-    protected $multiFields = 'ismenu,status';
-
-    public function _initialize()
-    {
-        parent::_initialize();
-        $this->model = model('UserRule');
-        $this->view->assign("statusList", $this->model->getStatusList());
-        // 必须将结果集转换为数组
-        $ruleList = collection($this->model->order('weigh', 'desc')->select())->toArray();
-        foreach ($ruleList as $k => &$v) {
-            $v['title'] = __($v['title']);
-            $v['remark'] = __($v['remark']);
-        }
-        unset($v);
-        Tree::instance()->init($ruleList)->icon = ['&nbsp;&nbsp;&nbsp;&nbsp;', '&nbsp;&nbsp;&nbsp;&nbsp;', '&nbsp;&nbsp;&nbsp;&nbsp;'];
-        $this->rulelist = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'title');
-        $ruledata = [0 => __('None')];
-        foreach ($this->rulelist as $k => &$v) {
-            if (!$v['ismenu']) {
-                continue;
-            }
-            $ruledata[$v['id']] = $v['title'];
-        }
-        $this->view->assign('ruledata', $ruledata);
-    }
-
-    /**
-     * 查看
-     */
-    public function index()
-    {
-        if ($this->request->isAjax()) {
-            $list = $this->rulelist;
-            $total = count($this->rulelist);
-
-            $result = array("total" => $total, "rows" => $list);
-
-            return json($result);
-        }
-        return $this->view->fetch();
-    }
-
-    /**
-     * 添加
-     */
-    public function add()
-    {
-        if ($this->request->isPost()) {
-            $this->token();
-        }
-        return parent::add();
-    }
-
-    /**
-     * 编辑
-     */
-    public function edit($ids = null)
-    {
-        if ($this->request->isPost()) {
-            $this->token();
-        }
-        return parent::edit($ids);
-    }
-
-    /**
-     * 删除
-     */
-    public function del($ids = "")
-    {
-        if (!$this->request->isPost()) {
-            $this->error(__("Invalid parameters"));
-        }
-        $ids = $ids ? $ids : $this->request->post("ids");
-        if ($ids) {
-            $delIds = [];
-            foreach (explode(',', $ids) as $k => $v) {
-                $delIds = array_merge($delIds, Tree::instance()->getChildrenIds($v, true));
-            }
-            $delIds = array_unique($delIds);
-            $count = $this->model->where('id', 'in', $delIds)->delete();
-            if ($count) {
-                $this->success();
-            }
-        }
-        $this->error();
-    }
-
-}

+ 49 - 0
application/admin/controller/user/Team.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace app\admin\controller\user;
+
+use app\common\controller\Backend;
+use fast\Tree;
+
+/**
+ * 会员团队
+ *
+ * @icon fa fa-circle-o
+ */
+class Team extends Backend
+{
+
+    /**
+     * @var \app\admin\model\UserRule
+     */
+    protected $model = null;
+ 
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = model('UserRule');
+ 
+    }
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        if ($this->request->isAjax()) {
+            $list = $this->rulelist;
+            $total = count($this->rulelist);
+
+            $result = array("total" => $total, "rows" => $list);
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+
+ 
+
+
+
+
+}

+ 210 - 22
application/admin/controller/user/User.php

@@ -2,9 +2,13 @@
 
 namespace app\admin\controller\user;
 
+use think\Db;
+use Exception;
+use app\common\model\Moneylog;
+use think\exception\DbException;
+use think\exception\PDOException;
 use app\common\controller\Backend;
-use app\common\library\Auth;
-
+use think\exception\ValidateException;
 /**
  * 会员管理
  *
@@ -14,7 +18,7 @@ class User extends Backend
 {
 
     protected $relationSearch = true;
-    protected $searchFields = 'id,username,nickname';
+    protected $searchFields = 'id,mobile';
 
     /**
      * @var \app\admin\model\User
@@ -25,6 +29,9 @@ class User extends Backend
     {
         parent::_initialize();
         $this->model = model('User');
+        $this->assign('statusList', $this->model->getStatusList());
+        $this->assign('typeList', $this->model->getTypeList());
+        
     }
 
     /**
@@ -56,50 +63,231 @@ class User extends Backend
         return $this->view->fetch();
     }
 
+
     /**
-     * 添加
+     * 余额     public function balance($ids = null)
+     * @param $ids
+     * @return string
+     * @throws DbException
+     * @throws \think\Exception
      */
-    public function add()
+    public function balance($ids = null)
     {
-        if ($this->request->isPost()) {
-            $this->token();
+        $row = $this->model->get($ids);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        $adminIds = $this->getDataLimitAdminIds();
+        if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
+            $this->error(__('You have no permission'));
+        }
+        if (false === $this->request->isPost()) {
+            $this->view->assign('row', $row);
+            return $this->view->fetch();
+        }
+        $params = $this->request->post('row/a');
+        if (empty($params)) {
+            $this->error(__('Parameter %s can not be empty', ''));
         }
-        return parent::add();
+        $params = $this->preExcludeFields($params);
+        $result = false;
+        Db::startTrans();
+        try {
+            $balance = build_amount_compute($params['type'], $params['amount'], $row->balance);
+            //操作记录
+            Moneylog::create(['user_id'=> $params['id'], 
+                'from_id'=> $this->auth->id,
+                'amount'=> $params['amount'],
+                'balance'=> $balance
+            ]);
+            $result = $row->allowField(true)->save(['balance'=>$balance]);
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success();
     }
 
     /**
-     * 编辑
+     * 卡单
+     * @param $ids
+     * @return string
+     * @throws DbException
+     * @throws \think\Exception
      */
-    public function edit($ids = null)
+    public function cardslip($ids = null)
     {
-        if ($this->request->isPost()) {
-            $this->token();
+        $row = $this->model->get($ids);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        $adminIds = $this->getDataLimitAdminIds();
+        if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
+            $this->error(__('You have no permission'));
+        }
+        if (false === $this->request->isPost()) {
+
+            $task = json_decode($row->linit_task, true);
+            $row->which_start   = $task['which_start']??'';
+            $row->min_amount    = $task['min_amount']??'';
+            $row->max_amount    = $task['max_amount']??'';
+            $row->income_multiple= $task['income_multiple']??'';
+            $this->view->assign('row', $row);
+            return $this->view->fetch();
         }
+        $params = $this->request->post('row/a');
+        if (empty($params)) {
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $params = $this->preExcludeFields($params);
+        $result = false;
+        Db::startTrans();
+        try {
+      
+            unset($params['id']);
+            $result = $row->allowField(true)->save(['linit_task'=>json_encode($params)]);
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success();
+    }
+
+    /**
+     * 收款 
+     * @param $ids
+     * @return string
+     * @throws DbException
+     * @throws \think\Exception
+     */
+    public function collection($ids = null)
+    {
         $row = $this->model->get($ids);
-        $this->modelValidate = true;
         if (!$row) {
             $this->error(__('No Results were found'));
         }
-        $this->view->assign('groupList', build_select('row[group_id]', \app\admin\model\UserGroup::column('id,name'), $row['group_id'], ['class' => 'form-control selectpicker']));
-        return parent::edit($ids);
+        $adminIds = $this->getDataLimitAdminIds();
+        if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
+            $this->error(__('You have no permission'));
+        }
+        if (false === $this->request->isPost()) {
+            $bank = json_decode($row->bank_info, true);
+            $row->real_name = $bank['real_name']??'';
+            $row->bank_name = $bank['bank_name']??'';
+            $row->bank_card = $bank['bank_card']??'';
+            $this->view->assign('row', $row);
+            return $this->view->fetch();
+        }
+        $params = $this->request->post('row/a');
+        if (empty($params)) {
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $params = $this->preExcludeFields($params);
+        $result = false;
+        Db::startTrans();
+        try {
+
+            $addr = $params['usdt_address'];
+            unset($params['id'],$params['usdt_address']);
+            $result = $row->allowField(true)->save(['usdt_address'=> $addr, 'bank_info'=>json_encode($params)]);
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success();
     }
 
+
     /**
-     * 删除
+     * 清0
+     * @param $ids
+     * @return string
+     * @throws DbException
+     * @throws \think\Exception
      */
-    public function del($ids = "")
+    public function clear($ids = null)
     {
-        if (!$this->request->isPost()) {
-            $this->error(__("Invalid parameters"));
+        $row = $this->model->get($ids);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        $adminIds = $this->getDataLimitAdminIds();
+        if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
+            $this->error(__('You have no permission'));
+        }
+        $result = false;
+        try {
+            $result = $row->allowField(true)->save(['task_num'=>0]);
+        } catch (ValidateException|PDOException|Exception $e) {
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
         }
-        $ids = $ids ? $ids : $this->request->post("ids");
+        $this->success();
+    }
+
+
+    /**
+     * 编辑
+     *
+     * @param $ids
+     * @return string
+     * @throws DbException
+     * @throws \think\Exception
+     */
+    public function edit($ids = null)
+    {
         $row = $this->model->get($ids);
-        $this->modelValidate = true;
         if (!$row) {
             $this->error(__('No Results were found'));
         }
-        Auth::instance()->delete($row['id']);
+        $adminIds = $this->getDataLimitAdminIds();
+        if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
+            $this->error(__('You have no permission'));
+        }
+        if (false === $this->request->isPost()) {
+            $this->view->assign('row', $row);
+            return $this->view->fetch();
+        }
+        $params = $this->request->post('row/a');
+        if (empty($params)) {
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $params = $this->preExcludeFields($params);
+        $result = false;
+        Db::startTrans();
+        try {
+            //是否采用模型验证
+            if ($this->modelValidate) {
+                $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
+                $row->validateFailException()->validate($validate);
+            }
+            $result = $row->allowField(true)->save($params);
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
         $this->success();
     }
 
+
+
 }

+ 14 - 0
application/admin/lang/vn/news/lists.php

@@ -0,0 +1,14 @@
+<?php
+
+return [
+    'Title'         => 'tiêu đề',
+    'Type_id'       => 'Phân loại',
+    'Img_url'       => 'Hình ảnh được đề xuất',
+    'Content'       => 'nội dung',
+    'Status'        => 'Trạng thái đã bật',
+    'Enable'        => 'cho phép',
+    'Off shelf'     => 'Đã xóa khỏi kệ',
+    'Create_time'     => 'thêm thời gian',
+    'Update_time'     => 'Cập nhật thời gian',
+
+];

+ 5 - 0
application/admin/lang/vn/news/types.php

@@ -0,0 +1,5 @@
+<?php
+
+return [
+    'Title' => 'tên danh mục'
+];

+ 11 - 0
application/admin/lang/vn/trade/moneylog.php

@@ -0,0 +1,11 @@
+<?php
+
+return [
+    'Id'          => 'ID',
+    'User_id'     => '用户',
+    'From_id'     => '来源用户',
+    'Amount'      => '变动金额',
+    'Balance'     => '实时余额',
+    'Create_time' => '创建时间',
+    'Action'      => '动作'
+];

+ 19 - 0
application/admin/lang/vn/trade/mongyin.php

@@ -0,0 +1,19 @@
+<?php
+
+return [
+    'Order_type'   => 'Kiểu đơn hàng',
+    'User_id'      => 'người dùng',
+    'Address'      => 'Địa chỉ rút tiền',
+    'Bank_name'    => 'Tên thẻ ngân hàng',
+    'Bank_card'    => 'số thẻ',
+    'Account_name' => 'AA',
+    'Amount'       => 'Số tiền nạp',
+    'Status'       => 'tình trạng',
+    'Admin_id'     => 'nhà điều hành',
+    'Usdt'         => 'USDT',
+    'Bank'         => 'Thẻ ngân hàng',
+    'Review'       => 'Ôn tập', 
+    'Create_time'  => 'thời gian sáng tạo',
+    'Update_time'  => 'Cập nhật thời gian',
+    'Confirm review'=> 'Bạn có chắc chắn muốn làm điều này?',
+];

+ 17 - 0
application/admin/lang/vn/trade/mongyout.php

@@ -0,0 +1,17 @@
+<?php
+
+return [
+    'Order_type'   => '订单类型',
+    'User_id'      => '用户ID',
+    'Address'      => '提币地址',
+    'Bank_name'    => '银行卡名称',
+    'Bank_card'    => '卡号',
+    'Account_name' => '开户名称',
+    'Amount'       => '申请金额',
+    'Fee'          => '手续费比例',
+    'Real_amount'  => '实际打款',
+    'Status'       => '状态',
+    'Admin_id'     => '操作员ID',
+    'Create_time'  => '创建时间',
+    'Update_time'  => '更新时间'
+];

+ 20 - 0
application/admin/lang/vn/trade/order.php

@@ -0,0 +1,20 @@
+<?php
+
+return [
+    'Order_no'      => '订单号',
+    'User_id'       => '用户ID',
+    'Title'         => '产品名称',
+    'Amount'        => '金额',
+    'Bonus'         => '佣金',
+    'Status'        => '状态',
+    'Create_time'   => '创建时间',
+    'Update_time'   => '更新时间',
+    'Note'          => '备注',
+    'Unpaid'        => '未支付',
+    'Finish'        => '完成',
+    'Freeze'        => '冻结',
+    'Cancel'        => '取消',
+
+
+
+];

+ 14 - 6
application/admin/lang/vn/user/group.php

@@ -1,10 +1,18 @@
 <?php
 
 return [
-    'Name'            => '组名',
-    'Rules'           => '权限节点',
-    'Change password' => '修改密码',
-    'Createtime'      => '添加时间',
-    'Updatetime'      => '更新时间',
-    'Status'          => '状态'
+    'Mobile'                    => 'Điện thoại di động',
+    'Invitation_code'           => 'Mã mời',
+    'Agent_in_usdt'             => 'Chuyển đổi tiền gửi USDT',
+    'Agent_in_bank'             => 'Công tắc nạp tiền thẻ ngân hàng',
+    'Agent_out_usdt'            => 'Công tắc rút USDT',
+    'Agent_out_bank'            => 'Công tắc rút tiền mặt thẻ ngân hàng',
+    'Service_link'              => 'Liên kết dịch vụ khách hàng',
+    'Team'                      => 'Kích thước nhóm',
+    'Createtime'                => 'thêm thời gian',
+    'Updatetime'                => 'Cập nhật thời gian',
+    'Status'                    => 'tình trạng',
+    'Open'                      => 'bật',
+    'Close'                     => 'Khép kín',
+    'Disable'                   => 'Vô hiệu hóa',
 ];

+ 13 - 0
application/admin/lang/zh-cn/news/lists.php

@@ -0,0 +1,13 @@
+<?php
+
+return [
+    'Title'         => '标题',
+    'Type_id'       => '分类',
+    'Img_url'       => '推荐图片',
+    'Content'       => '内容',
+    'Status'        => '启用状态',
+    'Enable'        => '启用',
+    'Off shelf'     => '下架',
+    'Create_time'   => '添加时间',
+    'Update_time'   => '更新时间',
+];

+ 5 - 0
application/admin/lang/zh-cn/news/types.php

@@ -0,0 +1,5 @@
+<?php
+
+return [
+    'Title' => '分类名称'
+];

+ 2 - 2
application/admin/lang/zh-cn/trade/moneylog.php

@@ -2,8 +2,8 @@
 
 return [
     'Id'          => 'ID',
-    'User_id'     => '用户ID',
-    'From_id'     => '来源用户ID',
+    'User_id'     => '用户',
+    'From_id'     => '来源用户',
     'Amount'      => '变动金额',
     'Balance'     => '实时余额',
     'Create_time' => '创建时间',

+ 11 - 3
application/admin/lang/zh-cn/trade/mongyin.php

@@ -2,14 +2,22 @@
 
 return [
     'Order_type'   => '订单类型',
-    'User_id'      => '用户ID',
+    'User_id'      => '用户',
     'Address'      => '提币地址',
     'Bank_name'    => '银行卡名称',
     'Bank_card'    => '卡号',
     'Account_name' => '开户名称',
     'Amount'       => '充值金额',
     'Status'       => '状态',
-    'Admin_id'     => '操作员ID',
+    'Admin_id'     => '操作员',
+    'Usdt'         => 'USDT',
+    'Bank'         => '银行卡',
+    'Review'       => '审核', 
     'Create_time'  => '创建时间',
-    'Update_time'  => '更新时间'
+    'Update_time'  => '更新时间',
+    'Confirm review'=> '确定执行该操作吗?',
+
+    'Pending'       => '待处理',
+    'Success'       => '成功',
+    'Fail'          => '失败',
 ];

+ 10 - 3
application/admin/lang/zh-cn/trade/mongyout.php

@@ -2,7 +2,7 @@
 
 return [
     'Order_type'   => '订单类型',
-    'User_id'      => '用户ID',
+    'User_id'      => '用户',
     'Address'      => '提币地址',
     'Bank_name'    => '银行卡名称',
     'Bank_card'    => '卡号',
@@ -11,7 +11,14 @@ return [
     'Fee'          => '手续费比例',
     'Real_amount'  => '实际打款',
     'Status'       => '状态',
-    'Admin_id'     => '操作员ID',
+    'Admin_id'     => '操作员',
+    'Review'       => '审核', 
     'Create_time'  => '创建时间',
-    'Update_time'  => '更新时间'
+    'Update_time'  => '更新时间',
+    'Confirm review'=> '确定执行该操作吗?',
+    'Usdt'         => 'USDT',
+    'Bank'         => '银行卡',
+    'Pending'       => '待处理',
+    'Success'       => '成功',
+    'Fail'          => '失败',
 ];

+ 16 - 9
application/admin/lang/zh-cn/trade/order.php

@@ -1,13 +1,20 @@
 <?php
 
 return [
-    'Order_no'    => '订单号',
-    'User_id'     => '用户ID',
-    'Title'       => '产品名称',
-    'Amount'      => '金额',
-    'Bonus'       => '佣金',
-    'Status'      => '状态',
-    'Create_time' => '创建时间',
-    'Update_time' => '更新时间',
-    'Note'        => '备注'
+    'Order_no'      => '订单号',
+    'User_id'       => '用户ID',
+    'Title'         => '产品名称',
+    'Amount'        => '金额',
+    'Bonus'         => '佣金',
+    'Status'        => '状态',
+    'Create_time'   => '创建时间',
+    'Update_time'   => '更新时间',
+    'Note'          => '备注',
+    'Unpaid'        => '未支付',
+    'Finish'        => '完成',
+    'Freeze'        => '冻结',
+    'Cancel'        => '取消',
+
+
+
 ];

+ 2 - 1
application/admin/lang/zh-cn/user/group.php

@@ -13,5 +13,6 @@ return [
     'Updatetime'                => '更新时间',
     'Status'                    => '状态',
     'Open'                      => '开启',
-    'Close'                     => '关闭'
+    'Close'                     => '关闭',
+    'Disable'                   => '禁用',
 ];

+ 20 - 3
application/admin/lang/zh-cn/user/user.php

@@ -10,18 +10,35 @@ return [
     'Task'                  => '本轮已做任务量',
     'Invitation_code'       => '邀请码',
     'Is_agent'              => '代理',
-    'User_type'             => '用户类型',
-    'Status'                => '状态',
+    'User_type'             => '用户类型(真人/假人)',
+    'Status'                => '状态(是/否)',
     'Recharge'              => '充值',
     'Withdrawal'            => '提现',
     'Income'                => '收益',
-    
+    'Account change'        => '帐变',
+    'Clear'                 => '清零',
+    'Team'                  => '团队',
+    'Card slip'             => '卡单',
+    'Collection'            => '收款', 
     'Yes'                   => '是',
     'No'                    => '否',
     'Dummy'                 => '假人',
     'Real person'           => '真人',
     'Locking'               => '锁定',
+    'New'                   => '新增',
+    'Reduce'                => '减少',
+    'Type'                  => '类型',
+    'Amount'                => '金额',
 
+    
+    'USDT address'          => 'USDT钱包地址',
+    'Real name'             => '姓名',
+    'Bank name'             => '开户行',
+    'Bank card'             => '卡号',
+    'Which start'           => '第几单开始',
+    'Min amount'            => '最小金额',
+    'Max amount'            => '最大金额',
+    'Income multiple'       => '收益倍数',
 
 
 

+ 6 - 4
application/admin/model/User.php

@@ -57,14 +57,16 @@ class User extends Model
         });
     }
 
-    public function getGenderList()
+    
+    public function getStatusList()
     {
-        return ['1' => __('Male'), '0' => __('Female')];
+        return ['1' => __('Open'), '0' => __('Close')];
     }
 
-    public function getStatusList()
+    
+    public function getTypeList()
     {
-        return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
+        return [0 => __('New'), 1 => __('Reduce')];
     }
 
 

+ 0 - 34
application/admin/model/UserGroup.php

@@ -1,34 +0,0 @@
-<?php
-
-namespace app\admin\model;
-
-use think\Model;
-
-class UserGroup extends Model
-{
-
-    // 表名
-    protected $name = 'user_group';
-    // 自动写入时间戳字段
-    protected $autoWriteTimestamp = 'int';
-    // 定义时间戳字段名
-    protected $createTime = 'createtime';
-    protected $updateTime = 'updatetime';
-    // 追加属性
-    protected $append = [
-        'status_text'
-    ];
-
-    public function getStatusList()
-    {
-        return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
-    }
-
-    public function getStatusTextAttr($value, $data)
-    {
-        $value = $value ? $value : $data['status'];
-        $list = $this->getStatusList();
-        return isset($list[$value]) ? $list[$value] : '';
-    }
-
-}

+ 28 - 0
application/admin/model/UserPath.php

@@ -0,0 +1,28 @@
+<?php
+
+namespace app\admin\model;
+
+use fast\Tree;
+use think\Model;
+
+class UserPath extends Model
+{
+
+    // 表名
+    protected $name = 'user_path';
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    // 追加属性
+    protected $append = [
+
+    ];
+
+
+
+
+  
+
+}

+ 0 - 67
application/admin/model/UserRule.php

@@ -1,67 +0,0 @@
-<?php
-
-namespace app\admin\model;
-
-use fast\Tree;
-use think\Model;
-
-class UserRule extends Model
-{
-
-    // 表名
-    protected $name = 'user_rule';
-    // 自动写入时间戳字段
-    protected $autoWriteTimestamp = 'int';
-    // 定义时间戳字段名
-    protected $createTime = 'createtime';
-    protected $updateTime = 'updatetime';
-    // 追加属性
-    protected $append = [
-        'status_text'
-    ];
-
-    protected static function init()
-    {
-        self::afterInsert(function ($row) {
-            $pk = $row->getPk();
-            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
-        });
-    }
-
-    public function getTitleAttr($value, $data)
-    {
-        return __($value);
-    }
-
-    public function getStatusList()
-    {
-        return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
-    }
-
-    public function getStatusTextAttr($value, $data)
-    {
-        $value = $value ? $value : $data['status'];
-        $list = $this->getStatusList();
-        return isset($list[$value]) ? $list[$value] : '';
-    }
-
-    public static function getTreeList($selected = [])
-    {
-        $ruleList = collection(self::where('status', 'normal')->order('weigh desc,id desc')->select())->toArray();
-        $nodeList = [];
-        Tree::instance()->init($ruleList);
-        $ruleList = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'name');
-        $hasChildrens = [];
-        foreach ($ruleList as $k => $v)
-        {
-            if ($v['haschild'])
-                $hasChildrens[] = $v['id'];
-        }
-        foreach ($ruleList as $k => $v) {
-            $state = array('selected' => in_array($v['id'], $selected) && !in_array($v['id'], $hasChildrens));
-            $nodeList[] = array('id' => $v['id'], 'parent' => $v['pid'] ? $v['pid'] : '#', 'text' => __($v['title']), 'type' => 'menu', 'state' => $state);
-        }
-        return $nodeList;
-    }
-
-}

+ 27 - 0
application/admin/validate/news/Lists.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate\news;
+
+use think\Validate;
+
+class Lists extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 27 - 0
application/admin/validate/news/Types.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate\news;
+
+use think\Validate;
+
+class Types extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 0 - 4
application/admin/view/goods/goods/index.html

@@ -11,10 +11,6 @@
                         <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('goods/goods/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('goods/goods/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
                         
-
-                        
-
-                        
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                            data-operate-edit="{:$auth->check('goods/goods/edit')}"

+ 44 - 0
application/admin/view/news/lists/add.html

@@ -0,0 +1,44 @@
+<form id="add-form" role="form" data-toggle="validator" method="POST" action="">
+    <div class="form-horizontal">
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" class="form-control" name="row[title]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Type_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-type_id" data-rule="required" data-field="title" data-source="news/types/index" class="form-control selectpage" name="row[type_id]" type="text" value="">
+        </div>
+    </div>
+  
+    <div class="form-group">
+        <label for="c-img_url" class="control-label col-xs-12 col-sm-2">{:__('Img_url')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-img_url" data-rule="" class="form-control" size="50" name="row[img_url]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-img_url" class="btn btn-danger faupload" data-input-id="c-img_url" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-img_url"><i class="fa fa-upload"></i> 上传</button></span>
+                    <span><button type="button" id="fachoose-img_url" class="btn btn-primary fachoose" data-input-id="c-img_url" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> 选择</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-img_url"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-img_url"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
+        </div>
+    </div>
+ 
+
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div></div>
+</form>

+ 51 - 0
application/admin/view/news/lists/edit.html

@@ -0,0 +1,51 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Type_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-type_id" data-rule="required" data-source="type/index" class="form-control selectpage" name="row[type_id]" type="text" value="{$row.type_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Img_url')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-img_url" class="form-control" name="row[img_url]" type="text" value="{$row.img_url|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-status" class="form-control" name="row[status]" type="number" value="{$row.status|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 29 - 0
application/admin/view/news/lists/index.html

@@ -0,0 +1,29 @@
+<div class="panel panel-default panel-intro">
+    {:build_heading()}
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <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('news/lists/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('news/lists/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('news/lists/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('news/lists/edit')}"
+                           data-operate-del="{:$auth->check('news/lists/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 15 - 0
application/admin/view/news/types/add.html

@@ -0,0 +1,15 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" class="form-control" name="row[title]" type="text">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 15 - 0
application/admin/view/news/types/edit.html

@@ -0,0 +1,15 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 29 - 0
application/admin/view/news/types/index.html

@@ -0,0 +1,29 @@
+<div class="panel panel-default panel-intro">
+    {:build_heading()}
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <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('news/types/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('news/types/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('news/types/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('news/types/edit')}"
+                           data-operate-del="{:$auth->check('news/types/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 0 - 45
application/admin/view/trade/moneylog/add.html

@@ -1,45 +0,0 @@
-<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('From_id')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-from_id" data-rule="required" data-source="from/index" class="form-control selectpage" name="row[from_id]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Amount')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-amount" data-rule="required" class="form-control" step="0.000001" name="row[amount]" type="number" value="0.000000">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Balance')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-balance" data-rule="required" class="form-control" step="0.000001" name="row[balance]" type="number" value="0.000000">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Action')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-action" data-rule="required" class="form-control" name="row[action]" type="number" value="0">
-        </div>
-    </div>
-    <div class="form-group layer-footer">
-        <label class="control-label col-xs-12 col-sm-2"></label>
-        <div class="col-xs-12 col-sm-8">
-            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
-        </div>
-    </div>
-</form>

+ 0 - 45
application/admin/view/trade/moneylog/edit.html

@@ -1,45 +0,0 @@
-<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('From_id')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-from_id" data-rule="required" data-source="from/index" class="form-control selectpage" name="row[from_id]" type="text" value="{$row.from_id|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Amount')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-amount" data-rule="required" class="form-control" step="0.000001" name="row[amount]" type="number" value="{$row.amount|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Balance')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-balance" data-rule="required" class="form-control" step="0.000001" name="row[balance]" type="number" value="{$row.balance|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Action')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-action" data-rule="required" class="form-control" name="row[action]" type="number" value="{$row.action|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group layer-footer">
-        <label class="control-label col-xs-12 col-sm-2"></label>
-        <div class="col-xs-12 col-sm-8">
-            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
-        </div>
-    </div>
-</form>

+ 0 - 10
application/admin/view/trade/moneylog/index.html

@@ -7,18 +7,8 @@
                 <div class="widget-body no-padding">
                     <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('trade/moneylog/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('trade/moneylog/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('trade/moneylog/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
-                        
-
-                        
-
-                        
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
-                           data-operate-edit="{:$auth->check('trade/moneylog/edit')}"
-                           data-operate-del="{:$auth->check('trade/moneylog/del')}"
                            width="100%">
                     </table>
                 </div>

+ 0 - 69
application/admin/view/trade/mongyin/add.html

@@ -1,69 +0,0 @@
-<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Order_type')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-order_type" data-rule="required" class="form-control" name="row[order_type]" type="number" value="0">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-address" class="form-control" name="row[address]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Bank_name')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-bank_name" class="form-control" name="row[bank_name]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Bank_card')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-bank_card" class="form-control" name="row[bank_card]" type="text">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Account_name')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-account_name" class="form-control" name="row[account_name]" type="text">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Amount')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-amount" data-rule="required" class="form-control" step="0.000001" name="row[amount]" type="number" value="0.000000">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="0">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
-        </div>
-    </div>
-    <div class="form-group layer-footer">
-        <label class="control-label col-xs-12 col-sm-2"></label>
-        <div class="col-xs-12 col-sm-8">
-            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
-        </div>
-    </div>
-</form>

+ 10 - 12
application/admin/view/trade/mongyin/index.html

@@ -1,24 +1,22 @@
 <div class="panel panel-default panel-intro">
-    {:build_heading()}
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs">
+            <li class="active"><a href="#all" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="typeList" item="vo"}
+                <li><a href="#{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
 
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">
             <div class="tab-pane fade active in" id="one">
                 <div class="widget-body no-padding">
                     <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('trade/mongyin/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('trade/mongyin/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('trade/mongyin/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
-                        
-
-                        
-
-                        
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>  
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
-                           data-operate-edit="{:$auth->check('trade/mongyin/edit')}"
-                           data-operate-del="{:$auth->check('trade/mongyin/del')}"
                            width="100%">
                     </table>
                 </div>

+ 9 - 10
application/admin/view/trade/mongyout/index.html

@@ -1,20 +1,19 @@
 <div class="panel panel-default panel-intro">
-    {:build_heading()}
-
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs">
+            <li class="active"><a href="#all" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="typeList" item="vo"}
+                <li><a href="#{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">
             <div class="tab-pane fade active in" id="one">
                 <div class="widget-body no-padding">
                     <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('trade/mongyout/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('trade/mongyout/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('trade/mongyout/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
-                        
-
-                        
-
-                        
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                            data-operate-edit="{:$auth->check('trade/mongyout/edit')}"

+ 0 - 63
application/admin/view/trade/order/add.html

@@ -1,63 +0,0 @@
-<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Order_no')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-order_no" class="form-control" name="row[order_no]" type="text">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-title" class="form-control" name="row[title]" type="text">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Amount')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-amount" data-rule="required" class="form-control" step="0.000001" name="row[amount]" type="number" value="0.000000">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Bonus')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-bonus" data-rule="required" class="form-control" step="0.000001" name="row[bonus]" type="number" value="0.000000">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="0">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Note')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-note" class="form-control" name="row[note]" type="text">
-        </div>
-    </div>
-    <div class="form-group layer-footer">
-        <label class="control-label col-xs-12 col-sm-2"></label>
-        <div class="col-xs-12 col-sm-8">
-            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
-        </div>
-    </div>
-</form>

+ 0 - 63
application/admin/view/trade/order/edit.html

@@ -1,63 +0,0 @@
-<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Order_no')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-order_no" class="form-control" name="row[order_no]" type="text" value="{$row.order_no|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Amount')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-amount" data-rule="required" class="form-control" step="0.000001" name="row[amount]" type="number" value="{$row.amount|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Bonus')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-bonus" data-rule="required" class="form-control" step="0.000001" name="row[bonus]" type="number" value="{$row.bonus|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="{$row.status|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Note')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-note" class="form-control" name="row[note]" type="text" value="{$row.note|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group layer-footer">
-        <label class="control-label col-xs-12 col-sm-2"></label>
-        <div class="col-xs-12 col-sm-8">
-            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
-        </div>
-    </div>
-</form>

+ 1 - 10
application/admin/view/trade/order/index.html

@@ -7,18 +7,9 @@
                 <div class="widget-body no-padding">
                     <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('trade/order/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('trade/order/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('trade/order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
-                        
-
-                        
-
-                        
+       
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
-                           data-operate-edit="{:$auth->check('trade/order/edit')}"
-                           data-operate-del="{:$auth->check('trade/order/del')}"
                            width="100%">
                     </table>
                 </div>

+ 24 - 0
application/admin/view/trade/order/operate.html

@@ -0,0 +1,24 @@
+<form id="edit-form" role="form" data-toggle="validator" method="POST" action="">
+
+    <div  class="form-horizontal">
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            {:Form::radios('row[status]', $statusList, 1, ['data-rule'=>'required'])}
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Note')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            {:Form::textarea('row[note]', '', ['data-rule'=>'required'])}
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+   </div>
+</form>

+ 29 - 21
application/admin/view/user/group/edit.html

@@ -1,41 +1,49 @@
-<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-    {:token()}
-    <input type="hidden" name="row[rules]" value="{$row.rules}" />
+
+
+<form id="edit-form" class=" form-ajax" role="form" data-toggle="validator" method="POST" action="">
+
+
+    <div class="form-horizontal">
+       
     <div class="form-group">
-        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <label for="c-agent_in_usdt" class="control-label col-xs-12 col-sm-2">{:__('Agent_in_usdt')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
+            {:Form::radios('row[agent_in_usdt]', $statusList, $row.agent_in_usdt, ['data-rule'=>'required'])}
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Permission')}:</label>
+        <label for="c-agent_in_bank" class="control-label col-xs-12 col-sm-2">{:__('Agent_in_bank')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <span class="text-muted"><input type="checkbox" name="" id="checkall" /> <label for="checkall"><small>{:__('Check all')}</small></label></span>
-            <span class="text-muted"><input type="checkbox" name="" id="expandall" /> <label for="expandall"><small>{:__('Expand all')}</small></label></span>
+            {:Form::radios('row[agent_in_bank]', $statusList, $row.agent_in_bank, ['data-rule'=>'required'])}
+        </div>
+    </div>
 
-            <div id="treeview"></div>
+    <div class="form-group">
+        <label for="c-agent_out_usdt" class="control-label col-xs-12 col-sm-2">{:__('Agent_out_usdt')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            {:Form::radios('row[agent_out_usdt]', $statusList, $row.agent_out_usdt, ['data-rule'=>'required'])}
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <label for="c-agent_out_bank" class="control-label col-xs-12 col-sm-2">{:__('Agent_out_bank')}:</label>
         <div class="col-xs-12 col-sm-8">
-
-            <div class="radio">
-            {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
-            {/foreach}
-            </div>
-
+            {:Form::radios('row[agent_out_bank]', $statusList, $row.agent_out_bank, ['data-rule'=>'required'])}
+        </div>
+    </div>
+    <div class="form-group">
+        <label for="c-service_link" class="control-label col-xs-12 col-sm-2">{:__('Service_link')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input type="text" name="row[service_link]" value="{$row.service_link|htmlentities}"  id="c-service_link" class="form-control" />
         </div>
     </div>
-    <div class="form-group layer-footer">
+
+
+    <div class="form-group hide layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">
             <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
             <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
         </div>
     </div>
+    </div>
 </form>
-<script>
-    var nodeData = {:json_encode($nodeList); };
-</script>

+ 2 - 4
application/admin/view/user/group/index.html

@@ -6,12 +6,10 @@
             <div class="tab-pane fade active in" id="one">
                 <div class="widget-body no-padding">
                     <div id="toolbar" class="toolbar">
-                 
-              
+                        {:build_toolbar('refresh')}
+
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
-                           data-operate-edit="{:$auth->check('user/group/edit')}"
-                           data-operate-del="{:$auth->check('user/group/del')}"
                            width="100%">
                     </table>
                 </div>

+ 0 - 0
application/admin/view/user/rule/add.html → application/admin/view/user/team/add.html


+ 0 - 0
application/admin/view/user/rule/edit.html → application/admin/view/user/team/edit.html


+ 0 - 0
application/admin/view/user/rule/index.html → application/admin/view/user/team/index.html


+ 41 - 0
application/admin/view/user/user/balance.html

@@ -0,0 +1,41 @@
+<form id="edit-form" role="form" data-toggle="validator" method="POST" action="">
+    {:token()}
+    <div class="form-horizontal">
+    <input type="hidden" name="row[id]" value="{$row.id}">
+    <div class="form-group">
+        <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mobile" data-rule="mobile" disabled class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label for="c-balance" class="control-label col-xs-12 col-sm-2">{:__('Balance')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-balance" disabled class="form-control" name="row[balance]" type="number" value="{$row.balance}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label for="c-agent_in_usdt" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            {:Form::radios('row[type]', $typeList, 0, ['data-rule'=>'required'])}
+        </div>
+    </div>
+    
+    <div class="form-group">
+        <label for="c-balance" class="control-label col-xs-12 col-sm-2">{:__('Amount')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-amount" data-rule="required" class="form-control" name="row[amount]" type="number" value="">
+        </div>
+    </div>
+ 
+
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+    </div>
+</form>

+ 40 - 0
application/admin/view/user/user/cardslip.html

@@ -0,0 +1,40 @@
+<form id="edit-form" role="form" data-toggle="validator" method="POST" action="">
+    {:token()}
+    <div class="form-horizontal">
+    <input type="hidden" name="row[id]" value="{$row.id}">
+    <div class="form-group">
+        <label for="c-which_start" class="control-label col-xs-12 col-sm-2">{:__('Which start')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-which_start" data-rule="required" class="form-control" name="row[which_start]" type="number" value="{$row.which_start|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label for="c-min_amount" class="control-label col-xs-12 col-sm-2">{:__('Min amount')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-min_amount" data-rule="required" class="form-control" name="row[min_amount]" type="text" value="{$row.min_amount|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label for="c-max_amount" class="control-label col-xs-12 col-sm-2">{:__('Max amount')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-max_amount" data-rule="required" class="form-control" name="row[max_amount]" type="number" value="{$row.max_amount|htmlentities}">
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label for="c-income_multiple" class="control-label col-xs-12 col-sm-2">{:__('Income multiple')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-income_multiple" data-rule="required" class="form-control" name="row[income_multiple]" type="number" value="{$row.income_multiple|htmlentities}">
+        </div>
+    </div>
+ 
+
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed ">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+    </div>
+</form>

+ 42 - 0
application/admin/view/user/user/collection.html

@@ -0,0 +1,42 @@
+<form id="edit-form" role="form" data-toggle="validator" method="POST" action="">
+    {:token()}
+    <div class="form-horizontal">
+    <input type="hidden" name="row[id]" value="{$row.id}">
+    
+    <div class="form-group">
+        <label for="c-usdt_address" class="control-label col-xs-12 col-sm-2">{:__('USDT address')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-usdt_address" data-rule="required" class="form-control" name="row[usdt_address]" type="text" value="{$row.usdt_address|htmlentities}">
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label for="c-real_name" class="control-label col-xs-12 col-sm-2">{:__('Real name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-real_name" data-rule="required" class="form-control" name="row[real_name]" type="text" value="{$row.real_name|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label for="c-bank_name" class="control-label col-xs-12 col-sm-2">{:__('Bank name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-bank_name" data-rule="required" class="form-control" name="row[bank_name]" type="number" value="{$row.bank_name|htmlentities}">
+        </div>
+    </div>
+
+    <div class="form-group">
+        <label for="c-bank_card" class="control-label col-xs-12 col-sm-2">{:__('Bank card')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-bank_card" data-rule="required" class="form-control" name="row[bank_card]" type="number" value="{$row.bank_card|htmlentities}">
+        </div>
+    </div>
+ 
+
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed ">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+    </div>
+</form>

+ 2 - 24
application/admin/view/user/user/edit.html

@@ -1,36 +1,13 @@
 <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
     {:token()}
     <input type="hidden" name="row[id]" value="{$row.id}">
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Group')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            {$groupList}
-        </div>
-    </div>
-    <div class="form-group">
-        <label for="c-username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            <input id="c-username" data-rule="required" class="form-control" name="row[username]" type="text" value="{$row.username|htmlentities}">
-        </div>
-    </div>
-    <div class="form-group">
-        <label for="c-nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            <input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text" value="{$row.nickname|htmlentities}">
-        </div>
-    </div>
     <div class="form-group">
         <label for="c-password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
         <div class="col-xs-12 col-sm-4">
             <input id="c-password" data-rule="password" class="form-control" name="row[password]" type="password" value="" placeholder="{:__('Leave password blank if dont want to change')}" autocomplete="new-password" />
         </div>
     </div>
-    <div class="form-group">
-        <label for="c-email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            <input id="c-email" data-rule="email" class="form-control" name="row[email]" type="text" value="{$row.email|htmlentities}">
-        </div>
-    </div>
+
     <div class="form-group">
         <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
         <div class="col-xs-12 col-sm-4">
@@ -51,6 +28,7 @@
             <ul class="row list-inline faupload-preview" id="p-avatar"></ul>
         </div>
     </div>
+
     <div class="form-group">
         <label for="c-level" class="control-label col-xs-12 col-sm-2">{:__('Level')}:</label>
         <div class="col-xs-12 col-sm-4">

+ 13 - 10
application/admin/view/user/user/index.html

@@ -6,18 +6,21 @@
             <div class="tab-pane fade active in" id="one">
                 <div class="widget-body no-padding">
                     <div id="toolbar" class="toolbar">
-                        {:build_toolbar('refresh,edit,del')}
-                        <div class="dropdown btn-group {:$auth->check('user/user/multi')?'':'hide'}">
-                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
-                            <ul class="dropdown-menu text-left" role="menu">
-                                <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>
+                        {:build_toolbar('refresh')}
+                        <a href="javascript:;" class="btn btn-success btn-balance btn-disabled disabled {:$auth->check('user/user/balance')?'':'hide'}" title="{:__('Balance')}" >
+                            {:__('Balance')}
+                        </a>
+                        <a href="javascript:;" class="btn btn-info btn-cardslip btn-disabled disabled {:$auth->check('user/user/cardslip')?'':'hide'}" title="{:__('Card slip')}" >
+                            {:__('Card slip')}
+                        </a>
+                        <a href="javascript:;" class="btn btn-primary btn-collection btn-disabled disabled {:$auth->check('user/user/collection')?'':'hide'}" title="{:__('Collection')}" >
+                            {:__('Collection')}
+                        </a>
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
-                           data-operate-edit="{:$auth->check('user/user/edit')}"
-                           data-operate-del="{:$auth->check('user/user/del')}"
+                           data-operate-balance="{:$auth->check('user/user/balance')}"
+                           data-operate-cardSlip="{:$auth->check('user/user/cardSlip')}"
+                           data-operate-collection="{:$auth->check('user/user/collection')}"
                            width="100%">
                     </table>
                 </div>

+ 22 - 0
application/common.php

@@ -560,3 +560,25 @@ EOT;
         return $icon;
     }
 }
+
+
+
+/**
+ * 生成文件后缀图片
+ * @param string $unit +-
+ * @param float   $amount  调整金额
+ * @param float   $balance 余额
+ * @return float
+ */
+function build_amount_compute($unit, $amount, $balance): float
+{   $res = 0;
+    switch ($unit) {
+        case 0:
+            $res =bcadd($amount, $balance, 6);
+            break;
+        default:
+            // 如果没有匹配的值
+            if($balance > $amount) $res = bcsub($balance, $amount, 6);     
+    }
+    return $res;
+}

+ 65 - 0
application/common/model/Lists.php

@@ -0,0 +1,65 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+
+class Lists extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'news';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'int';
+
+    // 定义时间戳字段名
+    protected $createTime = 'create_time';
+    protected $updateTime = 'update_time';
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'create_time_text',
+        'update_time_text'
+    ];
+    
+
+    public function types()
+    {
+        return $this->hasOne('Types','id','type_id',[],'LEFT')->setEagerlyType(0);
+    }
+
+
+
+
+    public function getCreateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getUpdateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setCreateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setUpdateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+}

+ 11 - 3
application/common/model/Moneylog.php

@@ -16,10 +16,10 @@ class Moneylog extends Model
     protected $name = 'money_log';
     
     // 自动写入时间戳字段
-    protected $autoWriteTimestamp = false;
+    protected $autoWriteTimestamp = 'int';
 
     // 定义时间戳字段名
-    protected $createTime = false;
+    protected $createTime = 'create_time';
     protected $updateTime = false;
     protected $deleteTime = false;
 
@@ -28,9 +28,17 @@ class Moneylog extends Model
         'create_time_text'
     ];
     
-
     
+    //
+    public function users()
+    {
+        return $this->hasOne('User','id','user_id',[],'LEFT')->setEagerlyType(0);
+    }
 
+    public function fromuser()
+    {
+        return $this->hasOne('User','id','from_id',[],'LEFT')->setEagerlyType(0);
+    }
 
 
     public function getCreateTimeTextAttr($value, $data)

+ 13 - 0
application/common/model/Mongyin.php

@@ -30,9 +30,22 @@ class Mongyin extends Model
     ];
     
 
+    //操作列表
+    public function getTypeList()
+    {
+        return [1 => __('Usdt'), 2 => __('Bank')];
+    }
     
 
+    public function users()
+    {
+        return $this->hasOne('User','id','user_id',[],'LEFT')->setEagerlyType(0);
+    }
 
+    public function admins()
+    {
+        return $this->hasOne('\app\admin\model\Admin','id','admin_id',[],'LEFT')->setEagerlyType(0);
+    }
 
     public function getCreateTimeTextAttr($value, $data)
     {

+ 14 - 1
application/common/model/Mongyout.php

@@ -31,9 +31,22 @@ class Mongyout extends Model
     
 
     
+    //操作列表
+    public function getTypeList()
+    {
+        return [1 => __('Usdt'), 2 => __('Bank')];
+    }
 
+    public function users()
+    {
+        return $this->hasOne('User','id','user_id',[],'LEFT')->setEagerlyType(0);
+    }
 
-
+    public function admins()
+    {
+        return $this->hasOne('\app\admin\model\Admin','id','admin_id',[],'LEFT')->setEagerlyType(0);
+    }
+    
     public function getCreateTimeTextAttr($value, $data)
     {
         $value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');

+ 18 - 2
application/common/model/Order.php

@@ -20,7 +20,7 @@ class Order extends Model
 
     // 定义时间戳字段名
     protected $createTime = 'create_time';
-    protected $updateTime = 'create_time';
+    protected $updateTime = 'update_time';
     protected $deleteTime = false;
 
     // 追加属性
@@ -29,9 +29,25 @@ class Order extends Model
         'update_time_text'
     ];
     
-
     
+    //订单状态: 0未支付 1完成 2冻结 3取消
+    const STATUSUNPAID = 0;
+    const STATUSFINISH = 1;
+    const STATUSFREEZE = 2;
+    const STATUSCANCEL = 3;
+
 
+    //users
+    public function users()
+    {
+        return $this->hasOne('User','id','user_id',[],'LEFT')->setEagerlyType(0);
+    }
+
+    //操作列表
+    public function getstatusList()
+    {
+        return [1 => __('Finish'), 2 => __('Freeze'), 3 => __('Cancel')];
+    }
 
 
     public function getCreateTimeTextAttr($value, $data)

+ 38 - 0
application/common/model/Types.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+
+class Types extends Model
+{
+
+    
+
+    // 表名
+    protected $name = 'news_type';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+
+    ];
+    
+
+    
+
+
+
+
+
+
+
+}

+ 59 - 0
public/assets/js/backend/news/lists.js

@@ -0,0 +1,59 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'news/lists/index' + location.search,
+                    add_url: 'news/lists/add',
+                    edit_url: 'news/lists/edit',
+                    del_url: 'news/lists/del',
+                    multi_url: 'news/lists/multi',
+                    import_url: 'news/lists/import',
+                    table: 'news',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'title', title: __('Title'), operate: 'LIKE'},
+                        {field: 'types.title', title: __('Type_id')},
+                        {field: 'img_url', title: __('Img_url'), events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'status', title: __('Status'), 
+                            searchList: {"1":__('Enable'),"0":__('Off shelf')}, 
+                            formatter: Table.api.formatter.toggle
+                        },
+                        {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'operate', title: __('Operate'), 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;
+});

+ 51 - 0
public/assets/js/backend/news/types.js

@@ -0,0 +1,51 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'news/types/index' + location.search,
+                    add_url: 'news/types/add',
+                    edit_url: 'news/types/edit',
+                    del_url: 'news/types/del',
+                    multi_url: 'news/types/multi',
+                    import_url: 'news/types/import',
+                    table: 'news_type',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'title', title: __('Title'), operate: 'LIKE'},
+                        {field: 'operate', title: __('Operate'), 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;
+});

+ 9 - 12
public/assets/js/backend/trade/moneylog.js

@@ -5,12 +5,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             // 初始化表格参数配置
             Table.api.init({
                 extend: {
-                    index_url: 'trade/moneylog/index' + location.search,
-                    add_url: 'trade/moneylog/add',
-                    edit_url: 'trade/moneylog/edit',
-                    del_url: 'trade/moneylog/del',
-                    multi_url: 'trade/moneylog/multi',
-                    import_url: 'trade/moneylog/import',
+                    index_url: 'trade/moneylog/index' + location.search +'&user_id='+Config.user_id,
                     table: 'money_log',
                 }
             });
@@ -22,17 +17,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 url: $.fn.bootstrapTable.defaults.extend.index_url,
                 pk: 'id',
                 sortName: 'id',
+                
+                searchFormVisible: false,
                 columns: [
                     [
                         {checkbox: true},
-                        {field: 'id', title: __('Id')},
-                        {field: 'user_id', title: __('User_id')},
-                        {field: 'from_id', title: __('From_id')},
-                        {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
-                        {field: 'balance', title: __('Balance'), operate:'BETWEEN'},
+                        {field: 'id', title: __('Id'), operate: false},
+                        {field: 'users.mobile', title: __('User_id')},
+                        {field: 'fromuser.mobile', title: __('From_id')},
+                        {field: 'amount', title: __('Amount'), operate: false},
+                        {field: 'balance', title: __('Balance'), operate: false},
                         {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'action', title: __('Action')},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        //{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]
             });

+ 40 - 10
public/assets/js/backend/trade/mongyin.js

@@ -6,11 +6,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Table.api.init({
                 extend: {
                     index_url: 'trade/mongyin/index' + location.search,
-                    add_url: 'trade/mongyin/add',
-                    edit_url: 'trade/mongyin/edit',
-                    del_url: 'trade/mongyin/del',
-                    multi_url: 'trade/mongyin/multi',
-                    import_url: 'trade/mongyin/import',
                     table: 'mongy_in',
                 }
             });
@@ -28,24 +23,59 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
-                        {field: 'order_type', title: __('Order_type')},
-                        {field: 'user_id', title: __('User_id')},
+                        {field: 'order_type', title: __("Order_type"), 
+                            searchList: {1:__('Usdt'), 2:__('Bank')}, 
+                            formatter: Table.api.formatter.status
+                        },
+                        {field: 'users.mobile', title: __('User_id')},
                         {field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                         {field: 'bank_name', title: __('Bank_name'), operate: 'LIKE'},
                         {field: 'bank_card', title: __('Bank_card'), operate: 'LIKE'},
                         {field: 'account_name', title: __('Account_name'), operate: 'LIKE'},
                         {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
-                        {field: 'status', title: __('Status')},
-                        {field: 'admin_id', title: __('Admin_id')},
+                        {field: 'status', title: __("Status"), 
+                            searchList: {0:__('Pending'), 1:__('Success'), 2:__('Fail')}, 
+                            formatter: Table.api.formatter.status
+                        },
+                        {field: 'admins.nickname', title: __('Admin_id')},
                         {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        {field: 'operate', title: __('Operate'),
+                            table: table,
+                            buttons: [{
+                                name: "operate",
+                                text:  __('Review'),
+                                classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
+                                confirm: __('Confirm review'),
+                                url: 'trade/mongin/review',
+                                visible: function (row) {
+                                    //if(row.status == 0 && parseFloat(row.users.balance) >= parseFloat(row.amount)){
+                                        return true;
+                           
+                                },
+                                refresh: true
+                            }],
+                            events: Table.api.events.operate, formatter: Table.api.formatter.operate
+                        }
                     ]
                 ]
             });
 
             // 为表格绑定事件
             Table.api.bindevent(table);
+            //绑定TAB事件
+            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
+                var typeStr = $(this).attr("href").replace('#', '');
+                var options = table.bootstrapTable('getOptions');
+                options.pageNumber = 1;
+                options.queryParams = function (params) {
+                    params.order_type = typeStr;
+                    return params;
+                };
+                table.bootstrapTable('refresh', {});
+                return false;
+            });
+
         },
         add: function () {
             Controller.api.bindevent();

+ 53 - 9
public/assets/js/backend/trade/mongyout.js

@@ -6,11 +6,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Table.api.init({
                 extend: {
                     index_url: 'trade/mongyout/index' + location.search,
-                    add_url: 'trade/mongyout/add',
-                    edit_url: 'trade/mongyout/edit',
-                    del_url: 'trade/mongyout/del',
-                    multi_url: 'trade/mongyout/multi',
-                    import_url: 'trade/mongyout/import',
                     table: 'mongy_out',
                 }
             });
@@ -28,8 +23,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
-                        {field: 'order_type', title: __('Order_type')},
-                        {field: 'user_id', title: __('User_id')},
+                        {field: 'order_type', title: __("Order_type"), 
+                            searchList: {1:__('Usdt'), 2:__('Bank')}, 
+                            formatter: Table.api.formatter.status
+                        },
+                        {field: 'users.mobile', title: __('User_id')},
                         {field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                         {field: 'bank_name', title: __('Bank_name'), operate: 'LIKE'},
                         {field: 'bank_card', title: __('Bank_card'), operate: 'LIKE'},
@@ -38,16 +36,62 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'fee', title: __('Fee'), operate:'BETWEEN'},
                         {field: 'real_amount', title: __('Real_amount'), operate:'BETWEEN'},
                         {field: 'status', title: __('Status')},
-                        {field: 'admin_id', title: __('Admin_id')},
+                        {field: 'status', title: __("Status"), 
+                            searchList: {0:__('Pending'), 1:__('Success'), 2:__('Fail')}, 
+                            formatter: Table.api.formatter.status
+                        },
+                        {field: 'admins.nickname', title: __('Admin_id')},
                         {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        {field: 'operate', title: __('Operate'),
+                            table: table,
+                            buttons: [{
+                                name: "operate",
+                                text:  __('Success'),
+                                classname: 'btn btn-xs btn-success btn-magic btn-ajax',
+                                confirm: __('Confirm review'),
+                                url: 'trade/mongyout/review/status/1',
+                                visible: function (row) {
+                                    if(row.status == 0) return true;
+                                    return false;
+                                },
+                                refresh: true
+                            },
+                            {
+                                name: "operate",
+                                text:  __('Fail'),
+                                classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
+                                confirm: __('Confirm review'),
+                                url: 'trade/mongyout/review/status/2',
+                                visible: function (row) {
+                                    if(row.status == 0) return true;
+                                    return false;
+                                },
+                                refresh: true
+                            }],
+
+
+                            events: Table.api.events.operate, formatter: Table.api.formatter.operate
+                        }
                     ]
                 ]
             });
 
             // 为表格绑定事件
             Table.api.bindevent(table);
+            //绑定TAB事件
+            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
+                var typeStr = $(this).attr("href").replace('#', '');
+                var options = table.bootstrapTable('getOptions');
+                options.pageNumber = 1;
+                options.queryParams = function (params) {
+                    params.order_type = typeStr;
+                    return params;
+                };
+                table.bootstrapTable('refresh', {});
+                return false;
+            });
+
         },
         add: function () {
             Controller.api.bindevent();

+ 23 - 13
public/assets/js/backend/trade/order.js

@@ -6,11 +6,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Table.api.init({
                 extend: {
                     index_url: 'trade/order/index' + location.search,
-                    add_url: 'trade/order/add',
-                    edit_url: 'trade/order/edit',
-                    del_url: 'trade/order/del',
-                    multi_url: 'trade/order/multi',
-                    import_url: 'trade/order/import',
                     table: 'order',
                 }
             });
@@ -29,15 +24,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
                         {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
-                        {field: 'user_id', title: __('User_id')},
+                        {field: 'users.mobile', title: __('User_id')},
                         {field: 'title', title: __('Title'), operate: 'LIKE'},
                         {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
                         {field: 'bonus', title: __('Bonus'), operate:'BETWEEN'},
-                        {field: 'status', title: __('Status')},
+                        {field: 'status', title: __("Status"), 
+                            searchList: {0:__('Unpaid'), 1:__('Finish'), 2:__('Freeze'), 3:__('Cancel')}, 
+                            formatter: Table.api.formatter.status
+                        },
+                        {field: 'note', title: __('Note'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                         {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
-                        {field: 'note', title: __('Note'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        {field: 'operate', title: __('Operate'),
+                            table: table,
+                            buttons: [{
+                                name: "operate",
+                                text:  __('Operate'),
+                                classname: 'btn btn-xs btn-danger btn-magic btn-dialog',
+                                url: 'trade/order/operate',
+                                visible: function (row) {
+                                    if(row.status == 0 && parseFloat(row.users.balance) >= parseFloat(row.amount)){
+                                        return true;
+                                    }
+                                    return false;
+                                }
+                            }],
+                            events: Table.api.events.operate, formatter: Table.api.formatter.operate
+                        }
                     ]
                 ]
             });
@@ -45,10 +58,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             // 为表格绑定事件
             Table.api.bindevent(table);
         },
-        add: function () {
-            Controller.api.bindevent();
-        },
-        edit: function () {
+        operate: function () {
             Controller.api.bindevent();
         },
         api: {

+ 23 - 4
public/assets/js/backend/user/group.js

@@ -21,6 +21,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
             Table.api.init({
                 extend: {
                     index_url: 'user/group/index',
+                    edit_url: 'user/group/edit',
                     table: 'user_group',
                 }
             });
@@ -44,7 +45,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
                         {field: 'agent_out_bank', title: __('Agent_out_bank'), searchList: {0: __('Close'), 1: __('Open')}, formatter: Table.api.formatter.status},
                         {field: 'service_link', title: __('Service_link')},
                         {field: 'team_num', title: __('Team')},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        {field: 'operate', title: __('Operate'), table: table,
+                            buttons: [{
+                                name: "edit",
+                                text:  __('Edit'),
+                                classname: 'btn btn-xs btn-success btn-magic btn-dialog',
+                                url: 'user/group/edit',
+                                refresh: true
+                            },{
+                                name: "disable",
+                                text:  __('Disable'),
+                                classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
+                                confirm: __('Confirm review'),
+                                url: 'user/group/disable/is_lock/1',
+                                visible: function (row) {
+                                    if(row.is_lock == 0)  return true;
+                                    return false;
+                                },
+                                refresh: true
+                            }],
+                            events: Table.api.events.operate, formatter: Table.api.formatter.operate
+                        }
                     ]
                 ]
             });
@@ -52,9 +73,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
             // 为表格绑定事件
             Table.api.bindevent(table);
         },
-        add: function () {
-            Controller.api.bindevent();
-        },
+
         edit: function () {
             Controller.api.bindevent();
         },

+ 79 - 8
public/assets/js/backend/user/user.js

@@ -6,10 +6,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Table.api.init({
                 extend: {
                     index_url: 'user/user/index',
-                    add_url: 'user/user/add',
                     edit_url: 'user/user/edit',
                     del_url: 'user/user/del',
-                    multi_url: 'user/user/multi',
+                    balance_url: 'user/user/balance',
+                    cardslip_url: 'user/user/cardslip',
+                    collection_url: 'user/user/collection',
                     table: 'user',
                 }
             });
@@ -39,20 +40,90 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
                         {field: 'invitation_code', title: __('Invitation_code'), formatter: Table.api.formatter.search},
                         {field: 'is_agent', title: __('Is_agent'), searchList: {1: __('Yes'), 0: __('No')}, formatter: Table.api.formatter.status},
-                        {field: 'user_type', title: __('User_type'), formatter: Table.api.formatter.status, searchList: {0: __('Dummy'), 1: __('Real person')}},
-                        {field: 'is_lock', title: __('Status'), formatter: Table.api.formatter.status, searchList: {0: __('Normal'), 1: __('Locking')}},
                         
-                        
-                     
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        {field: 'user_type', title: __('User_type'), formatter: Table.api.formatter.toggle, 
+                            searchList: {0: __('Dummy'), 1: __('Real person')}
+                        },
+                        {field: 'is_lock', title: __('Status'), formatter: Table.api.formatter.toggle, 
+                            searchList: {0: __('Normal'), 1: __('Locking')}
+                        },
+                        {field: 'operate', title: __('Operate'), table: table,
+                            buttons: [
+                                {
+                                    name: "account",
+                                    text:  __('Account change'),
+                                    classname: 'btn btn-xs btn-info btn-magic btn-dialog',
+                                    url: 'trade/moneylog/index',
+                                    refresh: true
+                                },
+                                {
+                                name: "clear",
+                                text:  __('Clear'),
+                                classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
+                                url: 'user/user/clear',
+                                visible: function (row) {
+                                    if(row.task_num > 0)  return true;
+                                    return false;
+                                },
+                                refresh: true
+                            },{
+                                name: "team",
+                                text:  __('Team'),
+                                classname: 'btn btn-xs btn-success btn-magic btn-dialog',
+                                confirm: __('Confirm review'),
+                                url: 'user/group/Team',
+                
+                                refresh: true
+                            },{
+                                name: "edit",
+                                text:  __('Edit'),
+                                classname: 'btn btn-xs btn-warning btn-magic btn-dialog',
+                                url: 'user/user/edit',
+                                refresh: true
+                            },{
+                                name: "del",
+                                text:  __('Del'),
+                                classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
+                                confirm: __('Confirm review'),
+                                url: 'user/user/del',
+                                refresh: true
+                            }],
+                            events: Table.api.events.operate, formatter: Table.api.formatter.operate
+                        }
                     ]
                 ]
             });
 
             // 为表格绑定事件
             Table.api.bindevent(table);
+
+            //余额           
+            $(document).on('click','.btn-balance',function () {
+                var ids = Table.api.selectedids(table);
+                Fast.api.open($.fn.bootstrapTable.defaults.extend.balance_url + "?ids=" + ids, __('Balance'))
+            });
+            //卡单  
+            $(document).on('click','.btn-cardslip',function () {
+                var ids = Table.api.selectedids(table);
+                Fast.api.open($.fn.bootstrapTable.defaults.extend.cardslip_url + "?ids=" + ids, __('Card slip'))
+            });
+            //收款  
+            $(document).on('click','.btn-collection',function () {
+                var ids = Table.api.selectedids(table);
+                Fast.api.open($.fn.bootstrapTable.defaults.extend.collection_url + "?ids=" + ids, __('Collection'))
+            });
+
+        },
+        balance: function () {
+            //余额
+            Controller.api.bindevent();
+        },
+        cardslip: function () {
+            //卡单
+            Controller.api.bindevent();
         },
-        add: function () {
+        collection: function () {
+            //收款
             Controller.api.bindevent();
         },
         edit: function () {