diff --git a/application/admin/controller/zy/link/Apply.php b/application/admin/controller/zy/link/Apply.php new file mode 100644 index 0000000..bbe4423 --- /dev/null +++ b/application/admin/controller/zy/link/Apply.php @@ -0,0 +1,72 @@ +model = new \app\admin\model\zy\link\Apply; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + */ + public function index() + { + //当前是否为关联查询 + $this->relationSearch = true; + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if ($this->request->isAjax()) { + //如果发送的来源是Selectpage,则转发到Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + + $list = $this->model + ->with(['user','club']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('user')->visible(['nickname']); + $row->getRelation('club')->visible(['name']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/controller/zy/link/Complaint.php b/application/admin/controller/zy/link/Complaint.php new file mode 100644 index 0000000..251b1dd --- /dev/null +++ b/application/admin/controller/zy/link/Complaint.php @@ -0,0 +1,72 @@ +model = new \app\admin\model\zy\link\Complaint; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + */ + public function index() + { + //当前是否为关联查询 + $this->relationSearch = true; + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if ($this->request->isAjax()) { + //如果发送的来源是Selectpage,则转发到Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + + $list = $this->model + ->with(['user','circle']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('user')->visible(['nickname']); + $row->getRelation('circle')->visible(['id']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/controller/zy/link/Relation.php b/application/admin/controller/zy/link/Relation.php new file mode 100644 index 0000000..02e5d68 --- /dev/null +++ b/application/admin/controller/zy/link/Relation.php @@ -0,0 +1,71 @@ +model = new \app\admin\model\zy\link\Relation; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + */ + public function index() + { + //当前是否为关联查询 + $this->relationSearch = true; + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if ($this->request->isAjax()) { + //如果发送的来源是Selectpage,则转发到Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + + $list = $this->model + ->with(['user']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('user')->visible(['nickname']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/lang/zh-cn/zy/link/apply.php b/application/admin/lang/zh-cn/zy/link/apply.php new file mode 100644 index 0000000..b55f862 --- /dev/null +++ b/application/admin/lang/zh-cn/zy/link/apply.php @@ -0,0 +1,23 @@ + '申请类型', + 'User_id' => '用户id', + 'Target_id' => '目标id', + 'Content' => '内容', + 'Status' => '状态', + 'Reason' => '申请理由', + 'Reply' => '审核理由', + 'Create_time' => '创建时间', + 'Update_time' => '修改时间', + 'User.nickname' => '昵称', + 'Club.name' => '俱乐部名称', + + 'Type1' => '入会申请', + 'Type2' => '好友申请', + 'Type3' => '报名邀请', + + 'Status-1' => '拒绝', + 'Status1' => '发起', + 'Status2' => '通过' +]; diff --git a/application/admin/lang/zh-cn/zy/link/complaint.php b/application/admin/lang/zh-cn/zy/link/complaint.php new file mode 100644 index 0000000..264f728 --- /dev/null +++ b/application/admin/lang/zh-cn/zy/link/complaint.php @@ -0,0 +1,23 @@ + '投诉类型', + 'Target_id' => '投诉对象', + 'Name' => '投诉名称', + 'User_id' => '用户', + 'Username' => '称呼', + 'Phone' => '手机号', + 'Imgs' => '图片', + 'Content' => '投诉内容', + 'Status' => '状态', + 'Create_time' => '创建时间', + 'Update_time' => '修改时间', + 'User.nickname' => '昵称', + + 'Type1' => '系统投诉', + 'Type2' => '影圈举报', + 'Type3' => '用户举报', + + 'Status0' => '待处理', + 'Status1' => '已处理' +]; diff --git a/application/admin/lang/zh-cn/zy/link/relation.php b/application/admin/lang/zh-cn/zy/link/relation.php new file mode 100644 index 0000000..44c5ed3 --- /dev/null +++ b/application/admin/lang/zh-cn/zy/link/relation.php @@ -0,0 +1,21 @@ + '用户id', + 'Target_id' => '目标id', + 'Status' => '关系', + 'Content' => '开放权限', + 'Remark' => '备注名称', + 'Look' => '让看', + 'Create_time' => '创建时间', + 'Update_time' => '修改时间', + 'User.nickname' => '昵称', + + 'Status-1' => '拉黑', + 'Status0' => '取关', + 'Status1' => '关注', + 'Status2' => '特别关注', + + 'Look0' => '不让看', + 'Look1' => '让看' +]; diff --git a/application/admin/model/zy/link/Apply.php b/application/admin/model/zy/link/Apply.php new file mode 100644 index 0000000..9816681 --- /dev/null +++ b/application/admin/model/zy/link/Apply.php @@ -0,0 +1,50 @@ +belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function club() + { + return $this->belongsTo('app\admin\model\zy\Club', 'target_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/zy/link/Complaint.php b/application/admin/model/zy/link/Complaint.php new file mode 100644 index 0000000..4413170 --- /dev/null +++ b/application/admin/model/zy/link/Complaint.php @@ -0,0 +1,50 @@ +belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function circle() + { + return $this->belongsTo('app\admin\model\zy\circle\Circle', 'target_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/zy/link/Relation.php b/application/admin/model/zy/link/Relation.php new file mode 100644 index 0000000..d1a4928 --- /dev/null +++ b/application/admin/model/zy/link/Relation.php @@ -0,0 +1,44 @@ +belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/validate/zy/link/Apply.php b/application/admin/validate/zy/link/Apply.php new file mode 100644 index 0000000..0d1bdea --- /dev/null +++ b/application/admin/validate/zy/link/Apply.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/validate/zy/link/Complaint.php b/application/admin/validate/zy/link/Complaint.php new file mode 100644 index 0000000..71a7882 --- /dev/null +++ b/application/admin/validate/zy/link/Complaint.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/validate/zy/link/Relation.php b/application/admin/validate/zy/link/Relation.php new file mode 100644 index 0000000..d45d27f --- /dev/null +++ b/application/admin/validate/zy/link/Relation.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/zy/link/apply/add.html b/application/admin/view/zy/link/apply/add.html new file mode 100644 index 0000000..8ab85cc --- /dev/null +++ b/application/admin/view/zy/link/apply/add.html @@ -0,0 +1,53 @@ +
+ +
+ +
+ {:build_radios('row[type]', ['1'=>__('Type1'),'2'=>__('Type2'),'3'=>__('Type3')], 1)} +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ {:build_radios('row[status]', ['-1'=>__('Status-1'),'1'=>__('Status1'),'2'=>__('Status2')], 0)} +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + +
diff --git a/application/admin/view/zy/link/apply/edit.html b/application/admin/view/zy/link/apply/edit.html new file mode 100644 index 0000000..9cb57c6 --- /dev/null +++ b/application/admin/view/zy/link/apply/edit.html @@ -0,0 +1,53 @@ +
+ +
+ +
+ {:build_radios('row[type]', ['1'=>__('Type1'),'2'=>__('Type2'),'3'=>__('Type3')], $row['type'])} + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ {:build_radios('row[status]', ['0'=>__('Status0'),'1'=>__('Status1')], $row['status'])} +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
diff --git a/application/admin/view/zy/link/apply/index.html b/application/admin/view/zy/link/apply/index.html new file mode 100644 index 0000000..e77dbb3 --- /dev/null +++ b/application/admin/view/zy/link/apply/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+
+
+ + + + + + + + + +
+ +
+
+
+ +
+
+
diff --git a/application/admin/view/zy/link/complaint/add.html b/application/admin/view/zy/link/complaint/add.html new file mode 100644 index 0000000..9cfc9a1 --- /dev/null +++ b/application/admin/view/zy/link/complaint/add.html @@ -0,0 +1,64 @@ +
+ +
+ +
+ {:build_radios('row[type]', ['1'=>__('Type1'), '2'=>__('Type2'), '3'=>__('Type3')],1)} +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ {:build_radios('row[status]', ['0'=>__('Status0'),'1'=>__('Status1')], 0)} +
+
+ + +
diff --git a/application/admin/view/zy/link/complaint/edit.html b/application/admin/view/zy/link/complaint/edit.html new file mode 100644 index 0000000..690d6da --- /dev/null +++ b/application/admin/view/zy/link/complaint/edit.html @@ -0,0 +1,64 @@ +
+ +
+ +
+ {:build_radios('row[type]', ['1'=>__('Type1'), '2'=>__('Type2'), '3'=>__('Type3')], $row['type'])} +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ {:build_radios('row[status]', ['1'=>__('Status1'), '0'=>__('Status0')], $row['status'])} +
+
+ + +
diff --git a/application/admin/view/zy/link/complaint/index.html b/application/admin/view/zy/link/complaint/index.html new file mode 100644 index 0000000..2f4ca0e --- /dev/null +++ b/application/admin/view/zy/link/complaint/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+
+
+ + {:__('Add')} + + {:__('Delete')} + + + + + +
+ +
+
+
+ +
+
+
diff --git a/application/admin/view/zy/link/relation/add.html b/application/admin/view/zy/link/relation/add.html new file mode 100644 index 0000000..6a41426 --- /dev/null +++ b/application/admin/view/zy/link/relation/add.html @@ -0,0 +1,57 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/zy/link/relation/edit.html b/application/admin/view/zy/link/relation/edit.html new file mode 100644 index 0000000..424fdf9 --- /dev/null +++ b/application/admin/view/zy/link/relation/edit.html @@ -0,0 +1,57 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/zy/link/relation/index.html b/application/admin/view/zy/link/relation/index.html new file mode 100644 index 0000000..0167786 --- /dev/null +++ b/application/admin/view/zy/link/relation/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/public/assets/js/backend/zy/link/apply.js b/public/assets/js/backend/zy/link/apply.js new file mode 100644 index 0000000..3f79278 --- /dev/null +++ b/public/assets/js/backend/zy/link/apply.js @@ -0,0 +1,62 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'zy/link/apply/index' + location.search, + add_url: 'zy/link/apply/add', + edit_url: 'zy/link/apply/edit', + del_url: 'zy/link/apply/del', + multi_url: 'zy/link/apply/multi', + import_url: 'zy/link/apply/import', + table: 'zy_apply', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'type', title: __('Type')}, + {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + {field: 'club.name', title: __('Club.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'user_id', title: __('User_id')}, + // {field: 'target_id', title: __('Target_id')}, + {field: 'status', title: __('Status')}, + {field: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'reply', title: __('Reply'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {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; +}); diff --git a/public/assets/js/backend/zy/link/complaint.js b/public/assets/js/backend/zy/link/complaint.js new file mode 100644 index 0000000..ede94ed --- /dev/null +++ b/public/assets/js/backend/zy/link/complaint.js @@ -0,0 +1,62 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'zy/link/complaint/index' + location.search, + add_url: 'zy/link/complaint/add', + edit_url: 'zy/link/complaint/edit', + del_url: 'zy/link/complaint/del', + multi_url: 'zy/link/complaint/multi', + import_url: 'zy/link/complaint/import', + table: 'zy_complaint', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'type', title: __('Type')}, + {field: 'target_id', title: __('Target_id')}, + {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user_id', title: __('User_id')}, + {field: 'username', title: __('Username'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'phone', title: __('Phone')}, + {field: 'status', title: __('Status')}, + {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {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; +}); diff --git a/public/assets/js/backend/zy/link/relation.js b/public/assets/js/backend/zy/link/relation.js new file mode 100644 index 0000000..f60b327 --- /dev/null +++ b/public/assets/js/backend/zy/link/relation.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: 'zy/link/relation/index' + location.search, + add_url: 'zy/link/relation/add', + edit_url: 'zy/link/relation/edit', + del_url: 'zy/link/relation/del', + multi_url: 'zy/link/relation/multi', + import_url: 'zy/link/relation/import', + table: 'zy_relation', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + // {field: 'user_id', title: __('User_id')}, + {field: 'target_id', title: __('Target_id')}, + {field: 'status', title: __('Status'),formatter: Table.api.formatter.label, searchList: {'-1': __('Status-1'),0: __('Status0'), 1: __('Status1'), 2: __('Status2')}}, + {field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'look', title: __('Look')}, + {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {field: 'user.nickname', title: __('User.nickname'), 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; +});