From febf033cd88e798eeeaebdd6b0d044e1597f7856 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 15 Mar 2024 10:50:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=95=86=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/merchant/Merchant.php | 37 +++++++++++++++++++ route/api.php | 1 + 2 files changed, 38 insertions(+) diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index 3f290681..3eb23a2c 100644 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -331,4 +331,41 @@ class Merchant extends BaseController return app('json')->success('修改成功'); } + + + public function info(MerchantTakeRepository $repository) + { + $id = $this->request->param('id'); + if (empty($id)) { + return app('json')->fail('参数错误'); + } + $merchant = app()->make(MerchantRepository::class)->search(['mer_id' => $id])->find(); + + // $data = Db::name('merchant')->where('mer_id', $id)->find(); + $merchant['mer_certificate'] = merchantConfig($id, 'mer_certificate'); + // $data['mer_certificate'] = $data['mer_certificate'][0] ?? ''; + $append = ['merchantCategory', 'merchantType', 'mer_certificate']; + if ($merchant['is_margin'] == -10) + $append[] = 'refundMarginOrder'; + + $data = $merchant->append($append)->hidden(['mark', 'reg_admin_id', 'sort','financial_bank'])->toArray(); + $delivery = $repository->get($id) + systemConfig(['tx_map_key']); + $data = array_merge($data, $delivery); + $data['sys_bases_status'] = systemConfig('sys_bases_status') === '0' ? 0 : 1; + $data['type_code'] = Db::name('MerchantType')->where('mer_type_id', $data['type_id'])->value('type_code'); + return app('json')->success($data); + } + + + + + + + + + + + + + } diff --git a/route/api.php b/route/api.php index 54805aa5..d1a8b38f 100644 --- a/route/api.php +++ b/route/api.php @@ -538,6 +538,7 @@ Route::group('api/', function () { Route::get('/local', 'Merchant/localLst'); //编辑商户信息 Route::post('update', 'Merchant/update'); + Route::get('info', 'Merchant/info'); })->prefix('api.store.merchant.'); Route::post('store/certificate/:merId', 'api.Auth/getMerCertificate'); From 4057040ce640e94ce2c1c5ca400bed3f044e3bb0 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 15 Mar 2024 10:56:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E6=88=B7?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/validate/merchant/MerchantUpdateValidate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/validate/merchant/MerchantUpdateValidate.php b/app/validate/merchant/MerchantUpdateValidate.php index 7a47dd51..39d69fdf 100644 --- a/app/validate/merchant/MerchantUpdateValidate.php +++ b/app/validate/merchant/MerchantUpdateValidate.php @@ -29,7 +29,7 @@ class MerchantUpdateValidate extends Validate 'mer_address|店铺地址' => 'require|max:128', 'long|店铺经度' => 'max:24', 'lat|店铺纬度' => 'max:24', - 'services_type|联系客服方式' => 'require|in:0,1', +// 'services_type|联系客服方式' => 'require|in:0,1', ]; protected function isPhone($val)