|
|
|
@ -12,6 +12,7 @@ declare (strict_types=1); |
|
|
|
|
|
|
|
|
|
namespace app\api\controller; |
|
|
|
|
|
|
|
|
|
use app\api\model\Goods as GoodsModel; |
|
|
|
|
use app\common\model\store\StoreSettle; |
|
|
|
|
use app\common\model\UploadFile; |
|
|
|
|
use think\response\Json; |
|
|
|
@ -81,6 +82,15 @@ class Merchant extends Controller |
|
|
|
|
{ |
|
|
|
|
// 获取商品详情 |
|
|
|
|
$detail = MerchantModel::detail($id); |
|
|
|
|
if ($detail['license_img_id']) { |
|
|
|
|
$img_ids = explode(",", $detail['license_img_id']); |
|
|
|
|
$files = UploadFile::getFileList($img_ids); |
|
|
|
|
$detail['licenseImg'] = $files ?: null; |
|
|
|
|
} |
|
|
|
|
if ($detail['logo_image_id']) { |
|
|
|
|
$files = UploadFile::getFileList($detail['logo_image_id']); |
|
|
|
|
$detail['logoImage'] = $files ?: null; |
|
|
|
|
} |
|
|
|
|
return $this->renderSuccess(compact('detail')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -120,6 +130,7 @@ class Merchant extends Controller |
|
|
|
|
public function list(): Json { |
|
|
|
|
$model = new MerchantModel; |
|
|
|
|
$list = $model->getList($this->request->param())->toArray(); |
|
|
|
|
|
|
|
|
|
foreach ($list['data'] as $kr => $r) { |
|
|
|
|
$res[$kr]['licenseImg'] = []; |
|
|
|
|
if ($r['license_img_id']) { |
|
|
|
@ -127,6 +138,12 @@ class Merchant extends Controller |
|
|
|
|
$files = UploadFile::getFileList($img_ids); |
|
|
|
|
$list['data'][$kr]['licenseImg'] = $files ?: null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$modelgoods = new GoodsModel; |
|
|
|
|
$param = $this->request->param(); |
|
|
|
|
$params['merchantId'] = $r['id']; |
|
|
|
|
$listgoods = $modelgoods->getList($param, 3); |
|
|
|
|
$list['data'][$kr]['goodsInfo'] = $listgoods; |
|
|
|
|
} |
|
|
|
|
return $this->renderSuccess($list); |
|
|
|
|
} |
|
|
|
|