From 8c8c2d6852ee38150bedccf1ee5db1bc9e2769ea Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 4 Jan 2024 16:24:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchant/MerchantIntentionRepository.php | 3 +- app/controller/api/Demo.php | 55 +++++++++++++++++++ .../api/store/merchant/MerchantIntention.php | 6 +- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/system/merchant/MerchantIntentionRepository.php b/app/common/repositories/system/merchant/MerchantIntentionRepository.php index 56b33a80..1b0eced6 100644 --- a/app/common/repositories/system/merchant/MerchantIntentionRepository.php +++ b/app/common/repositories/system/merchant/MerchantIntentionRepository.php @@ -141,7 +141,8 @@ class MerchantIntentionRepository extends BaseRepository 'margin' => $margin['margin'] ?? 0, 'uid' => $intention['uid'], 'reg_admin_id' => $autoCreate ? 0: request()->adminId(), - 'mer_intention_id' => $id + 'mer_intention_id' => $id, + 'is_company'=>$intention['is_company'], ]; $data['fail_msg'] = ''; $smsData = [ diff --git a/app/controller/api/Demo.php b/app/controller/api/Demo.php index 1dc08689..cad9fbe9 100644 --- a/app/controller/api/Demo.php +++ b/app/controller/api/Demo.php @@ -30,6 +30,61 @@ class Demo extends BaseController { public function index() { + $data=[ + + 6923644264192, + 6923644210151, + 6921665735042, + 6921665731693, + 6921665731679, + 6921665730825, + 6921665707940, + 6921665701054, + 6920208995349, + 6920208986163, + 6920208960866, + 6920208960064, + 6920208924394, + 6920208924035, + 6920208924011, + 6919188019961, + 6919188019961, + 6908791503943, + 6908791006024, + 6907992507385, + ]; + $mer_id=167; + foreach ($data as $item) { + $store_product_attr_value=Db::name('store_product_attr_value')->alias('a') + ->join('store_product b','a.product_id=b.product_id and b.product_type=98') + ->where('a.bar_code',$item)->value('a.product_id'); + if($store_product_attr_value){ + $find=Db::name('store_product_attr_value')->alias('a') + ->join('store_product b','a.product_id=b.product_id and b.product_type=0 and b.mer_id='.$mer_id) + ->where('a.bar_code',$item)->field('a.product_id,b.cate_id')->find(); + if($find){ + $cloud_product=Db::name('cloud_product')->where('product_id',$find['product_id'])->where('mer_id',$mer_id)->value('product_id'); + if(!$cloud_product){ + $source_mer_id = Db::name('store_product')->where('product_id', $store_product_attr_value)->value('mer_id'); + $datas = [ + 'product_id' => $find['product_id'], + 'cate_id' => $find['cate_id'], + 'mer_id' => $mer_id, + 'source_mer_id' => $source_mer_id, + 'street_code' => 510521107, + 'type_id' => 17, + 'category_id' => 2566, + 'weight' => 1, + 'status' => 1, + 'create_time' => date('Y-m-d H:i:s'), + 'mer_labels' =>'', + ]; + Db::name('cloud_product')->insert($datas); + } + } + } + } + halt(1); $mer_id = 104; $file = request()->file('file'); $zip_name = explode('.', $file->getOriginalName())[0]; diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 196a4e31..64741cbb 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -41,6 +41,9 @@ class MerchantIntention extends BaseController $this->userInfo = $this->request->isLogin() ? $this->request->userInfo() : null; } + /** + * 提交入驻申请 + */ public function create() { $data = $this->checkParams(); @@ -359,7 +362,8 @@ class MerchantIntention extends BaseController 'area_id', 'street_id', 'village_id', - 'is_nmsc' + 'is_nmsc', + 'is_company' ]); app()->make(MerchantIntentionValidate::class)->check($data);