|
|
|
@ -12,6 +12,7 @@ declare (strict_types=1); |
|
|
|
|
|
|
|
|
|
namespace app\store\controller; |
|
|
|
|
|
|
|
|
|
use app\store\model\UploadFile; |
|
|
|
|
use app\store\model\User as UserModel; |
|
|
|
|
use think\db\exception\DbException; |
|
|
|
|
use think\response\Json; |
|
|
|
@ -33,6 +34,21 @@ class User extends Controller |
|
|
|
|
// 用户列表 |
|
|
|
|
$model = new UserModel; |
|
|
|
|
$list = $model->getList($this->request->param()); |
|
|
|
|
if ($list->total() > 0) { |
|
|
|
|
$list->each(function ($item) { |
|
|
|
|
//邀请 |
|
|
|
|
$item->invite_user = []; |
|
|
|
|
if (!empty($item->invite->user)) { |
|
|
|
|
if (!empty($item->invite->user->avatar_id)) { |
|
|
|
|
$file = UploadFile::detail($item->invite->user->avatar_id); |
|
|
|
|
$item->invite->user->avatar_url = !empty($file->preview_url) ? $file->preview_url : ''; |
|
|
|
|
} |
|
|
|
|
$item->invite_user = $item->invite->user; |
|
|
|
|
} |
|
|
|
|
unset($item->invite); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|