优化代码

main
home.fengxinyhyl 6 months ago
parent eee9f3cea9
commit 048ca68ac7
  1. 4
      app/common/repositories/system/merchant/MerchantRepository.php
  2. 2
      app/controller/api/store/product/StoreSpu.php

@ -347,10 +347,10 @@ class MerchantRepository extends BaseRepository
public function detail($id, $userInfo) public function detail($id, $userInfo)
{ {
$merchant = $this->dao->apiGetOne($id)->hidden([ $merchant = $this->dao->apiGetOne($id)->hidden([
"real_name", "mer_phone", "reg_admin_id", "sort", "is_del", "is_audit", "is_best", "mer_state", "bank", "bank_number", "bank_name", 'update_time', "real_name", "reg_admin_id", "sort", "is_del", "is_audit", "is_best", "mer_state", "bank", "bank_number", "bank_name", 'update_time',
'financial_alipay', 'financial_bank', 'financial_wechat', 'financial_type','mer_take_phone' 'financial_alipay', 'financial_bank', 'financial_wechat', 'financial_type','mer_take_phone'
]); ]);
$merchant->append(['type_name', 'isset_certificate', 'services_type']); $merchant->append(['type_name', 'isset_certificate', 'services_type','mer_certificate']);
$merchant['care'] = false; $merchant['care'] = false;
if ($userInfo) if ($userInfo)
$merchant['care'] = $this->getCareByUser($id, $userInfo->uid); $merchant['care'] = $this->getCareByUser($id, $userInfo->uid);

@ -64,7 +64,9 @@ class StoreSpu extends BaseController
]); ]);
$where['is_gift_bag'] = 0; $where['is_gift_bag'] = 0;
$where['product_type'] = 0; $where['product_type'] = 0;
if($limit == 20){
$where['is_good'] = 1; $where['is_good'] = 1;
}
$where['order'] = $where['order'] ?: 'rank'; $where['order'] = $where['order'] ?: 'rank';
if ($where['is_trader'] != 1) unset($where['is_trader']); if ($where['is_trader'] != 1) unset($where['is_trader']);
$data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo); $data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo);

Loading…
Cancel
Save