|
|
@@ -3,6 +3,7 @@
|
|
|
namespace biz\ghs\classes;
|
|
|
|
|
|
use biz\shop\classes\ShopClass;
|
|
|
+use biz\shop\classes\ShopAdminClass;
|
|
|
use biz\sj\classes\MerchantAssetClass;
|
|
|
use biz\sj\classes\SjClass;
|
|
|
use biz\wx\classes\WxMessageClass;
|
|
|
@@ -222,6 +223,31 @@ class GhsClass extends BaseClass
|
|
|
}
|
|
|
$ids = array_column($list, 'shopId');
|
|
|
$shopInfo = ShopClass::getByIds($ids, null, 'id');
|
|
|
+
|
|
|
+ $mainIds = [];
|
|
|
+ foreach ($shopInfo as $shop) {
|
|
|
+ $mainId = $shop['mainId'] ?? 0;
|
|
|
+ if (!empty($mainId)) {
|
|
|
+ $mainIds[(int)$mainId] = (int)$mainId;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $mainIds = array_values($mainIds);
|
|
|
+
|
|
|
+ $founderStaffMap = [];
|
|
|
+ if (!empty($mainIds)) {
|
|
|
+ $founderStaffList = ShopAdminClass::getAllByCondition(
|
|
|
+ ['mainId' => ['in', $mainIds], 'founder' => 2, 'delStatus' => 0],
|
|
|
+ null,
|
|
|
+ 'id,mainId',
|
|
|
+ 'mainId',
|
|
|
+ true
|
|
|
+ );
|
|
|
+ foreach ($founderStaffList as $mainId => $founderStaff) {
|
|
|
+ //分享批发店时,通过这个员工找到相应批发店
|
|
|
+ $founderStaffMap[$mainId] = intval($founderStaff->id ?? 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
foreach ($list as $key => $val) {
|
|
|
$avatar = $val['avatar'] ?? '';
|
|
|
$list[$key]['shortAvatar'] = $avatar;
|
|
|
@@ -282,6 +308,9 @@ class GhsClass extends BaseClass
|
|
|
$pfLevel = $currentShop['pfLevel'] ?? 0;
|
|
|
$list[$key]['pfLevel'] = $pfLevel;
|
|
|
|
|
|
+ $mainId = $currentShop['mainId'] ?? 0;
|
|
|
+ $list[$key]['ghsShopAdminId'] = !empty($mainId) ? ($founderStaffMap[$mainId] ?? 0) : 0;
|
|
|
+
|
|
|
if (isset($val['mobile']) == false || empty($val['mobile'])) {
|
|
|
$mobile = $currentShop['mobile'] ?? '';
|
|
|
$list[$key]['mobile'] = $mobile;
|