From 3a0ffd3abc374151b99d0c78ed70b844ac616054 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 21 Sep 2023 20:11:42 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/system/CacheRepository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/system/CacheRepository.php b/app/common/repositories/system/CacheRepository.php index 1bf43ccb..999121dd 100644 --- a/app/common/repositories/system/CacheRepository.php +++ b/app/common/repositories/system/CacheRepository.php @@ -88,7 +88,7 @@ class CacheRepository extends BaseRepository ['label' => '商户入驻申请协议', 'key' => self::INTEGRAL_AGREE], ['label' => '交易申请协议', 'key' => self::BUSINESS_APPLY_AGREE], ['label' => '商户服务协议', 'key' => self::MERC_SERVICE_AGREE], - ['label' => '供应链商户补充协议','key' => self::BUSINESS_APPLY_AGREE], + ['label' => '供应链商户补充协议','key' => self::MERC_SUPPLY_AGREE], ['label' => '产品代销三方合作协议书', 'key' => self::CONSIGN_PRODUCT_AGREE], ['label' => '商户开通采购、交易及结算功能协议', 'key' => self::MERC_SETTLE_AGREE], ]; @@ -121,6 +121,10 @@ class CacheRepository extends BaseRepository self::PLATFORM_RULE, self::COUPON_AGREE, self::SYS_SVIP, + self::MERC_SERVICE_AGREE, + self::MERC_SUPPLY_AGREE, + self::CONSIGN_PRODUCT_AGREE, + self::MERC_SETTLE_AGREE, ]; } From 005b168c3769fec7c9b273094df485cae8adee58 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 21 Sep 2023 20:22:51 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 833e5fee..7cf6d3e0 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -210,7 +210,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')->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_services_agree_status,mer_supply_agree_status,consign_product_agree_status,mer_settlement_agree_status')->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; } From adca4faabf584c17b27990d78a39de4462b7ce1c Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 21 Sep 2023 20:46:29 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 7cf6d3e0..65b0e43f 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1401,8 +1401,10 @@ class Auth extends BaseController { $repository = app()->make(CacheRepository::class); //sys_intention_agree business_apply_agree + //mer_services_agree mer_supply_agree + //consign_product_agree mer_settlement_agree $type = $this->request->get('type', 'sys_intention_agree'); - $typeArray = ['sys_intention_agree', 'business_apply_agree']; + $typeArray = ['sys_intention_agree', 'business_apply_agree', 'mer_services_agree', 'mer_supply_agree', 'consign_product_agree', 'mer_settlement_agree']; if (!in_array($type, $typeArray)) { return app('json')->fail('协议key错误'); } From 1a20217b510fa3f9c1cc021c2a645420143c0ca6 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 22 Sep 2023 09:24:51 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 2 +- .../api/store/merchant/MerchantIntention.php | 16 ++++++++++++++++ route/api.php | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 65b0e43f..b7b567b0 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -210,7 +210,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_services_agree_status,mer_supply_agree_status,consign_product_agree_status,mer_settlement_agree_status')->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')->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/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index de3f57d7..8d9b6326 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -16,6 +16,7 @@ use app\common\repositories\system\merchant\MerchantAdminRepository; use app\common\repositories\system\merchant\MerchantCategoryRepository; use app\common\repositories\system\merchant\MerchantRepository; use app\common\repositories\system\merchant\MerchantTypeRepository; +use app\common\repositories\system\CacheRepository; use app\validate\api\MerchantIntentionValidate; use crmeb\services\SmsService; use crmeb\services\SwooleTaskService; @@ -101,6 +102,21 @@ class MerchantIntention extends BaseController return app('json')->success('提交成功'); } + public function agreeApply() + { + $typeId = $this->request->params('mer_type_id'); + $typeCode = Db::name('merchant_type')->where('mer_type_id', $typeId)->value('type_code', ''); + $repository = app()->make(CacheRepository::class); + $agreeData[] = $repository->getResult('consign_product_agree'); + if ($typeCode == Merchant::TypeCode['TypeStore']){ + $agreeData[] = $repository->getResult('mer_services_agree'); + } + if ($typeCode == Merchant::TypeCode['TypeSupplyChain'] || $typeCode == Merchant::TypeCode['TypeTownSupplyChain']){ + $agreeData[] = $repository->getResult('mer_supply_agree'); + } + return app('json')->success($agreeData); + } + public function businessApply() { if (!systemConfig('mer_intention_open')) { diff --git a/route/api.php b/route/api.php index 7c5d18e0..e98cda10 100644 --- a/route/api.php +++ b/route/api.php @@ -255,6 +255,8 @@ Route::group('api/', function () { Route::get('intention/lst', 'api.store.merchant.MerchantIntention/lst'); //交易申请商户 Route::post('intention/business', 'api.store.merchant.MerchantIntention/businessApply'); + //申请商户协议 + Route::get('intention/agree', 'api.store.merchant.MerchantIntention/agreeApply'); Route::get('intention/detail/:id', 'api.store.merchant.MerchantIntention/detail'); Route::post('intention/update/:id', 'api.store.merchant.MerchantIntention/update'); Route::post('store/product/group/cancel', 'api.store.product.StoreProductGroup/cancel'); From cab3b27a6c13605ae3aab290d683dc994567a53e Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 22 Sep 2023 09:33:21 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/merchant/MerchantIntention.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 8d9b6326..27e426c7 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -104,7 +104,7 @@ class MerchantIntention extends BaseController public function agreeApply() { - $typeId = $this->request->params('mer_type_id'); + $typeId = $this->request->get('mer_type_id', 0); $typeCode = Db::name('merchant_type')->where('mer_type_id', $typeId)->value('type_code', ''); $repository = app()->make(CacheRepository::class); $agreeData[] = $repository->getResult('consign_product_agree'); From 2adb8f4b2fc22b7a52cde44cee1c92f845161d02 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 22 Sep 2023 09:35:06 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/merchant/MerchantIntention.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 27e426c7..2687f342 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -12,6 +12,7 @@ namespace app\controller\api\store\merchant; +use app\common\model\system\merchant\Merchant; use app\common\repositories\system\merchant\MerchantAdminRepository; use app\common\repositories\system\merchant\MerchantCategoryRepository; use app\common\repositories\system\merchant\MerchantRepository; From c7b3cffd192aa6e7982d43d7425e156033a25d3f Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 22 Sep 2023 09:42:29 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/merchant/MerchantIntention.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 2687f342..2a352f56 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -108,12 +108,18 @@ class MerchantIntention extends BaseController $typeId = $this->request->get('mer_type_id', 0); $typeCode = Db::name('merchant_type')->where('mer_type_id', $typeId)->value('type_code', ''); $repository = app()->make(CacheRepository::class); - $agreeData[] = $repository->getResult('consign_product_agree'); + $agree = $repository->getResult('consign_product_agree'); + $agree['content'] = $agree['consign_product_agree']; + $agreeData[] = $agree; if ($typeCode == Merchant::TypeCode['TypeStore']){ - $agreeData[] = $repository->getResult('mer_services_agree'); + $agree = $repository->getResult('mer_services_agree'); + $agree['content'] = $agree['mer_services_agree']; + $agreeData[] = $agree; } if ($typeCode == Merchant::TypeCode['TypeSupplyChain'] || $typeCode == Merchant::TypeCode['TypeTownSupplyChain']){ - $agreeData[] = $repository->getResult('mer_supply_agree'); + $agree = $repository->getResult('mer_supply_agree'); + $agree['content'] = $agree['mer_services_agree']; + $agreeData[] = $agree; } return app('json')->success($agreeData); } From 4cd44c12aee888772c4d570171acb3718fbda5e1 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 22 Sep 2023 09:51:32 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/merchant/MerchantIntention.php | 23 +++++-------------- route/api.php | 2 +- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 2a352f56..0b814ec1 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -103,25 +103,14 @@ class MerchantIntention extends BaseController return app('json')->success('提交成功'); } - public function agreeApply() + public function settlementApply() { - $typeId = $this->request->get('mer_type_id', 0); - $typeCode = Db::name('merchant_type')->where('mer_type_id', $typeId)->value('type_code', ''); - $repository = app()->make(CacheRepository::class); - $agree = $repository->getResult('consign_product_agree'); - $agree['content'] = $agree['consign_product_agree']; - $agreeData[] = $agree; - if ($typeCode == Merchant::TypeCode['TypeStore']){ - $agree = $repository->getResult('mer_services_agree'); - $agree['content'] = $agree['mer_services_agree']; - $agreeData[] = $agree; + $status = $this->request->post('status', 0); + if ($this->userInfo) $data['uid'] = $this->userInfo->uid; + if ($status == 1) { + Db::name('merchant')->where('uid', $this->userInfo->uid)->update(['mer_settlement_agree_status'=>1]); } - if ($typeCode == Merchant::TypeCode['TypeSupplyChain'] || $typeCode == Merchant::TypeCode['TypeTownSupplyChain']){ - $agree = $repository->getResult('mer_supply_agree'); - $agree['content'] = $agree['mer_services_agree']; - $agreeData[] = $agree; - } - return app('json')->success($agreeData); + return app('json')->success('操作成功'); } public function businessApply() diff --git a/route/api.php b/route/api.php index e98cda10..5751c987 100644 --- a/route/api.php +++ b/route/api.php @@ -256,7 +256,7 @@ Route::group('api/', function () { //交易申请商户 Route::post('intention/business', 'api.store.merchant.MerchantIntention/businessApply'); //申请商户协议 - Route::get('intention/agree', 'api.store.merchant.MerchantIntention/agreeApply'); + Route::post('intention/settlement', 'api.store.merchant.MerchantIntention/settlementApply'); Route::get('intention/detail/:id', 'api.store.merchant.MerchantIntention/detail'); Route::post('intention/update/:id', 'api.store.merchant.MerchantIntention/update'); Route::post('store/product/group/cancel', 'api.store.product.StoreProductGroup/cancel');