From 1d1c8fe40ce4f9504ebc37860d142cba9a404afb Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 18 Apr 2024 16:11:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E6=80=BB=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=95=86=E5=93=81=E6=94=AF=E6=8C=81=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E7=9C=81=E5=85=AC=E5=8F=B8=E5=8F=91=E8=B5=B7=E4=BA=BA=E5=8F=8A?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=9C=81=E5=85=AC=E5=8F=B8=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E4=BD=A3=E9=87=91=E5=92=8C=E4=BE=9B=E5=BA=94=E5=95=86=E6=8F=90?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/product/ProductRepository.php | 4 +-- app/controller/admin/store/StoreProduct.php | 20 +++++++++++-- app/controller/merchant/marketing/Agent.php | 24 ++++++++++++++++ route/merchant/marketing.php | 28 +++++++++---------- 4 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 app/controller/merchant/marketing/Agent.php diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 214038c..a2f1c63 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -87,7 +87,6 @@ class ProductRepository extends BaseRepository ['is_batch',0], ['batch_num',0], ['batch_unit',''], - ['agent_two_ids',[]], ]; protected $admin_filed = 'Product.product_id,Product.mer_id,brand_id,spec_type,unit_name,mer_status,rate,reply_count,store_info,cate_id,Product.image,slider_image,Product.store_name,Product.keyword,Product.sort,U.rank,Product.is_show,Product.sales,Product.price,extension_type,refusal,cost,Product.ot_price,stock,is_gift_bag,Product.care_count,Product.status,is_used,Product.create_time,Product.product_type,old_product_id,star,ficti,integral_total,integral_price_total,sys_labels,param_temp_id,mer_svip_status,svip_price,svip_price_type'; protected $filed = 'Product.product_id,Product.mer_id,brand_id,unit_name,spec_type,mer_status,rate,reply_count,store_info,cate_id,Product.image,slider_image,Product.store_name,Product.keyword,Product.sort,Product.is_show,Product.sales,Product.price,extension_type,refusal,cost,Product.ot_price,stock,is_gift_bag,Product.care_count,Product.status,is_used,Product.create_time,Product.product_type,old_product_id,integral_total,integral_price_total,mer_labels,Product.is_good,Product.is_del,type,param_temp_id,mer_svip_status,svip_price,svip_price_type'; @@ -530,8 +529,7 @@ class ProductRepository extends BaseRepository // 按照批量购买设置 'is_batch' => $data['is_batch'] ?? 0, 'batch_num' => $data['batch_num'] ?? 0, - 'batch_unit' => $data['batch_unit'] ?? '', - 'agent_two_ids' => is_array($data['agent_two_ids']) ? implode(',',$data['agent_two_ids']) : $data['agent_two_ids'], + 'batch_unit' => $data['batch_unit'] ?? '' ]; if (isset($data['extend'])) $result['extend'] = $data['extend'] ? json_encode($data['extend'], JSON_UNESCAPED_UNICODE) : ''; if (isset($data['mer_id'])) $result['mer_id'] = $data['mer_id']; diff --git a/app/controller/admin/store/StoreProduct.php b/app/controller/admin/store/StoreProduct.php index 073a0e2..d596f40 100644 --- a/app/controller/admin/store/StoreProduct.php +++ b/app/controller/admin/store/StoreProduct.php @@ -150,10 +150,24 @@ class StoreProduct extends BaseController * @param validate $validate * @return array */ - public function checkParams(validate $validate) - { - $data = $this->request->params(['is_hot','is_best','is_benefit','is_new','store_name','content','rank','star']); + public function checkParams(validate $validate){ + $data = $this->request->params([ + 'is_hot', + 'is_best', + 'is_benefit', + 'is_new', + 'store_name', + 'content', + 'rank', + 'star', + ['agent_two_ids', []], + 'agent_two_money', + 'supplier_money' + ]); $validate->check($data); + + $data['agent_two_ids'] = implode(',',$data['agent_two_ids']); + return $data; } diff --git a/app/controller/merchant/marketing/Agent.php b/app/controller/merchant/marketing/Agent.php new file mode 100644 index 0000000..180d7ae --- /dev/null +++ b/app/controller/merchant/marketing/Agent.php @@ -0,0 +1,24 @@ +getPage(); + $params = $this->request->params(['uid','agent_type','contact_name','contact_phone','is_invite_supplier']); + $data = app()->make(AgentRepository::class)->getList((array)$params,(int)$page,(int)$limit); + + return app('json')->success($data); + } + + + +} diff --git a/route/merchant/marketing.php b/route/merchant/marketing.php index 9323c0c..b7f9a7d 100644 --- a/route/merchant/marketing.php +++ b/route/merchant/marketing.php @@ -8,7 +8,6 @@ use think\facade\Route; use app\common\middleware\MerchantCheckBaseInfoMiddleware; Route::group(function () { - //秒杀商品 Route::group('store/seckill_product', function () { Route::get('lst_time', '/lst_time')->option([ @@ -69,7 +68,6 @@ Route::group(function () { ], ] ]); - //预售商品 Route::group('store/product/presell', function () { Route::get('lst', '/lst')->name('merchantStoreProductPresellLst')->option([ @@ -121,7 +119,6 @@ Route::group(function () { ], ] ]); - //助力商品 Route::group('store/product/assist', function () { Route::get('lst', '/lst')->name('merchantStoreProductAssistLst')->option([ @@ -169,7 +166,6 @@ Route::group(function () { ], ] ]); - //助力活动 Route::group('store/product/assist_set', function () { Route::get('lst', '/lst')->name('merchantStoreProductAssistSetLst')->option([ @@ -182,7 +178,6 @@ Route::group(function () { '_path' => '/marketing/assist/assist_set', '_auth' => true, ]); - //拼团商品 Route::group('store/product/group', function () { Route::get('lst', '/lst')->name('merchantStoreProductGroupLst')->option([ @@ -230,14 +225,11 @@ Route::group(function () { ], ] ]); - - Route::get('config/others/group_buying', 'admin.system.config.ConfigOthers/getGroupBuying') - ->name('merchantConfigGroupBuying')->option([ + Route::get('config/others/group_buying', 'admin.system.config.ConfigOthers/getGroupBuying')->name('merchantConfigGroupBuying')->option([ '_alias' => '拼团配置', '_path' => '/marketing/combination/combination_goods', '_auth' => true, ]);; - //拼团活动 Route::group('store/product/group/buying', function () { Route::get('lst', '/lst')->name('merchantStoreProductGroupBuyingLst')->option([ @@ -264,9 +256,6 @@ Route::group(function () { ], ] ]); - - - //直播间 Route::group('broadcast/room', function () { Route::get('lst', '/lst')->name('merchantBroadcastRoomLst')->option([ @@ -352,7 +341,6 @@ Route::group(function () { ], ] ]); - //直播小助手 Route::group('broadcast/assistant', function () { Route::get('lst', '/lst')->name('merchantBroadcastAssistantLst')->option([ @@ -398,7 +386,6 @@ Route::group(function () { ], ] ]); - //直播间商品 Route::group('broadcast/goods', function () { Route::get('lst', '/lst')->name('merchantBroadcastGoodsLst')->option([ @@ -453,7 +440,6 @@ Route::group(function () { ], ] ]); - //积分 Route::group('integral',function(){ Route::get('lst','/getList')->name('merchantIntegralList')->option([ @@ -490,6 +476,18 @@ Route::group(function () { ] ]); + // 代理中心 + Route::group('marketing/agent', function () { + // 代理管理相关 + Route::get('list','/agentList')->name('systemMarketingAgentList')->option([ + '_alias' => '代理列表', + ]); + })->prefix('merchant.marketing.Agent')->option([ + '_path' => '/marketing/agent/list', + '_auth' => true, + ]); + + })->middleware(AllowOriginMiddleware::class) ->middleware(MerchantTokenMiddleware::class, true) ->middleware(MerchantAuthMiddleware::class)