From e4a8af42756612906969a27d407a9e494e5e08e9 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Mon, 29 May 2023 14:09:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BE=9B=E8=B4=A7=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E4=B8=8D=E5=B1=95=E7=A4=BA=E6=9C=AA=E4=B8=8A=E6=9E=B6=E5=95=86?= =?UTF-8?q?=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/store/product/Product.php | 3 +++ app/common/model/system/merchant/Merchant.php | 1 + 2 files changed, 4 insertions(+) diff --git a/app/common/model/store/product/Product.php b/app/common/model/store/product/Product.php index d3dbd9e3..21e9b6e4 100644 --- a/app/common/model/store/product/Product.php +++ b/app/common/model/store/product/Product.php @@ -37,6 +37,9 @@ class Product extends BaseModel protected $deleteTime = 'is_del'; protected $defaultSoftDelete = 0; + + const IS_SHOW = 1; //上架 + const IS_NOT_SHOW = 0; //下架 /** * @Author:Qinii * @Date: 2020/5/8 diff --git a/app/common/model/system/merchant/Merchant.php b/app/common/model/system/merchant/Merchant.php index f3d83c9c..fdaf5872 100644 --- a/app/common/model/system/merchant/Merchant.php +++ b/app/common/model/system/merchant/Merchant.php @@ -122,6 +122,7 @@ class Merchant extends BaseModel { $list = Product::where('mer_id', $this['mer_id']) ->where((new ProductDao())->productTypeShow(98)) + ->where('is_show', Product::IS_SHOW) ->field('mer_id,product_id,product_type,store_name,image,price,is_show,status,is_gift_bag,is_good,cate_id') ->order('sort DESC, create_time DESC') ->limit(10) From 34dfe7e2ad8c8efe18af3e2d7fe93d0de247009c Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Mon, 29 May 2023 17:44:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E9=87=87=E8=B4=AD=20=E5=95=86=E5=93=81=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/system/merchant/MerchantDao.php | 10 ++++++++++ app/controller/api/store/product/StoreMicro.php | 11 +++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/common/dao/system/merchant/MerchantDao.php b/app/common/dao/system/merchant/MerchantDao.php index bb364a5e..0ad51e11 100644 --- a/app/common/dao/system/merchant/MerchantDao.php +++ b/app/common/dao/system/merchant/MerchantDao.php @@ -294,4 +294,14 @@ class MerchantDao extends BaseDao ]); } + public function getValidMerchant($where) + { + $where = array_merge([ + 'is_del' => 0, + 'status' => 1, + 'mer_state' => 1, + ], $where); + return $this->getModel()::getInstance()->where($where); + } + } diff --git a/app/controller/api/store/product/StoreMicro.php b/app/controller/api/store/product/StoreMicro.php index 2c3e447b..d89e915e 100644 --- a/app/controller/api/store/product/StoreMicro.php +++ b/app/controller/api/store/product/StoreMicro.php @@ -1,5 +1,7 @@ where('mer_id',$mer_id)->value('category_id'); - $mer_id=Db::name('merchant')->where('category_id',$category_id)->where('type_id',13)->value('mer_id'); + $platformMerId = app()->make(MerchantDao::class)->getValidMerchant(['category_id' => $category_id, 'type_id' => Merchant::TypePlatform], 'mer_id')->value('mer_id'); + $productWhere = ['is_show' => 1, 'status' => 1, 'mer_status' => 1, 'is_del' => 0]; if($code!=''){ - $product_id_arr=Db::name('store_product_attr_value')->where('mer_id',$mer_id)->where('bar_code',$code)->column('product_id'); + $product_id_arr=Db::name('store_product_attr_value')->where('mer_id',$platformMerId)->where('bar_code',$code)->column('product_id'); $product_id_arr=implode(',',$product_id_arr); - $find=Db::name('store_product')->where('product_id',$product_id_arr)->select(); + $find=Db::name('store_product')->where('product_id',$product_id_arr)->where($productWhere)->select(); }else{ - $find=Db::name('store_product')->where('mer_id',$mer_id)->where('store_name','like','%'.$name.'%')->select(); + $find=Db::name('store_product')->where('mer_id',$platformMerId)->where('store_name','like','%'.$name.'%')->where($productWhere)->select(); } if (count($find)==0){ if($code!=''){ From 2002d6dc123983ff01ddb6b0fd71f29fc2452ad4 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Tue, 30 May 2023 11:59:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E6=88=B7=E5=B7=B2=E7=BC=B4=E7=BA=B3?= =?UTF-8?q?=E4=BF=9D=E8=AF=81=E9=87=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/system/merchant/Merchant.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controller/admin/system/merchant/Merchant.php b/app/controller/admin/system/merchant/Merchant.php index 1e813551..14dbbc9d 100644 --- a/app/controller/admin/system/merchant/Merchant.php +++ b/app/controller/admin/system/merchant/Merchant.php @@ -147,6 +147,7 @@ class Merchant extends BaseController $margin = $this->repository->checkMargin($id, $data['type_id']); $data['margin'] = $margin['margin']; $data['is_margin'] = $margin['is_margin']; + $data['ot_margin'] = $data['paid_margin']; $datas=$data; $this->repository->update($id, $datas); return app('json')->success('编辑成功');