From f9709a7edcc97d1633458841d76e196773544a6b Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 31 Aug 2023 17:05:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=A7=94=E6=89=98=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/community/Community.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controller/api/community/Community.php b/app/controller/api/community/Community.php index fa2e2d27..6641383e 100644 --- a/app/controller/api/community/Community.php +++ b/app/controller/api/community/Community.php @@ -275,7 +275,7 @@ class Community extends BaseController public function checkParams() { - $data = $this->request->params(['image','topic_id','content','spu_id','order_id',['is_type',1],'video_link', 'resale_type', 'product_info']); + $data = $this->request->params(['image','topic_id','content','spu_id','order_id',['is_type',1],'video_link', 'resale_type', 'product_info', 'entrust_mer_id', 'entrust_day']); $config = systemConfig(["community_app_switch",'community_audit','community_video_audit']); $data['status'] = 0; $data['is_show'] = 0; @@ -624,6 +624,10 @@ class Community extends BaseController public function entrust() { $data = $this->checkParams(); + $merchantInfo = Db::name('merchant')->where('mer_id', $data['entrust_mer_id'] ?? 0)->where('type_id', Merchant::TypeSupplyChain)->fetchSql(false)->find(); + if (!$merchantInfo) { + return app('json')->fail('此商户不支持委托'); + } $this->checkUserAuth(); $data['uid'] = $this->request->uid(); $res = $this->repository->create($data); @@ -640,6 +644,10 @@ class Community extends BaseController if (!$communityInfo) { return app('json')->fail('委托商品不存在'); } + $entrustInfo = Db::name('entrust')->where('community_id', $id)->where('entrust_mer_id', $this->request->uid())->where('is_del', 0)->where('status', 0)->fetchSql(false)->find(); + if (!$entrustInfo) { + return app('json')->fail('用户无审核此委托商品权限'); + } $status = $this->request->param('status'); if (!$status) { return app('json')->fail('请设置审核状态');