From 80d34c5c3c15b4f0c032e773f08fd36dcf0ec8a6 Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Mon, 25 Dec 2023 13:49:29 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/product/CloudWarehouse.php | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/app/controller/api/store/product/CloudWarehouse.php b/app/controller/api/store/product/CloudWarehouse.php index 4e899fab..c3fe0315 100644 --- a/app/controller/api/store/product/CloudWarehouse.php +++ b/app/controller/api/store/product/CloudWarehouse.php @@ -45,13 +45,15 @@ class CloudWarehouse extends BaseController */ public function index($street_code, $page = 1, $category_id = 0, $cate_pid = 0,$cate_id = 0,$location = '') { - if($cate_pid!=0){ - $cate_id=Db::name('store_category')->where('pid',$cate_pid)->where('is_show',1)->column('store_category_id'); - } $cloud_product_arr = Db::name('cloud_product') - ->whereIn('cate_id', $cate_id) ->where('street_code', $street_code) - ->where(function($query){ + ->where(function($query)use($cate_pid,$cate_id){ + if($cate_pid!=0){ + $cate_id=Db::name('store_category')->where('pid',$cate_pid)->where('is_show',1)->column('store_category_id'); + } + if($cate_id>0){ + $query ->whereIn('cate_id', $cate_id); + } $query->whereOr('mer_labels', '') ->whereOr('mer_labels',',5,'); }) @@ -72,9 +74,15 @@ class CloudWarehouse extends BaseController if (!$cloud_product) { return app('json')->success(['count' => 0, 'list' => []]); } - $count = Db::name('cloud_product')->whereIn('cate_id', $cate_id) + $count = Db::name('cloud_product') ->where('street_code', $street_code) - ->where(function($query){ + ->where(function($query) use($cate_pid,$cate_id){ + if($cate_pid!=0){ + $cate_id=Db::name('store_category')->where('pid',$cate_pid)->where('is_show',1)->column('store_category_id'); + } + if($cate_id>0){ + $query ->whereIn('cate_id', $cate_id); + } $query->whereOr('mer_labels', '') ->whereOr('mer_labels',',5,'); }) From f9645c9ac5513c1b23d20854ed46294f217f3b87 Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Mon, 25 Dec 2023 13:56:57 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/ProductRepository.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index ecbacbe2..fa29b0a6 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -2587,15 +2587,17 @@ class ProductRepository extends BaseRepository if ($data['product_id'] && $data['type']) { switch ($data['type']) { case 'five': - $data['five'] = 5; + $data['type'] = 5; break; case 'two': $data['type'] = 6; break; case 'three': - $data['mer_id'] = 7; + $data['type'] = 7; + break; case 'seven': $data['type'] = 8; + break; } $store_product=Db::name('store_product')->where('product_id',$data['product_id'])->find(); $datas = [ From c00a035370037ff953f8869e3b95c1c97c62de77 Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Mon, 25 Dec 2023 14:07:17 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/product/CloudWarehouse.php | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/app/controller/api/store/product/CloudWarehouse.php b/app/controller/api/store/product/CloudWarehouse.php index c3fe0315..576fd5d4 100644 --- a/app/controller/api/store/product/CloudWarehouse.php +++ b/app/controller/api/store/product/CloudWarehouse.php @@ -45,19 +45,21 @@ class CloudWarehouse extends BaseController */ public function index($street_code, $page = 1, $category_id = 0, $cate_pid = 0,$cate_id = 0,$location = '') { + + $cloud_where['street_code']=$street_code; + $cloud_where['status']=1; + if($cate_pid!=0){ + $cate_id=Db::name('store_category')->where('pid',$cate_pid)->where('is_show',1)->column('store_category_id'); + } + if($cate_id>0){ + $cloud_where['cate_id']=$cate_id; + } $cloud_product_arr = Db::name('cloud_product') - ->where('street_code', $street_code) - ->where(function($query)use($cate_pid,$cate_id){ - if($cate_pid!=0){ - $cate_id=Db::name('store_category')->where('pid',$cate_pid)->where('is_show',1)->column('store_category_id'); - } - if($cate_id>0){ - $query ->whereIn('cate_id', $cate_id); - } + ->where($cloud_where) + ->where(function($query){ $query->whereOr('mer_labels', '') ->whereOr('mer_labels',',5,'); - }) - ->where('status', 1)->page($page)->field('product_id,mer_labels')->select(); + })->page($page)->field('product_id,mer_labels')->select(); $cloud_product = []; foreach ($cloud_product_arr as $key => $value) { $cloud_product[] = $value['product_id']; @@ -75,18 +77,11 @@ class CloudWarehouse extends BaseController return app('json')->success(['count' => 0, 'list' => []]); } $count = Db::name('cloud_product') - ->where('street_code', $street_code) - ->where(function($query) use($cate_pid,$cate_id){ - if($cate_pid!=0){ - $cate_id=Db::name('store_category')->where('pid',$cate_pid)->where('is_show',1)->column('store_category_id'); - } - if($cate_id>0){ - $query ->whereIn('cate_id', $cate_id); - } + ->where($cloud_where) + ->where(function($query){ $query->whereOr('mer_labels', '') ->whereOr('mer_labels',',5,'); - }) - ->where('status', 1)->count(); + })->count(); $products = $this->spuRepository->getApiSearch($where, $page, 10, false, true); if ($products['list']) { From 8f094bd97f648d6a4e9f62aead70d95010ee0dfa Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Mon, 25 Dec 2023 14:35:43 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=89=A7=E7=85=A7=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 6d70db10..f697f7b9 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1593,19 +1593,12 @@ class Auth extends BaseController if ($status == 1) { $repository->updateStatus($id, $data); $intention = Db::name('merchant_intention')->where('mer_intention_id', $id)->where('type', 1)->find(); - $merLicenseImage = ''; if (!empty($intention['images'])) { $merLicenseImageArray = explode(',', $intention['images']); - $merLicenseImage = $merLicenseImageArray[0] ?? ''; + app()->make(ConfigValueRepository::class)->setFormData([ + 'mer_certificate' => $merLicenseImageArray + ], $intention['mer_id']); } - $merCertificate = merchantConfig($intention['mer_id'], 'mer_certificate'); - if (!is_array($merCertificate)) { - $merCertificate = explode(',', $merCertificate); - } - $merCertificate[0] = $merLicenseImage; - app()->make(ConfigValueRepository::class)->setFormData([ - 'mer_certificate' => $merCertificate - ], $intention['mer_id']); } Db::name('merchant_intention')->where('mer_intention_id', $id)->where('type', 1)->update($updData); } else { From 3752de112f46aad39518aefa79365277bcd4c1b9 Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Mon, 25 Dec 2023 15:29:10 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E7=AE=80=E4=BB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/validate/merchant/MerchantUpdateValidate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/validate/merchant/MerchantUpdateValidate.php b/app/validate/merchant/MerchantUpdateValidate.php index 33e0732f..0a55eb65 100644 --- a/app/validate/merchant/MerchantUpdateValidate.php +++ b/app/validate/merchant/MerchantUpdateValidate.php @@ -21,7 +21,7 @@ class MerchantUpdateValidate extends Validate protected $failException = true; protected $rule = [ - 'mer_info|店铺简介' => 'require|max:200', + // 'mer_info|店铺简介' => 'require|max:200', 'mer_avatar|店铺头像' => 'require|max:128', 'mer_banner|店铺banner' => 'require|max:128', 'mini_banner|店铺街banner' => 'max:128', From 7a3903dfec587e2a181923b70788bc2d8c1aaacd Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Mon, 25 Dec 2023 15:54:11 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=91=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchant/store/product/Product.php | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/app/controller/merchant/store/product/Product.php b/app/controller/merchant/store/product/Product.php index f2cd09af..54a5c341 100644 --- a/app/controller/merchant/store/product/Product.php +++ b/app/controller/merchant/store/product/Product.php @@ -454,10 +454,27 @@ class Product extends BaseController public function cloud_product_list(){ [$page, $limit] = $this->getPage(); - $product_ids=Db::name('cloud_product')->where('mer_id',$this->request->merId()) - ->page($page)->limit($limit)->column('product_id'); - $select = Db::name('store_product')->where('mer_id', $this->request->merId())->whereIn('product_id',$product_ids)->select()->toArray(); + $cloud_product_arr=Db::name('cloud_product')->where('mer_id',$this->request->merId()) + ->page($page)->limit($limit)->field('product_id,mer_labels')->select(); + $cloud_product = []; + foreach ($cloud_product_arr as $key => $value) { + $cloud_product[] = $value['product_id']; + } + $select = Db::name('store_product')->where('mer_id', $this->request->merId())->whereIn('product_id',$cloud_product)->select()->toArray(); $count = Db::name('cloud_product')->where('mer_id',$this->request->merId())->count(); + if ($select) { + foreach ($cloud_product_arr as $key => $value) { + foreach ($select as $k => $v) { + if ($value['product_id'] == $v['product_id']) { + if ($value['mer_labels'] == ',5,') { + $select[$k]['mer_labels_name'] = '五日达'; + } else { + $select[$k]['mer_labels_name'] = '次日达'; + } + } + } + } + } return app('json')->success(['list'=>$select,'count'=>$count]); } From a20d9e9999cee7a3ffad83a8b61c355ec7414d16 Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Mon, 25 Dec 2023 16:06:39 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOtherOrderRepository.php | 98 +------------------ 1 file changed, 3 insertions(+), 95 deletions(-) diff --git a/app/common/repositories/store/order/StoreOtherOrderRepository.php b/app/common/repositories/store/order/StoreOtherOrderRepository.php index 8a6b4c84..8d6a19e0 100644 --- a/app/common/repositories/store/order/StoreOtherOrderRepository.php +++ b/app/common/repositories/store/order/StoreOtherOrderRepository.php @@ -201,42 +201,7 @@ class StoreOtherOrderRepository extends BaseRepository $order->transaction_id = $subOrders[$order->order_sn]['transaction_id']; } $presell = false; - //todo 等待付尾款 - if ($order->activity_type == 2) { - $_make = app()->make(ProductPresellSkuRepository::class); - if ($order->orderProduct[0]['cart_info']['productPresell']['presell_type'] == 2) { - $order->status = 10; - $presell = true; - } else { - $_make->incCount($order->orderProduct[0]['activity_id'], $order->orderProduct[0]['product_sku'], 'two_pay'); - } - $_make->incCount($order->orderProduct[0]['activity_id'], $order->orderProduct[0]['product_sku'], 'one_pay'); - } else if ($order->activity_type == 4) { - $order->status = 9; - $order->save(); - $group_buying_id = app()->make(ProductGroupBuyingRepository::class)->create( - $groupOrder->user, - $order->orderProduct[0]['cart_info']['activeSku']['product_group_id'], - $order->orderProduct[0]['activity_id'], - $order->order_id - ); - $order->orderProduct[0]->activity_id = $group_buying_id; - $order->orderProduct[0]->save(); - } else if ($order->activity_type == 3) { - //更新助力状态 - app()->make(ProductAssistSetRepository::class)->changStatus($order->orderProduct[0]['activity_id']); - } - - //更新委托订单处理 - if ($order->activity_type == 99) { - $cartIdArray = explode(',', $order->cart_id); - $ecartList = Db::name('store_cart')->whereIn('cart_id', $cartIdArray)->select(); - foreach ($ecartList as $ecart) { - if (!empty($ecart['source_id'])) { - Db::name('community')->where('community_id', $ecart['source_id'])->update(['entrust_order_id' => $order->order_id ?? 0]); - } - } - } + // 订单的类型 0 发货 1 自提 if ($order->order_type == 1 && $order->status != 10) { $order->verify_code = $this->verifyCode(); @@ -253,13 +218,6 @@ class StoreOtherOrderRepository extends BaseRepository 'user_type' => $storeOrderStatusRepository::U_TYPE_USER, ]; - //TODO 成为推广员 - foreach ($order->orderProduct as $product) { - if ($flag && $product['cart_info']['product']['is_gift_bag']) { - app()->make(UserRepository::class)->promoter($order->uid); - $flag = false; - } - } if ($order->order_type == 0) { //发起队列物流信息处理 //event('order.sendGoodsCode', $order); @@ -305,36 +263,7 @@ class StoreOtherOrderRepository extends BaseRepository } if (!$presell) { - if ($order['extension_one'] > 0) { - $finance[] = [ - 'order_id' => $order->order_id, - 'order_sn' => $order->order_sn, - 'user_info' => $groupOrder->user->nickname, - 'user_id' => $uid, - 'financial_type' => 'brokerage_one', - 'financial_pm' => 0, - 'type' => 1, - 'number' => $order['extension_one'], - 'mer_id' => $order->mer_id, - 'financial_record_sn' => $financeSn . ($i++) - ]; - } - - if ($order['extension_two'] > 0) { - $finance[] = [ - 'order_id' => $order->order_id, - 'order_sn' => $order->order_sn, - 'user_info' => $groupOrder->user->nickname, - 'user_id' => $uid, - 'financial_type' => 'brokerage_two', - 'financial_pm' => 0, - 'type' => 1, - 'number' => $order['extension_two'], - 'mer_id' => $order->mer_id, - 'financial_record_sn' => $financeSn . ($i++) - ]; - } - + if ($order['commission_rate'] > 0) { $finance[] = [ 'order_id' => $order->order_id, @@ -409,14 +338,8 @@ class StoreOtherOrderRepository extends BaseRepository 'id' => $order->order_id ] ], $order->mer_id); - //自动打印订单 - $this->autoPrinter($order->order_id, $order->mer_id); } - //分销判断 - // if ($groupOrder->user->spread_uid) { - // Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->user->spread_uid, 'type' => 'spread_pay_num', 'inc' => 1]); - // Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->user->spread_uid, 'type' => 'spread_money', 'inc' => $groupOrder->pay_price]); - // } + app()->make(UserRepository::class)->update($groupOrder->uid, [ 'pay_count' => Db::raw('pay_count+' . count($groupOrder->orderList)), 'pay_price' => Db::raw('pay_price+' . $groupOrder->pay_price), @@ -445,21 +368,6 @@ class StoreOtherOrderRepository extends BaseRepository Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->uid, 'type' => 'pay_money', 'inc' => $groupOrder->pay_price]); Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->uid, 'type' => 'pay_num', 'inc' => 1]); app()->make(UserBrokerageRepository::class)->incMemberValue($groupOrder->uid, 'member_pay_num', $groupOrder->group_order_id); - $groupOrder = $groupOrder->toArray(); - event('order.paySuccess', compact('groupOrder')); - //店内扫码支付 - if (isset($groupOrder['micro_pay']) && $groupOrder['micro_pay'] == 1) { - $order = $this->dao->search(['uid' => $groupOrder->uid])->where('group_order_id', $groupOrder->group_order_id)->find(); - $order->status = 2; - $order->verify_time = date('Y-m-d H:i:s'); - $user = $order->user; - event('order.take.before', compact('order')); - Db::transaction(function () use ($order, $user) { - $this->takeAfter($order, $user); - $order->save(); - }); - event('order.take', compact('order')); - } }