diff --git a/app/common/dao/store/order/StoreCartDao.php b/app/common/dao/store/order/StoreCartDao.php index 581bf118..b3c58b25 100644 --- a/app/common/dao/store/order/StoreCartDao.php +++ b/app/common/dao/store/order/StoreCartDao.php @@ -71,7 +71,11 @@ class StoreCartDao extends BaseDao */ public function getAll(int $uid,$product_type,$source=0) { - $query = ($this->getModel())::where(['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type,'source'=>$source]) + $where=['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type,'source'=>$source]; + if($product_type==0 &&$source>0){ + $where=['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'source'=>$source]; + } + $query = ($this->getModel())::where($where) ->with([ 'product' => function ($query) { $query->field('product_id,image,store_name,is_show,status,is_del,unit_name,price,mer_status,is_used,product_type,once_max_count,once_min_count,pay_limit,mer_svip_status,svip_price_type'); diff --git a/app/common/dao/store/product/SpuDao.php b/app/common/dao/store/product/SpuDao.php index 378e4b1c..2470a86b 100644 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -47,7 +47,7 @@ class SpuDao extends BaseDao if(isset($where['order']) && $where['order'] === 'none'){ $order = ''; } - $query = Spu::getDB()->alias('S')->join('StoreProduct P','S.product_id = P.product_id', 'left')->where('P.product_type',$where['product_type']); + $query = Spu::getDB()->alias('S')->join('StoreProduct P','S.product_id = P.product_id', 'left'); $query->when(isset($where['is_del']) && $where['is_del'] !== '',function($query)use($where){ $query->where('P.is_del',$where['is_del']); }) @@ -57,6 +57,9 @@ class SpuDao extends BaseDao ->when(isset($where['mer_id']) && $where['mer_id'] !== '',function($query)use($where){ $query->where('P.mer_id',$where['mer_id']); }) + ->when(isset($where['product_type']) && $where['product_type'] !== '',function($query)use($where){ + $query->where('P.product_type',$where['product_type']); + }) ->when(isset($where['mer_array_id']),function($query)use($where){ $query->whereIn('P.mer_id',$where['mer_array_id']); }) 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/Auth.php b/app/controller/api/Auth.php index 86dfd516..97c5500c 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -368,7 +368,7 @@ class Auth extends BaseController $store_service = Db::name('store_service')->where('uid', $data['uid'])->find(); if ($store_service) { - $mer_arr = Db::name('merchant')->where('mer_id', $store_service['mer_id'])->where('is_del', 0)->field('type_id,mer_avatar,mer_banner,business_status,mer_info,category_id,service_phone,mer_address,uid,mer_name,create_time,update_time,mer_settlement_agree_status,is_margin,street_id')->find(); + $mer_arr = Db::name('merchant')->where('mer_id', $store_service['mer_id'])->where('is_del', 0)->field('type_id,mer_avatar,mer_banner,business_status,mer_info,category_id,service_phone,mer_address,uid,mer_name,create_time,update_time,mer_settlement_agree_status,is_margin,street_id,is_company')->find(); $bank_info = Db::name('merchant_intention')->where('mer_id', $store_service['mer_id'])->field('company_name,bank_username,bank_opening,bank_code')->find(); if ($mer_arr && $mer_arr['mer_avatar'] != '' && $mer_arr['mer_banner'] != '' && $mer_arr['mer_info'] && $mer_arr['service_phone'] != '' && $mer_arr['mer_address'] != '') { $data['is_wsxx'] = 1; 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); diff --git a/app/controller/api/store/product/CloudWarehouse.php b/app/controller/api/store/product/CloudWarehouse.php index 5589f972..eebcc1ce 100644 --- a/app/controller/api/store/product/CloudWarehouse.php +++ b/app/controller/api/store/product/CloudWarehouse.php @@ -70,7 +70,6 @@ class CloudWarehouse extends BaseController 'status' => 1, 'is_del' => 0, 'mer_status' => 1, - 'product_type' => 0, 'product_id' => $cloud_product ]; if (!$cloud_product) {