From c288f994561c90e3a9bee1579bf949a5b8fcb06d Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 25 Apr 2024 17:22:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E5=95=86=E6=88=B7?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=BB=91=E5=AE=9A=20=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E8=82=A1=E4=B8=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/system/merchant/Merchant.php | 7 ++++++- .../system/merchant/MerchantRepository.php | 16 +++++++++++----- .../admin/system/merchant/Merchant.php | 3 ++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/common/model/system/merchant/Merchant.php b/app/common/model/system/merchant/Merchant.php index caf7c56..dc3792f 100644 --- a/app/common/model/system/merchant/Merchant.php +++ b/app/common/model/system/merchant/Merchant.php @@ -18,6 +18,7 @@ use app\common\model\store\service\StoreService; use app\common\model\system\config\SystemConfigValue; use app\common\model\system\financial\Financial; use app\common\model\system\serve\ServeOrder; +use app\common\model\user\User; use app\common\repositories\store\order\StoreOrderRepository; use app\common\repositories\store\StoreActivityRepository; use app\common\repositories\system\merchant\MerchantRepository; @@ -287,10 +288,14 @@ class Merchant extends BaseModel public function agent(){ return $this->hasOne(Agent::class,'id', 'agent_id')->where('is_del', 0); } - + // 品牌信息 public function brand(){ return $this->hasOne(MerchantBrand::class,'id', 'brand_id'); } + // 资源股东 + public function shareholders(){ + return $this->hasOne(User::class,'uid', 'resource_shareholders_uid'); + } /** * Common: 获取本月销售数量 diff --git a/app/common/repositories/system/merchant/MerchantRepository.php b/app/common/repositories/system/merchant/MerchantRepository.php index c84dffe..d25f49d 100644 --- a/app/common/repositories/system/merchant/MerchantRepository.php +++ b/app/common/repositories/system/merchant/MerchantRepository.php @@ -835,11 +835,17 @@ class MerchantRepository extends BaseRepository * @author Qinii * @day 2023/7/1 */ - public function adminDetail($id) - { - $data = $this->dao->getWhere(['mer_id' => $id],'*',['merchantType','merchantCategory','merShop'=>function($query){ - $query->field('mer_id,mer_name,shop_mer_id'); - }])->toArray(); + public function adminDetail($id){ + $data = $this->dao->getWhere(['mer_id' => $id],'*',[ + 'shareholders' => function($query){ + $query->field('uid,nickname,avatar'); + }, + 'merchantType', + 'merchantCategory', + 'merShop' => function($query){ + $query->field('mer_id,mer_name,shop_mer_id'); + } + ])->toArray(); $make = app()->make(MerchantAdminRepository::class); $data['mer_account'] = $make->merIdByAccount($id); $data['mer_password'] = '***********'; diff --git a/app/controller/admin/system/merchant/Merchant.php b/app/controller/admin/system/merchant/Merchant.php index bdd9758..8f55c8f 100644 --- a/app/controller/admin/system/merchant/Merchant.php +++ b/app/controller/admin/system/merchant/Merchant.php @@ -228,7 +228,8 @@ class Merchant extends BaseController 'mer_label', ['merchant_type',0], 'shop_mer_id', - 'brand_id' + 'brand_id', + ['resource_shareholders_uid',0], ]); $data['mer_label'] = str_replace(',',',',$data['mer_label']); if (!$isUpdate) {