From e29afd5c502ee6f776c0451bae488689500ac5e3 Mon Sep 17 00:00:00 2001 From: codeliu <1873441552@qq.com> Date: Sat, 23 Mar 2024 14:16:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=93=8D=E4=BD=9C=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/merchant/MerchantIntentionRepository.php | 13 +++++++++++++ .../api/store/merchant/MerchantIntention.php | 12 ++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/system/merchant/MerchantIntentionRepository.php b/app/common/repositories/system/merchant/MerchantIntentionRepository.php index f85ef873..ae064bb5 100644 --- a/app/common/repositories/system/merchant/MerchantIntentionRepository.php +++ b/app/common/repositories/system/merchant/MerchantIntentionRepository.php @@ -13,6 +13,7 @@ namespace app\common\repositories\system\merchant; use app\common\Enum; +use app\common\model\system\admin\Admin; use app\common\model\system\merchant\Merchant; use app\common\model\system\merchant\MerchantCategory; use app\common\model\system\merchant\MerchantIntention; @@ -57,6 +58,18 @@ class MerchantIntentionRepository extends BaseRepository $list = $query->page($page, $limit) ->order('create_time DESC , status ASC')->with(['merchantCategory', 'merchantType']) ->select(); + foreach ($list as $k=> &$value){ + if ($value['admin_id']) { + $checkInfo = Admin::getDB()->where('admin_id',$value['admin_id'])->find(); + $value['check_name'] = $checkInfo['real_name']; + $value['check_phone'] = $checkInfo['phone']; + }else{ + $value['check_name'] = ''; + $value['check_phone'] = ''; + } + + } + return compact('count', 'list'); } diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 2edf509f..6a2aa2a6 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -13,6 +13,7 @@ namespace app\controller\api\store\merchant; use app\common\Enum; +use app\common\model\system\admin\Admin; use app\common\model\system\merchant\Merchant; use app\common\repositories\system\merchant\MerchantAdminRepository; use app\common\repositories\system\merchant\MerchantCategoryRepository; @@ -363,8 +364,15 @@ class MerchantIntention extends BaseController //后期看改 foreach ($list as $k => &$v){ $v['mer_avatar'] = Merchant::getDB()->where('uid',$v['uid'])->value('mer_avatar'); - $v['check_name'] = "小方"; - $v['check_phone'] = "18715236963"; + + if ($v['admin_id']) { + $checkInfo = Admin::getDB()->where('admin_id',$v['admin_id'])->find(); + $v['check_name'] = $checkInfo['real_name']; + $v['check_phone'] = $checkInfo['phone']; + }else{ + $v['check_name'] = ''; + $v['check_phone'] = ''; + } $v['check_avatar'] = "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/56d04202403211340336015.png"; }