feature/main20240421
guojia 7 months ago
parent bb38390a6e
commit 0621d25c11
  1. 11
      app/common/model/Merchant.php
  2. 13
      app/store/controller/Merchant.php

@ -77,16 +77,7 @@ class Merchant extends BaseModel
->where($this->getFilter($param))
->where('is_delete', '=', 0)
->order(['sort' => 'asc', $this->getPk()])
->paginate(15)->toArray();
foreach ($res['data'] as $kr => $r) {
$res[$kr]['licenseImg'] = [];
if ($r['license_img_id']) {
$img_ids = explode(",", $r['license_img_id']);
$files = UploadFile::getFileList($img_ids);
$res['data'][$kr]['licenseImg'] = $files ?: null;
}
}
->paginate(15);
return $res;
}

@ -13,6 +13,7 @@ declare (strict_types=1);
namespace app\store\controller;
use app\common\model\store\StoreSettle;
use app\common\model\UploadFile;
use think\response\Json;
use app\store\model\Merchant as MerchantModel;
use app\store\model\Style as StyleModel;
@ -111,8 +112,16 @@ class Merchant extends Controller
*/
public function list(): Json {
$model = new MerchantModel;
$list = $model->getList($this->request->param());
return $this->renderSuccess(compact('list'));
$list = $model->getList($this->request->param())->toArray();
foreach ($list['data'] as $kr => $r) {
$res[$kr]['licenseImg'] = [];
if ($r['license_img_id']) {
$img_ids = explode(",", $r['license_img_id']);
$files = UploadFile::getFileList($img_ids);
$list['data'][$kr]['licenseImg'] = $files ?: null;
}
}
return $this->renderSuccess($list);
}

Loading…
Cancel
Save