delete code

feature/main20240421
guojia 7 months ago
parent 45220c6c3e
commit 5c4b8000c2
  1. 48
      app/common/model/Merchant.php

@ -42,57 +42,13 @@ class Merchant extends BaseModel
* @param int $storeId
* @return static|array|null
*/
public static function detail(int $storeId)
public static function detail(int $merchantId)
{
try {
$list = self::withoutGlobalScope()
->with(['logoImage'])
->where('store_id', '=', $storeId)
->where('merchant_id', '=', $merchantId)
->find();
if ($list) {
if ($list['new_product_img_id']) {
$img_ids = explode(",", $list['new_product_img_id']);
$files = UploadFile::getFileList($img_ids);
$list['newProductImg'] = $files ?: null;
} else {
$list['newProductImg'] = null;
}
if ($list['big_brand_img_id']) {
$img_ids = explode(",", $list['big_brand_img_id']);
$files = UploadFile::getFileList($img_ids);
$list['bigBrandImg'] = $files ?: null;
} else {
$list['bigBrandImg'] = null;
}
if ($list['new_people_order_img_id']) {
$img_ids = explode(",", $list['new_people_order_img_id']);
$files = UploadFile::getFileList($img_ids);
$list['newPeopleOrderImg'] = $files ?: null;
} else {
$list['newPeopleOrderImg'] = null;
}
if ($list['presale_img_id']) {
$img_ids = explode(",", $list['presale_img_id']);
$files = UploadFile::getFileList($img_ids);
$list['presaleImg'] = $files ?: null;
} else {
$list['presaleImg'] = null;
}
if ($list['flash_sale_img_id']) {
$img_ids = explode(",", $list['flash_sale_img_id']);
$files = UploadFile::getFileList($img_ids);
$list['flashSaleImg'] = $files ?: null;
} else {
$list['flashSaleImg'] = null;
}
if ($list['ranking_img_id']) {
$img_ids = explode(",", $list['ranking_img_id']);
$files = UploadFile::getFileList($img_ids);
$list['rankingImg'] = $files ?: null;
} else {
$list['rankingImg'] = null;
}
}
return $list ?? null;
} catch (\Exception $e) {
return null;

Loading…
Cancel
Save