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, ]; } diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 833e5fee..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')->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; } @@ -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错误'); } diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index de3f57d7..0b814ec1 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -12,10 +12,12 @@ 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; 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 +103,16 @@ class MerchantIntention extends BaseController return app('json')->success('提交成功'); } + public function settlementApply() + { + $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]); + } + return app('json')->success('操作成功'); + } + public function businessApply() { if (!systemConfig('mer_intention_open')) { diff --git a/route/api.php b/route/api.php index 7c5d18e0..5751c987 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::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');