From bd85e2208599fd57350cb759bf60351e6cb79713 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 25 Aug 2023 12:02:55 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/system/RelevanceRepository.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/system/RelevanceRepository.php b/app/common/repositories/system/RelevanceRepository.php index a4aaab9f..153d0d30 100644 --- a/app/common/repositories/system/RelevanceRepository.php +++ b/app/common/repositories/system/RelevanceRepository.php @@ -152,7 +152,7 @@ class RelevanceRepository extends BaseRepository * @author Qinii * @day 10/28/21 */ - public function getUserFans(int $uid, int $page, int $limit) + public function getUserFans(int $uid, int $page, int $limit, int $statistics = 0) { $query = $this->dao->getSearch([ 'right_id' => $uid, @@ -163,6 +163,9 @@ class RelevanceRepository extends BaseRepository } ]); $count = $query->count(); + if ($statistics == 1) { + return $count; + } $list = $query->page($page, $limit)->select()->append(['is_start']); return compact('count','list'); } @@ -174,7 +177,7 @@ class RelevanceRepository extends BaseRepository * @author Qinii * @day 10/28/21 */ - public function getUserFocus(int $uid, int $page, int $limit) + public function getUserFocus(int $uid, int $page, int $limit, int $statistics = 0) { $query = $this->dao->getSearch([ 'left_id' => $uid, @@ -185,6 +188,9 @@ class RelevanceRepository extends BaseRepository } ]); $count = $query->count(); + if ($statistics == 1) { + return $count; + } $list = $query->page($page, $limit)->select()->append(['is_fans']); return compact('count','list'); } From d677451d364b0520b8e593808349bd7742d72b99 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 25 Aug 2023 12:47:34 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 8f190daf..8c494a6d 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -21,6 +21,7 @@ use app\common\repositories\user\UserRepository; use app\common\repositories\user\UserSignRepository; use app\common\repositories\wechat\RoutineQrcodeRepository; use app\common\repositories\wechat\WechatUserRepository; +use app\common\repositories\system\RelevanceRepository; use app\validate\api\ChangePasswordValidate; use app\validate\api\UserAuthValidate; use crmeb\basic\BaseController; @@ -213,6 +214,9 @@ class Auth extends BaseController } $data['mer_info'] = $mer_arr; } + $data['fan_num'] = app()->make(RelevanceRepository::class)->getUserFans($user->uid, 1, 1, 1); + $data['focus_num'] = app()->make(RelevanceRepository::class)->getUserFocus($user->uid, 1, 1, 1); + $data['community_num'] = Db::name('community')->where('uid', $user->uid)->whereIn('is_type', '1,2')->count(); return app('json')->success($data); } From 1496e33d766671deca83c10625d79d23626e774c Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 25 Aug 2023 15:18:19 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/merchant/MerchantTypeRepository.php | 11 ++++++++++- .../api/store/merchant/MerchantIntention.php | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/system/merchant/MerchantTypeRepository.php b/app/common/repositories/system/merchant/MerchantTypeRepository.php index b29fe252..dfa9eb94 100644 --- a/app/common/repositories/system/merchant/MerchantTypeRepository.php +++ b/app/common/repositories/system/merchant/MerchantTypeRepository.php @@ -49,9 +49,18 @@ class MerchantTypeRepository extends BaseRepository return compact('count', 'list'); } - public function getSelect($getAll = true) + public function getSelect($getAll = true, $siftStore = false) { $merTypeIds = $this->userApply ? Merchant::AllowApply : Merchant::AllowDisplay; + // 特殊处理市级云仓 + // Merchant::TypeSupplyChain + if ($siftStore == true) { + foreach($merTypeIds as $k=>$v) { + if ($v == Merchant::TypeSupplyChain) { + unset($merTypeIds[$k]); + } + } + } $query = MerchantType::getDB()->when(!$getAll, function ($query) use ($merTypeIds) { $query->whereIn('mer_type_id', $merTypeIds); })->field('mer_type_id,type_name'); diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 3805402d..07c3f38c 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -160,9 +160,10 @@ class MerchantIntention extends BaseController public function typeLst() { /** @var MerchantTypeRepository $repo */ + $siftStore = $this->request->param('sift_store', 0); $repo = app()->make(MerchantTypeRepository::class); $repo->userApply = true; - $lst = $repo->getSelect(false); + $lst = $repo->getSelect(false, $siftStore); return app('json')->success($lst); } } From eb2c6aeb5cf56effa85735001cbe72945385aedb Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Sat, 26 Aug 2023 11:39:10 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=80=80=E6=AC=BE=E7=94=B3=E8=AF=B7=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/order/StoreRefundOrderRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/repositories/store/order/StoreRefundOrderRepository.php b/app/common/repositories/store/order/StoreRefundOrderRepository.php index bd16e28e..927b6261 100644 --- a/app/common/repositories/store/order/StoreRefundOrderRepository.php +++ b/app/common/repositories/store/order/StoreRefundOrderRepository.php @@ -407,7 +407,7 @@ class StoreRefundOrderRepository extends BaseRepository $orderId = $order->order_id; //TODO 订单状态生成佣金 $product = app()->make(StoreOrderProductRepository::class)->userRefundProducts([$productId], $uid, $orderId); - if (!$product) + if ($product->isEmpty()) throw new ValidateException('请选择正确的退款商品'); $product = $product[0]; if ($product['refund_num'] < $num) From bcd0fa539ac0f84f394b5007a43af66c77c8b880 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Sat, 26 Aug 2023 15:11:38 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=BD=AC=E5=94=AE=E5=95=86=E5=93=81=E9=85=8D=E9=80=81=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/order/StoreOrderCreateRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index 1918e21d..995b4c49 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -112,9 +112,9 @@ class StoreOrderCreateRepository extends StoreOrderRepository if (count(array_unique($sourceIdArray)) > 1) { throw new ValidateException('转售商品数据异常'); } - $community = Db::name('Community')->where('community_id', $communityIdArray[0] ?? 0)->field('community_id, title, image')->fetchSql(false)->find(); + $community = Db::name('Community')->where('community_id', $sourceIdArray[0] ?? 0)->field('community_id, title, image')->fetchSql(false)->find(); if ($community) { - $deliverMethod = Db::name('resale')->where('community_id', $communityIdArray[0] ?? 0)->value('deliver_method'); + $deliverMethod = Db::name('resale')->where('community_id', $sourceIdArray[0] ?? 0)->value('deliver_method'); $deliverMethodArray = explode(',', $deliverMethod); } } From 1d37a2c27031c632710d586fbf26ab1c294583a3 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Sat, 26 Aug 2023 17:47:48 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E5=A4=A7=E5=8E=85=E4=B8=AD=E7=9A=84=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=BA=94=E6=A0=B9=E6=8D=AE=E5=AF=B9=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E5=95=86=E6=88=B7=E7=B1=BB=E5=9E=8B=E5=B1=95=E7=A4=BA=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/community/CommunityRepository.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/common/repositories/community/CommunityRepository.php b/app/common/repositories/community/CommunityRepository.php index 25ef518b..cd9f6467 100644 --- a/app/common/repositories/community/CommunityRepository.php +++ b/app/common/repositories/community/CommunityRepository.php @@ -109,9 +109,17 @@ class CommunityRepository extends BaseRepository $config = systemConfig("community_app_switch"); // if (!isset($where['is_type']) && $config) $where['is_type'] = is_array($config) ? implode(',', $config) : $config; if (empty($where['is_type'])) $where['is_type'] = '1,2'; + $uIdArray = []; + if ($where['is_type'] == 3) { + $categoryId = Db::name('merchant')->where('uid', $userInfo->uid)->where('status', 1)->value('category_id'); + $uIdArray = Db::name('merchant')->where('category_id', $categoryId)->where('status', 1)->where('uid', '>', 0)->column('uid'); + } $where['is_del'] = 0; - $query = $this->dao->search($where)->when(in_array(self::COMMUNITY_TYPE_RESALE, explode(',', $where['is_type'])), function ($query) { - $query->where('is_sale', 0); + $query = $this->dao->search($where)->when(in_array(self::COMMUNITY_TYPE_RESALE, explode(',', $where['is_type'])), function ($query) use ($where, $uIdArray) { + $query->where('Community.is_sale', 0); + if (is_array($uIdArray) && count($uIdArray) > 0) { + $query->whereIn('Community.uid', $uIdArray); + } })->order('start DESC,Community.create_time DESC,community_id DESC'); $query->with([ 'author' => function($query) use($userInfo){ @@ -138,7 +146,6 @@ class CommunityRepository extends BaseRepository $list = $query->page($page, $limit)->setOption('field',[]) ->field('community_id,title,image,resale_type,topic_id,Community.count_start,count_reply,start,Community.create_time,Community.uid,Community.status,is_show,content,video_link,is_type,refusal') ->select()->append(['time']); - if ($list) $list = $list->toArray(); foreach ($list as $k => $item) { if ($item['is_type'] == self::COMMUNITY_TYPE_RESALE) { From a9091f394885ccea7c0cb3e4d8db2ced5cb71999 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 28 Aug 2023 14:18:53 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=95=86=E6=88=B7=E5=88=86=E7=B1=BB=E3=80=81=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 19 +++++++++++++++++++ route/api.php | 1 + 2 files changed, 20 insertions(+) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 8c494a6d..fe7c4f1a 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -17,6 +17,7 @@ namespace app\controller\api; use app\common\repositories\store\order\StoreOrderRepository; use app\common\repositories\store\order\StoreRefundOrderRepository; use app\common\repositories\system\notice\SystemNoticeConfigRepository; +use app\common\model\system\merchant\Merchant; use app\common\repositories\user\UserRepository; use app\common\repositories\user\UserSignRepository; use app\common\repositories\wechat\RoutineQrcodeRepository; @@ -890,6 +891,22 @@ class Auth extends BaseController } } + //获取商户分类类别和店铺类型类别 + public function merchantCate() + { + $cateList = Db::name('MerchantCategory')->field(['merchant_category_id', 'category_name'])->select(); + $typeList = [ + ['merchant_category_id' => Merchant::TypeStore ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeStore] ?? ''], + ['merchant_category_id' => Merchant::TypeTownSupplyChain ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeTownSupplyChain] ?? ''], + ['merchant_category_id' => Merchant::TypeSupplyChain ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeSupplyChain] ?? ''] + ]; + $data = [ + 'category' => $cateList, + 'type' => $typeList + ]; + return app('json')->success($data); + } + //根据地址信息查询汇总信息 public function orderStatistics() { @@ -898,6 +915,8 @@ class Auth extends BaseController $streetCode = $this->request->param('street_code', ''); $villageCode = $this->request->param('village_code', ''); $brigadeId = $this->request->param('brigade_id', 0); + $categoryId = $this->request->param('category_id', 0); + $typeId = $this->request->param('type_id', 0); $startDate = $this->request->param('start_date', ''); $endDate = $this->request->param('end_date', ''); $queryBuilder = Db::name('ProductOrderLog')->where('status', 1); diff --git a/route/api.php b/route/api.php index 1ca179d9..dfd69872 100644 --- a/route/api.php +++ b/route/api.php @@ -23,6 +23,7 @@ Route::group('api/', function () { Route::any('test', 'api.Auth/test'); Route::any('dotest', 'api.Auth/dotest'); Route::post('goods/take/:id', 'api.Auth/deliveryGoods'); + Route::get('merchant/cate', 'api.Auth/merchantCate'); Route::get('order/statistics', 'api.Auth/orderStatistics'); Route::get('region/order', 'api.Auth/orderList'); Route::get('region/merchant', 'api.Auth/merStatistics'); From 262a7a28b525561341515583f0504283085a8855 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 28 Aug 2023 15:38:14 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E6=88=B7?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=BA=97=E9=93=BA=E7=B1=BB=E5=9E=8B=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=B1=87=E6=80=BB=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 49 ++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index fe7c4f1a..8918a6bf 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -920,6 +920,16 @@ class Auth extends BaseController $startDate = $this->request->param('start_date', ''); $endDate = $this->request->param('end_date', ''); $queryBuilder = Db::name('ProductOrderLog')->where('status', 1); + //根据商户分类店铺类型筛选商户 + $queryMerBuilder = Db::name('Merchant'); + if ($categoryId) { + $queryMerBuilder = $queryMerBuilder->where('category_id', $categoryId); + } + if ($typeId) { + $queryMerBuilder = $queryMerBuilder->where('type_id', $typeId); + } + $merIdArray = $queryMerBuilder->fetchSql(false)->column('mer_id'); + $queryBuilder = $queryBuilder->whereIn('mer_id', $merIdArray); if ($cityCode) { $queryBuilder = $queryBuilder->where('city_code', $cityCode); } @@ -941,7 +951,7 @@ class Auth extends BaseController if ($endDate) { $queryBuilder = $queryBuilder->whereTime('create_time', '<=', trim($endDate) . ' 23:59:59'); } - $orderNum = $queryBuilder->count(); + $orderNum = $queryBuilder->fetchSql(false)->count(); $productNum = $queryBuilder->sum('product_num'); $totalPrice = $queryBuilder->sum('total_price'); $data = [ @@ -962,9 +972,21 @@ class Auth extends BaseController $streetCode = $this->request->param('street_code', ''); $villageCode = $this->request->param('village_code', ''); $brigadeId = $this->request->param('brigade_id', 0); + $categoryId = $this->request->param('category_id', 0); + $typeId = $this->request->param('type_id', 0); $startDate = $this->request->param('start_date', ''); $endDate = $this->request->param('end_date', ''); $queryBuilder = Db::name('ProductOrderLog')->where('status', 1); + //根据商户分类店铺类型筛选商户 + $queryMerBuilder = Db::name('Merchant'); + if ($categoryId) { + $queryMerBuilder = $queryMerBuilder->where('category_id', $categoryId); + } + if ($typeId) { + $queryMerBuilder = $queryMerBuilder->where('type_id', $typeId); + } + $merIdArray = $queryMerBuilder->fetchSql(false)->column('mer_id'); + $queryBuilder = $queryBuilder->whereIn('mer_id', $merIdArray); if ($cityCode) { $queryBuilder = $queryBuilder->where('city_code', $cityCode); } @@ -986,7 +1008,7 @@ class Auth extends BaseController if ($endDate) { $queryBuilder = $queryBuilder->whereTime('create_time', '<=', trim($endDate) . ' 23:59:59'); } - $count = $queryBuilder->count(); + $count = $queryBuilder->fetchSql(false)->count(); $list = $queryBuilder->setOption('field', [])->field(['id', 'order_id', 'product_num', 'product_price', 'total_price', 'city_code', 'district_code', 'street_code', 'village_code', 'brigade_id', 'create_time'])->order('id', 'desc')->page($page, $limit)->fetchSql(false)->select(); $orderIdList = []; if ($list) { @@ -1008,11 +1030,18 @@ class Auth extends BaseController $districtCode = $this->request->param('district_code', ''); $streetCode = $this->request->param('street_code', ''); $villageCode = $this->request->param('village_code', ''); + $categoryId = $this->request->param('category_id', 0); + $typeId = $this->request->param('type_id', 0); $startDate = $this->request->param('start_date', ''); $endDate = $this->request->param('end_date', ''); $villageId = Db::name('GeoVillage')->where('village_code', $villageCode)->fetchSql(false)->value('village_id', 0); - $queryBuilder = Db::name('Merchant')->where('status', 1); - + $queryBuilder = Db::name('Merchant'); + if ($categoryId) { + $queryBuilder = $queryBuilder->where('category_id', $categoryId); + } + if ($typeId) { + $queryBuilder = $queryBuilder->where('type_id', $typeId); + } if ($districtCode) { $queryBuilder = $queryBuilder->where('area_id', $districtCode); } @@ -1042,10 +1071,18 @@ class Auth extends BaseController $districtCode = $this->request->param('district_code', ''); $streetCode = $this->request->param('street_code', ''); $villageCode = $this->request->param('village_code', ''); + $categoryId = $this->request->param('category_id', 0); + $typeId = $this->request->param('type_id', 0); $startDate = $this->request->param('start_date', ''); $endDate = $this->request->param('end_date', ''); $villageId = Db::name('GeoVillage')->where('village_code', $villageCode)->fetchSql(false)->value('village_id', 0); - $queryBuilder = Db::name('Merchant')->where('status', 1); + $queryBuilder = Db::name('Merchant'); + if ($categoryId) { + $queryBuilder = $queryBuilder->where('category_id', $categoryId); + } + if ($typeId) { + $queryBuilder = $queryBuilder->where('type_id', $typeId); + } if ($districtCode) { $queryBuilder = $queryBuilder->where('area_id', $districtCode); } @@ -1068,7 +1105,7 @@ class Auth extends BaseController 'where' => $this->request->param(), 'goods_num' => $goodsNum ]; - return app('json')->success($data); + return app('json')->success($data); } } From 7b4c9083caee5458e8900cfabeeb6a6b2e71cb33 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 28 Aug 2023 17:59:05 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=85=88=E8=B4=A7?= =?UTF-8?q?=E5=90=8E=E6=AC=BE=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/order/StoreOrderRepository.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index f6b75647..27f1ab23 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -1779,6 +1779,10 @@ class StoreOrderRepository extends BaseRepository if ($order->paid == 1 && $order->status == 0 && $order->order_type == 1) { $order->order_status = 7; } + //如果是先货后款信用购的状态处理 + if ($order->paid == 1 && $order->status == 2 && $order->pay_type == 8) { + $order->order_status = 1; + } return $order->order_status; } From f97af3626c2a30bae851b0bac77f6e8c44ce6142 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 28 Aug 2023 18:46:04 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=85=88=E8=B4=A7?= =?UTF-8?q?=E5=90=8E=E6=AC=BE=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81=E5=A4=84?= =?UTF-8?q?=E7=90=86?= 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 27f1ab23..182a78f6 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -1756,7 +1756,7 @@ class StoreOrderRepository extends BaseRepository } public function getOrderStatusV2($order) { - // 订单状态 1 未支付 2待发货 3待收货 4待评价 5交易完成 6已退款 7待核销 + //订单状态 1 未支付 2待发货 3待收货 4待评价 5交易完成 6已退款 7待核销 $order->order_status = 0; if ($order->paid == 0) { $order->order_status = 1; From 8c55a4e04ddc7dc1b23b624973a2cdeb68cb713e Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 28 Aug 2023 19:06:24 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=80=E8=B4=A7?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/order/StoreOrderRepository.php | 2 +- app/controller/api/store/order/StoreRefundOrder.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 182a78f6..5465cf87 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -1715,7 +1715,7 @@ class StoreOrderRepository extends BaseRepository } else { $query = $this->dao->search($where)->where($this->getOrderType($status))->where('StoreOrder.is_del', 0); } - + $count = $query->count(); $list = $query->with([ 'orderProduct', diff --git a/app/controller/api/store/order/StoreRefundOrder.php b/app/controller/api/store/order/StoreRefundOrder.php index 4c9e6625..e6c11ca3 100644 --- a/app/controller/api/store/order/StoreRefundOrder.php +++ b/app/controller/api/store/order/StoreRefundOrder.php @@ -130,7 +130,9 @@ class StoreRefundOrder extends BaseController if (!$order->refund_status) return app('json')->fail('订单已过退款/退货期限'); if ($order->status < 0) return app('json')->fail('订单已退款'); - if ($order->status == 1) return app('json')->fail('订单已发货不支持退款'); + if ($order->activity_type == 0) { + if ($order->status == 1) return app('json')->fail('订单已发货不支持退款'); + } if ($order->status == 10) return app('json')->fail('订单不支持退款'); if($order->is_virtual && $data['refund_type'] == 2) return app('json')->fail('订单不支持退款退货'); if ($type == 1) { From 604bb129a0e4a427061b464e4a388fc94e74288a Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Tue, 29 Aug 2023 09:11:46 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BE=85=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/order/StoreOrderRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 5465cf87..a706c866 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -1756,7 +1756,7 @@ class StoreOrderRepository extends BaseRepository } public function getOrderStatusV2($order) { - //订单状态 1 未支付 2待发货 3待收货 4待评价 5交易完成 6已退款 7待核销 + //订单状态 1 未支付 2待发货 3待收货 4待评价 5交易完成 6已退款 7待核销 8先货后款待结算 $order->order_status = 0; if ($order->paid == 0) { $order->order_status = 1; @@ -1781,7 +1781,7 @@ class StoreOrderRepository extends BaseRepository } //如果是先货后款信用购的状态处理 if ($order->paid == 1 && $order->status == 2 && $order->pay_type == 8) { - $order->order_status = 1; + $order->order_status = 8; } return $order->order_status; } From 51f2898ab1c3c9fc240bb9a56d5973f536818831 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Tue, 29 Aug 2023 14:14:38 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/order/StoreGroupOrderRepository.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/order/StoreGroupOrderRepository.php b/app/common/repositories/store/order/StoreGroupOrderRepository.php index e9e09742..c8094be8 100644 --- a/app/common/repositories/store/order/StoreGroupOrderRepository.php +++ b/app/common/repositories/store/order/StoreGroupOrderRepository.php @@ -114,7 +114,8 @@ class StoreGroupOrderRepository extends BaseRepository */ public function detail($uid, $id, $flag = true) { - $where = $this->getAll ? ['uid' => $uid] : ['paid' => 0, 'uid' => $uid]; + //'paid' => 0, + $where = $this->getAll ? ['uid' => $uid] : ['uid' => $uid]; $order = StoreGroupOrder::where($where) ->where('group_order_id', $id) ->where('is_del', 0) @@ -125,7 +126,8 @@ class StoreGroupOrderRepository extends BaseRepository $flag && $query->field('mer_id,mer_name,settle_cycle,interest_rate'); }, 'orderProduct', 'presellOrder']); }, 'interest']) - ->order('create_time DESC')->append(['cancel_time', 'cancel_unix'])->find(); + ->order('create_time DESC')->append(['cancel_time', 'cancel_unix'])->fetchSql()->find(); + //throw new DataNotFoundException($order); if (empty($order)) { throw new DataNotFoundException('订单不存在或已取消'); } From 889dd01e458363c6c1be20a42f5c1233cc775b0d Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Tue, 29 Aug 2023 14:19:00 +0800 Subject: [PATCH 14/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/order/StoreGroupOrderRepository.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/common/repositories/store/order/StoreGroupOrderRepository.php b/app/common/repositories/store/order/StoreGroupOrderRepository.php index c8094be8..011b10b8 100644 --- a/app/common/repositories/store/order/StoreGroupOrderRepository.php +++ b/app/common/repositories/store/order/StoreGroupOrderRepository.php @@ -126,8 +126,7 @@ class StoreGroupOrderRepository extends BaseRepository $flag && $query->field('mer_id,mer_name,settle_cycle,interest_rate'); }, 'orderProduct', 'presellOrder']); }, 'interest']) - ->order('create_time DESC')->append(['cancel_time', 'cancel_unix'])->fetchSql()->find(); - //throw new DataNotFoundException($order); + ->order('create_time DESC')->append(['cancel_time', 'cancel_unix'])->find(); if (empty($order)) { throw new DataNotFoundException('订单不存在或已取消'); } From b897d2ac4f8fdc3c9c077e4181016d1f4d7636c8 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Tue, 29 Aug 2023 14:44:53 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/order/StoreGroupOrderRepository.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/store/order/StoreGroupOrderRepository.php b/app/common/repositories/store/order/StoreGroupOrderRepository.php index 011b10b8..d1e4ebdb 100644 --- a/app/common/repositories/store/order/StoreGroupOrderRepository.php +++ b/app/common/repositories/store/order/StoreGroupOrderRepository.php @@ -114,7 +114,7 @@ class StoreGroupOrderRepository extends BaseRepository */ public function detail($uid, $id, $flag = true) { - //'paid' => 0, + // 'paid' => 0 $where = $this->getAll ? ['uid' => $uid] : ['uid' => $uid]; $order = StoreGroupOrder::where($where) ->where('group_order_id', $id) @@ -127,6 +127,9 @@ class StoreGroupOrderRepository extends BaseRepository }, 'orderProduct', 'presellOrder']); }, 'interest']) ->order('create_time DESC')->append(['cancel_time', 'cancel_unix'])->find(); + if ($order['paid'] == 1 && $order['pay_type'] != 8) { + throw new DataNotFoundException('订单不存在或已取消'); + } if (empty($order)) { throw new DataNotFoundException('订单不存在或已取消'); } From 96d28b3e674e20617a550762cf2c37979661f602 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Tue, 29 Aug 2023 16:17:21 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=B0=E5=BA=97?= =?UTF-8?q?=E6=A0=B8=E9=94=80=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/order/StoreOrderRepository.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index a706c866..4fe7130d 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -2647,6 +2647,12 @@ class StoreOrderRepository extends BaseRepository $order->interest->save(); } } else { + if ($groupOrder->pay_type == StoreGroupOrder::PAY_TYPE_CREDIT_BUY) { + //如果是先货后款并且选择到店核销、同意时生成核销码 + if (!empty($order['order_type']) && $order['order_type'] == 1) { + $order->verify_code = 1; + } + } $order->status = StoreOrder::STATUS_WAIT_PAY; $groupOrder->paid = 1; $groupOrder->pay_time = date('Y-m-d H:i:s'); From b5f9e64bc31272f4c0777dc1d218328d9f71afc0 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Tue, 29 Aug 2023 16:19:12 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=B0=E5=BA=97?= =?UTF-8?q?=E6=A0=B8=E9=94=80=E7=A0=81=E7=94=9F=E6=88=90?= 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 4fe7130d..031e2af9 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -2649,7 +2649,7 @@ class StoreOrderRepository extends BaseRepository } else { if ($groupOrder->pay_type == StoreGroupOrder::PAY_TYPE_CREDIT_BUY) { //如果是先货后款并且选择到店核销、同意时生成核销码 - if (!empty($order['order_type']) && $order['order_type'] == 1) { + if (!empty($order->order_type) && $order->order_type == 1) { $order->verify_code = 1; } } From c4454c514fce030ff2c2c4fbee81f2d5d7dfc48a Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Tue, 29 Aug 2023 16:23:45 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=B0=E5=BA=97?= =?UTF-8?q?=E6=A0=B8=E9=94=80=E7=A0=81=E7=94=9F=E6=88=90?= 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 031e2af9..440c6ba9 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -2650,7 +2650,7 @@ class StoreOrderRepository extends BaseRepository if ($groupOrder->pay_type == StoreGroupOrder::PAY_TYPE_CREDIT_BUY) { //如果是先货后款并且选择到店核销、同意时生成核销码 if (!empty($order->order_type) && $order->order_type == 1) { - $order->verify_code = 1; + $order->verify_code = $this->verifyCode(); } } $order->status = StoreOrder::STATUS_WAIT_PAY;