diff --git a/admin/application/admin/controller/Firmcustomerfeedback.php b/admin/application/admin/controller/Firmcustomerfeedback.php new file mode 100644 index 0000000..e8aa6ec --- /dev/null +++ b/admin/application/admin/controller/Firmcustomerfeedback.php @@ -0,0 +1,77 @@ +model = new \app\admin\model\Firmcustomerfeedback; + + } + + + + /** + * 默认生成的控制器所继承的父类中有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(); + + $record_id = input('record_id'); + if($record_id){ + $this->model->where('firmcustomerfollowuprecord_id',$record_id); + } + $list = $this->model + ->with(['firmcustomer']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + $row->visible(['id','rel_wx','rel_group','msg','create_time']); + $row->visible(['firmcustomer']); + $row->getRelation('firmcustomer')->visible(['name']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + $this->assignconfig("record_id", input('record_id')); + return $this->view->fetch(); + } + +} diff --git a/admin/application/admin/lang/zh-cn/firmcustomerfeedback.php b/admin/application/admin/lang/zh-cn/firmcustomerfeedback.php new file mode 100644 index 0000000..f0dfd1d --- /dev/null +++ b/admin/application/admin/lang/zh-cn/firmcustomerfeedback.php @@ -0,0 +1,12 @@ + 'ID', + 'Firmcustomer_id' => '客户', + 'Firmcustomerfollowuprecord_id' => '回访记录ID', + 'Rel_wx' => '关联微信', + 'Rel_group' => '关联微信群', + 'Msg' => '反馈内容', + 'Create_time' => '反馈时间', + 'Firmcustomer.name' => '客户' +]; diff --git a/admin/application/admin/model/Firmcustomerfeedback.php b/admin/application/admin/model/Firmcustomerfeedback.php new file mode 100644 index 0000000..99def4e --- /dev/null +++ b/admin/application/admin/model/Firmcustomerfeedback.php @@ -0,0 +1,44 @@ +belongsTo('Firmcustomer', 'firmcustomer_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/admin/application/admin/validate/Firmcustomerfeedback.php b/admin/application/admin/validate/Firmcustomerfeedback.php new file mode 100644 index 0000000..9b43d5d --- /dev/null +++ b/admin/application/admin/validate/Firmcustomerfeedback.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/admin/application/admin/view/firmcustomerfeedback/add.html b/admin/application/admin/view/firmcustomerfeedback/add.html new file mode 100644 index 0000000..1fa3cbb --- /dev/null +++ b/admin/application/admin/view/firmcustomerfeedback/add.html @@ -0,0 +1,45 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/admin/application/admin/view/firmcustomerfeedback/edit.html b/admin/application/admin/view/firmcustomerfeedback/edit.html new file mode 100644 index 0000000..58cf8cc --- /dev/null +++ b/admin/application/admin/view/firmcustomerfeedback/edit.html @@ -0,0 +1,45 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/admin/application/admin/view/firmcustomerfeedback/index.html b/admin/application/admin/view/firmcustomerfeedback/index.html new file mode 100644 index 0000000..6394d55 --- /dev/null +++ b/admin/application/admin/view/firmcustomerfeedback/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+
+
+ + + + + + + + + +
+ +
+
+
+ +
+
+
diff --git a/admin/public/assets/js/backend/firmcustomerfeedback.js b/admin/public/assets/js/backend/firmcustomerfeedback.js new file mode 100644 index 0000000..c22f9eb --- /dev/null +++ b/admin/public/assets/js/backend/firmcustomerfeedback.js @@ -0,0 +1,56 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + let record_id = Config.record_id; + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'firmcustomerfeedback/index?record_id='+record_id + location.search, + add_url: 'firmcustomerfeedback/add', + edit_url: 'firmcustomerfeedback/edit', + del_url: 'firmcustomerfeedback/del', + multi_url: 'firmcustomerfeedback/multi', + import_url: 'firmcustomerfeedback/import', + table: 'firmcustomerfeedback', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'rel_wx', title: __('Rel_wx'), operate: 'LIKE'}, + {field: 'rel_group', title: __('Rel_group'), operate: 'LIKE'}, + {field: 'msg', title: __('Msg'), 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: 'firmcustomer.name', title: __('Firmcustomer.name'), 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; +}); diff --git a/admin/public/assets/js/backend/firmcustomerfollowuprecord.js b/admin/public/assets/js/backend/firmcustomerfollowuprecord.js index 54846c3..e67b42a 100755 --- a/admin/public/assets/js/backend/firmcustomerfollowuprecord.js +++ b/admin/public/assets/js/backend/firmcustomerfollowuprecord.js @@ -34,7 +34,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'notes', title: __('Notes'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'visit_msg', title: __('Visit_msg'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'feedback', title: __('Feedback'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'feedback', title: __('Feedback'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'send_time', title: __('Send_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'status', title: __('Status'), searchList: {"no":__('Status no'),"yes":__('Status yes')}, formatter: Table.api.formatter.status}, {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, @@ -87,6 +87,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return true; } }, + { + name: 'feedbackRecord', + text: __('反馈记录'), + title: __('反馈记录'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: 'firmcustomerfeedback/index', + callback: function (data) { + Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"}); + }, + visible: function (row) { + //返回true时按钮显示,返回false隐藏 + return true; + } + }, // { // name: 'setFollwupPlan', // text: __('设置回访计划'), diff --git a/superadmin/application/admin/controller/Firmcustomerfeedback.php b/superadmin/application/admin/controller/Firmcustomerfeedback.php new file mode 100644 index 0000000..22bacbd --- /dev/null +++ b/superadmin/application/admin/controller/Firmcustomerfeedback.php @@ -0,0 +1,72 @@ +model = new \app\admin\model\Firmcustomerfeedback; + + } + + + + /** + * 默认生成的控制器所继承的父类中有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(['firmcustomer']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + $row->visible(['id','rel_wx','rel_group','msg','create_time']); + $row->visible(['firmcustomer']); + $row->getRelation('firmcustomer')->visible(['name']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/superadmin/application/admin/lang/zh-cn/firmcustomerfeedback.php b/superadmin/application/admin/lang/zh-cn/firmcustomerfeedback.php new file mode 100644 index 0000000..f0dfd1d --- /dev/null +++ b/superadmin/application/admin/lang/zh-cn/firmcustomerfeedback.php @@ -0,0 +1,12 @@ + 'ID', + 'Firmcustomer_id' => '客户', + 'Firmcustomerfollowuprecord_id' => '回访记录ID', + 'Rel_wx' => '关联微信', + 'Rel_group' => '关联微信群', + 'Msg' => '反馈内容', + 'Create_time' => '反馈时间', + 'Firmcustomer.name' => '客户' +]; diff --git a/superadmin/application/admin/model/Firmcustomerfeedback.php b/superadmin/application/admin/model/Firmcustomerfeedback.php new file mode 100644 index 0000000..99def4e --- /dev/null +++ b/superadmin/application/admin/model/Firmcustomerfeedback.php @@ -0,0 +1,44 @@ +belongsTo('Firmcustomer', 'firmcustomer_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/superadmin/application/admin/validate/Firmcustomerfeedback.php b/superadmin/application/admin/validate/Firmcustomerfeedback.php new file mode 100644 index 0000000..9b43d5d --- /dev/null +++ b/superadmin/application/admin/validate/Firmcustomerfeedback.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/superadmin/application/admin/view/firmcustomerfeedback/add.html b/superadmin/application/admin/view/firmcustomerfeedback/add.html new file mode 100644 index 0000000..1fa3cbb --- /dev/null +++ b/superadmin/application/admin/view/firmcustomerfeedback/add.html @@ -0,0 +1,45 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/superadmin/application/admin/view/firmcustomerfeedback/edit.html b/superadmin/application/admin/view/firmcustomerfeedback/edit.html new file mode 100644 index 0000000..58cf8cc --- /dev/null +++ b/superadmin/application/admin/view/firmcustomerfeedback/edit.html @@ -0,0 +1,45 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/superadmin/application/admin/view/firmcustomerfeedback/index.html b/superadmin/application/admin/view/firmcustomerfeedback/index.html new file mode 100644 index 0000000..27e4693 --- /dev/null +++ b/superadmin/application/admin/view/firmcustomerfeedback/index.html @@ -0,0 +1,29 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/superadmin/public/assets/js/backend/firmcustomerfeedback.js b/superadmin/public/assets/js/backend/firmcustomerfeedback.js new file mode 100644 index 0000000..38bea1d --- /dev/null +++ b/superadmin/public/assets/js/backend/firmcustomerfeedback.js @@ -0,0 +1,55 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'firmcustomerfeedback/index' + location.search, + add_url: 'firmcustomerfeedback/add', + edit_url: 'firmcustomerfeedback/edit', + del_url: 'firmcustomerfeedback/del', + multi_url: 'firmcustomerfeedback/multi', + import_url: 'firmcustomerfeedback/import', + table: 'firmcustomerfeedback', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'rel_wx', title: __('Rel_wx'), operate: 'LIKE'}, + {field: 'rel_group', title: __('Rel_group'), operate: 'LIKE'}, + {field: 'msg', title: __('Msg'), 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: 'firmcustomer.name', title: __('Firmcustomer.name'), 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; +});