From 8bbf70a96cfa6e56f25363a3e75c823672df1404 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 24 Jan 2024 10:46:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Demo.php | 4 ---- app/controller/api/store/order/StoreCart.php | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/controller/api/Demo.php b/app/controller/api/Demo.php index f3517fe8..68b95bae 100644 --- a/app/controller/api/Demo.php +++ b/app/controller/api/Demo.php @@ -32,10 +32,6 @@ class Demo extends BaseController { public function index() { - $merchant = Db::name('merchant')->where('mer_id','>=',39)->where('long','<>','')->where('status',1)->select(); - foreach($merchant as $k=>$v){ - Db::name('store_spu')->where('mer_id',$v['mer_id'])->update(['long'=>$v['long'],'lat'=>$v['lat']]); - } return app('json')->success('修改成功'); //[31,32,118,39,167,236,237,238,239] // return app('json')->success('修改成功');>whereIn('mer_id',[110,116,149,227,226,35,117,148,156,104,137,151,136,183,140,229,79,133,235])-> diff --git a/app/controller/api/store/order/StoreCart.php b/app/controller/api/store/order/StoreCart.php index f1122228..ad9775d9 100644 --- a/app/controller/api/store/order/StoreCart.php +++ b/app/controller/api/store/order/StoreCart.php @@ -123,11 +123,13 @@ class StoreCart extends BaseController //更新购物车 $cart_id = $cart['cart_id']; $cart_num = ['cart_num' => ($cart['cart_num'] + $data['cart_num'])]; - if ($entryMerId && $entryMerId != $result['product']['mer_id']) { - $cart_num['source_id'] = $entryMerId; - $cart_num['source'] = StoreCartDao::SOURCE_STORE_CLOUD; + if( $cart_num['source'] !=105){ + if ($entryMerId && $entryMerId != $result['product']['mer_id']) { + $cart_num['source_id'] = $entryMerId; + $cart_num['source'] = StoreCartDao::SOURCE_STORE_CLOUD; + } + $storeCart = $this->repository->update($cart_id,$cart_num); } - $storeCart = $this->repository->update($cart_id,$cart_num); } else { //添加购物车 $data['uid'] = $this->request->uid(); From 1ade656c277f92b9fa4950f7952da6ebd4593b0c Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 24 Jan 2024 10:47:58 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/order/StoreCart.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controller/api/store/order/StoreCart.php b/app/controller/api/store/order/StoreCart.php index ad9775d9..167becdc 100644 --- a/app/controller/api/store/order/StoreCart.php +++ b/app/controller/api/store/order/StoreCart.php @@ -123,12 +123,14 @@ class StoreCart extends BaseController //更新购物车 $cart_id = $cart['cart_id']; $cart_num = ['cart_num' => ($cart['cart_num'] + $data['cart_num'])]; - if( $cart_num['source'] !=105){ + if($cart_num['source'] !=105){ if ($entryMerId && $entryMerId != $result['product']['mer_id']) { $cart_num['source_id'] = $entryMerId; $cart_num['source'] = StoreCartDao::SOURCE_STORE_CLOUD; } $storeCart = $this->repository->update($cart_id,$cart_num); + }else{ + return app('json')->success(['cart_id' => $cart['cart_id']]); } } else { //添加购物车 From e82cfd2d56ca719a319e539173c09bddf1c85dc8 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 24 Jan 2024 10:49:55 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/order/StoreCart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controller/api/store/order/StoreCart.php b/app/controller/api/store/order/StoreCart.php index 167becdc..c9588abb 100644 --- a/app/controller/api/store/order/StoreCart.php +++ b/app/controller/api/store/order/StoreCart.php @@ -123,7 +123,7 @@ class StoreCart extends BaseController //更新购物车 $cart_id = $cart['cart_id']; $cart_num = ['cart_num' => ($cart['cart_num'] + $data['cart_num'])]; - if($cart_num['source'] !=105){ + if($data['source'] !=105){ if ($entryMerId && $entryMerId != $result['product']['mer_id']) { $cart_num['source_id'] = $entryMerId; $cart_num['source'] = StoreCartDao::SOURCE_STORE_CLOUD; From 8ca1f287ea25a661b01a09e80bc3e9b9fac194e7 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 24 Jan 2024 11:02:21 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/order/StoreOrderDao.php | 2 +- app/common/repositories/store/order/StoreOrderRepository.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/common/dao/store/order/StoreOrderDao.php b/app/common/dao/store/order/StoreOrderDao.php index 201c1f2f..5253f102 100644 --- a/app/common/dao/store/order/StoreOrderDao.php +++ b/app/common/dao/store/order/StoreOrderDao.php @@ -76,7 +76,7 @@ class StoreOrderDao extends BaseDao }); if (isset($where['source']) && $where['source'] == 103) { $wheres['activity_type'] = [0,98]; - $wheres['source'] = [0,2,103]; + $wheres['source'] = [0,2,103,105]; $query->where($wheres); unset($where['source']); } else { diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 76981766..5a55f146 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -1882,7 +1882,6 @@ class StoreOrderRepository extends BaseRepository return $query->field('order_id,order_receipt_id'); }, ])->page($page, $limit)->order('pay_time DESC')->append(['refund_status'])->select(); - foreach ($list as $order) { if ($order->activity_type == 2) { if ($order->presellOrder) { From acfa705c90894e8791b0750d31e099040ef95c96 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 24 Jan 2024 11:03:55 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/order/StoreOrderRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 5a55f146..d96a2a66 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -730,7 +730,7 @@ class StoreOrderRepository extends BaseRepository $where['activity_type'] = $product_type; if ($source == 103) { $where['activity_type'] = [0, 98]; - $where['source'] = [0, 2, 103]; + $where['source'] = [0, 2, 103,105]; } $noComment = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(4))->where($where)->where('StoreOrder.is_del', 0)->count(); $noPay = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(1))->whereRaw("(StoreOrder.paid=0 and StoreOrder.pay_type!=8) or (StoreOrder.paid=1 and StoreOrder.pay_type=8 and StoreOrder.status=2)")->where($where)->where('StoreOrder.is_del', 0)->count();