From e03dca634f9387439d55ceff0d20a4e39b0de3b6 Mon Sep 17 00:00:00 2001 From: wangxinglong <2371974647@qq.com> Date: Wed, 22 Dec 2021 09:32:41 +0800 Subject: [PATCH] settter --- app/controller/api/Comment.php | 5 ++++- app/controller/manager/Comment.php | 20 +++++++++++++++++++ public/static/manager/js/business/business.js | 2 +- .../js/business/business_coupon_list.js | 2 +- .../manager/js/business/business_wait_list.js | 2 +- public/static/manager/js/business/comment.js | 2 +- public/static/manager/js/comment_rule.js | 2 +- .../static/manager/js/consumer/blank_list.js | 2 +- public/static/manager/js/consumer/index.js | 2 +- public/static/manager/js/coupon/index.js | 2 +- view/manager/coupon/add.html | 12 ++++++++--- view/manager/coupon/edit.html | 12 +++++++++-- 12 files changed, 51 insertions(+), 14 deletions(-) diff --git a/app/controller/api/Comment.php b/app/controller/api/Comment.php index a0a5178..6ad09c9 100644 --- a/app/controller/api/Comment.php +++ b/app/controller/api/Comment.php @@ -53,7 +53,10 @@ class Comment extends Base if (empty($account)) { throw new RepositoryException('用户无效!'); } - + + if(strtotime($account->blank_time) >time()){ + throw new RepositoryException('用户被加入黑名单,暂时不能评论,请在' .$account->blank_time . "后评论"); + } $param = [ "comment" => input("comment/s", ""),//评论内容 图片类型放入地址 语音类型放置语音文件地址 diff --git a/app/controller/manager/Comment.php b/app/controller/manager/Comment.php index 0e74bf1..84d6c0f 100644 --- a/app/controller/manager/Comment.php +++ b/app/controller/manager/Comment.php @@ -241,6 +241,26 @@ class Comment extends Base $list = CommentModel::findList($whereMap, [], $page, $size, function ($q) { return $q->withJoin("account"); }, $orders); + + $list["list"]->each(function ($item){ + if($item->type == CommentModel::type_text){ + $data = json_decode($item->comment,true); + if(!empty($data)){ + $dataStr = ''; + foreach ($data as $ditem){ + + if($ditem["msgType"] == CommentModel::msg_type_emoji){ + $dataStr .= ""; + }else{ + $dataStr.=$ditem['msgCont']; + } + + } + $item->comment = $dataStr; + } + + } + }); return $this->json(0, 'success', $list); } return $this->view(); diff --git a/public/static/manager/js/business/business.js b/public/static/manager/js/business/business.js index 749f016..dbaca6f 100644 --- a/public/static/manager/js/business/business.js +++ b/public/static/manager/js/business/business.js @@ -53,7 +53,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function {field: 'balance',title: '商家余额'}, {field: 'recharge_total_money', title: '充值总额'}, - {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', fixed: 'right'} + {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', } ]], done: function () { Tools.setInsTb(insTb); diff --git a/public/static/manager/js/business/business_coupon_list.js b/public/static/manager/js/business/business_coupon_list.js index 5e1892c..4d53781 100644 --- a/public/static/manager/js/business/business_coupon_list.js +++ b/public/static/manager/js/business/business_coupon_list.js @@ -44,7 +44,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function {field: 'start_time', title: '开始时间'}, {field: 'end_time', title: '结束时间'}, {templet: '#row-status' , title: '状态'}, - {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', fixed: 'right'} + {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', } ]], done: function () { Tools.setInsTb(insTb); diff --git a/public/static/manager/js/business/business_wait_list.js b/public/static/manager/js/business/business_wait_list.js index 22c3bbd..80c00f3 100644 --- a/public/static/manager/js/business/business_wait_list.js +++ b/public/static/manager/js/business/business_wait_list.js @@ -47,7 +47,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function {field : "business_address" , title: '地址'}, {templet: '#row-business-license', title: '执照', style: 'height: 90px;'}, {templet: '#row-status', title: '状态', style: 'height: 90px;'}, - {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', fixed: 'right'} + {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', } ]], done: function () { Tools.setInsTb(insTb); diff --git a/public/static/manager/js/business/comment.js b/public/static/manager/js/business/comment.js index 6198180..3610edf 100644 --- a/public/static/manager/js/business/comment.js +++ b/public/static/manager/js/business/comment.js @@ -54,7 +54,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function {templet: '#row-comment', minWidth: 350, title: '评论内容'}, {templet: '#row-state', title: '状态'}, - {templet: '#row-operate', field: 'right', align: 'center', title: '操作', fixed: 'right'} + {templet: '#row-operate', field: 'right', align: 'center', title: '操作',} ]], done: function () { Tools.setInsTb(insTb); diff --git a/public/static/manager/js/comment_rule.js b/public/static/manager/js/comment_rule.js index f34f1bf..d4c9d2a 100644 --- a/public/static/manager/js/comment_rule.js +++ b/public/static/manager/js/comment_rule.js @@ -39,7 +39,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate' cols: [[ {field: 'rule', minWidth: 150, title: '规则',edit: 'text'}, {templet: '#row-status', minWidth: 120, align: 'center', title: '状态'}, - {templet: '#row-operate', fixed: "right", minWidth: 250, title: '操作'}, + {templet: '#row-operate', minWidth: 250, title: '操作'}, ]], done: function () { Tools.setInsTb(insTb); diff --git a/public/static/manager/js/consumer/blank_list.js b/public/static/manager/js/consumer/blank_list.js index 70996d1..374385f 100644 --- a/public/static/manager/js/consumer/blank_list.js +++ b/public/static/manager/js/consumer/blank_list.js @@ -48,7 +48,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function {field: 'blank_total_format', title: '禁言总时长'}, {field: 'surplus_blank_total_format', title: '剩余禁言时长'}, - {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', fixed: 'right'} + {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', } ]], done: function () { Tools.setInsTb(insTb); diff --git a/public/static/manager/js/consumer/index.js b/public/static/manager/js/consumer/index.js index 84937f9..74dbf34 100644 --- a/public/static/manager/js/consumer/index.js +++ b/public/static/manager/js/consumer/index.js @@ -57,7 +57,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function } return ''; },title: '用户标签'}, - {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', fixed: 'right'} + {templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', } ]], done: function () { Tools.setInsTb(insTb); diff --git a/public/static/manager/js/coupon/index.js b/public/static/manager/js/coupon/index.js index fe8537e..200405d 100644 --- a/public/static/manager/js/coupon/index.js +++ b/public/static/manager/js/coupon/index.js @@ -66,7 +66,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect','laydate'] {templet: '#row-on_shelf', title: '上架状态'}, {field: 'state_text', title: '状态'}, {field: 'create_time', title: '创建时间'}, - {templet: '#row-operate', field: 'right', align: 'center', title: '操作', fixed: 'right'} + {templet: '#row-operate', field: 'right', align: 'center', title: '操作'} ]], done: function () { Tools.setInsTb(insTb); diff --git a/view/manager/coupon/add.html b/view/manager/coupon/add.html index 9434d9c..39d59fa 100644 --- a/view/manager/coupon/add.html +++ b/view/manager/coupon/add.html @@ -184,13 +184,19 @@
- +
- + +
+
+
+ +
+ +
- diff --git a/view/manager/coupon/edit.html b/view/manager/coupon/edit.html index 36096ad..0060daf 100644 --- a/view/manager/coupon/edit.html +++ b/view/manager/coupon/edit.html @@ -184,10 +184,18 @@
- +
- + +
+
+ +
+ +
+ +