From 7bc8a15f70e8099957edb86dbe3bc161c16952a2 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 7 Sep 2023 11:14:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B7=BB=E5=8A=A0=E5=A7=94?= =?UTF-8?q?=E6=89=98=E8=B4=AD=E7=89=A9=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/community/Community.php | 15 ++++++++++++++- route/api.php | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/controller/api/community/Community.php b/app/controller/api/community/Community.php index 9c339f94..64f9ddcf 100644 --- a/app/controller/api/community/Community.php +++ b/app/controller/api/community/Community.php @@ -461,6 +461,20 @@ class Community extends BaseController return app('json')->success(['cart_id' => $cartIds]); } + /** + * 委托商品加购 + * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function addEntrustCart() + { + $communityId = $this->request->param('community_id'); + $cartIds = $this->repository->addEntrustCart($this->request->uid(), $communityId); + return app('json')->success(['cart_id' => $cartIds]); + } + /** * 转售商品列表 * @return mixed @@ -716,7 +730,6 @@ class Community extends BaseController $list = $queryBuilder->setOption('field', [])->field(['c.community_id', 'c.uid', 'c.title', 'c.image', 'c.entrust_mer_id', 'm.credit_buy', 'm.settle_cycle', 'm.interest_rate', 'm.mer_name', 'm.mer_avatar', 'c.mer_status'])->order('c.community_id', 'desc')->page($page, $limit)->fetchSql(false)->select(); if ($list) $list = $list->toArray(); foreach($list as $k => $v) { - $list[$k]['mer_name'] = 0; // type:1发起的委托 2收到的委托 if ($type == 2) { $merchantInfo = Db::name('merchant')->where('uid', $v['uid'])->find(); diff --git a/route/api.php b/route/api.php index 67af7fcb..a0121ade 100644 --- a/route/api.php +++ b/route/api.php @@ -381,6 +381,7 @@ Route::group('api/', function () { Route::post('/entrust', 'Community/entrust'); Route::get('/entrust/list', 'Community/entrustList'); Route::post('/entrust/check/:id', 'Community/checkEntrust'); + Route::post('/entrust/addEntrustCart', 'Community/addEntrustCart'); })->prefix('api.community.');