商品货源返回用户昵称

wysf
ztt 9 months ago
parent 7e218e86e2
commit e512174bcc
  1. 4
      app/store/controller/goods/Source.php

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace app\store\controller\goods;
use app\store\model\User;
use think\response\Json;
use app\store\controller\Controller;
use app\store\model\GoodsSource as GoodsSourceModel;
@ -28,6 +29,9 @@ class Source extends Controller
{
$modal = new GoodsSourceModel;
$list = $modal->getList($this->request->param());
$list->each(function ($v, $k){
$v['nickname'] = User::get($v['user_id'])->nick_name ?? '';
});
return $this->renderSuccess(compact('list'));
}

Loading…
Cancel
Save